# fernanh98/secretcodellm architecture

> Architecture diagram of the GitHub repository fernanh98/secretcodellm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fernanh98/secretcodellm
- Repository: https://github.com/fernanh98/secretcodellm

## Overview

SecretCodeGame is a turn-based, two-team word-association game used to examine LLM reasoning. The principal workflow is a captain providing a clue, a teammate guessing words, and the game evaluating guesses until a team wins; results capture round and player details. The source excerpts show board setup and result construction, plus an Ollama-backed model wrapper and typed schemas. Several game-to-module interactions are implied by imports and names, but the relevant calls fall in omitted excerpts, so those links are marked unverified.

Main entry points: [`src/game.py`](https://github.com/fernanh98/secretcodellm/blob/main/src/game.py) (Captains and guessers), [`src/llm_wrapper.py`](https://github.com/fernanh98/secretcodellm/blob/main/src/llm_wrapper.py) (Model wrapper), [`src/schemas.py`](https://github.com/fernanh98/secretcodellm/blob/main/src/schemas.py) (Game and result schemas), [`src/prompts.py`](https://github.com/fernanh98/secretcodellm/blob/main/src/prompts.py) (Role prompts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game runtime"]
  node_players["Captains and guessers<br/>[game.py]"]
  node_game["Game engine<br/>[game.py]"]
  node_board["Board setup<br/>[game.py]"]
end

subgraph group_reasoning["Reasoning and models"]
  node_prompts["Role prompts<br/>[prompts.py]"]
  node_tools["Player tools<br/>[tools.py]"]
  node_llm["Model wrapper<br/>[llm_wrapper.py]"]
end

subgraph group_domain["Game data"]
  node_words["Word bank<br/>[words.py]"]
  node_schemas["Game and result schemas<br/>[schemas.py]"]
end

node_ollama["Ollama model"]

node_game -->|"sets up"| node_board
node_game -->|"creates results"| node_schemas
node_game -.->|"runs turns"| node_players
node_players -.->|"uses prompts"| node_prompts
node_players -.->|"requests responses"| node_llm
node_players -.->|"uses tool calls"| node_tools
node_board -.->|"draws words"| node_words
node_llm -->|"invokes"| node_ollama
node_llm -->|"returns messages"| node_schemas

click node_players "https://github.com/fernanh98/secretcodellm/blob/main/src/game.py"
click node_game "https://github.com/fernanh98/secretcodellm/blob/main/src/game.py"
click node_board "https://github.com/fernanh98/secretcodellm/blob/main/src/game.py"
click node_prompts "https://github.com/fernanh98/secretcodellm/blob/main/src/prompts.py"
click node_tools "https://github.com/fernanh98/secretcodellm/blob/main/src/tools.py"
click node_llm "https://github.com/fernanh98/secretcodellm/blob/main/src/llm_wrapper.py"
click node_words "https://github.com/fernanh98/secretcodellm/blob/main/src/words.py"
click node_schemas "https://github.com/fernanh98/secretcodellm/blob/main/src/schemas.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_players,node_game,node_board toneBlue
class node_prompts,node_tools,node_llm toneAmber
class node_words,node_schemas toneMint
class node_ollama toneIndigo
```

## Components

### Game runtime

- [Captains and guessers](https://github.com/fernanh98/secretcodellm/blob/main/src/game.py): `src/game.py`
- [Game engine](https://github.com/fernanh98/secretcodellm/blob/main/src/game.py): `src/game.py`
- [Board setup](https://github.com/fernanh98/secretcodellm/blob/main/src/game.py): `src/game.py`

### Reasoning and models

- [Role prompts](https://github.com/fernanh98/secretcodellm/blob/main/src/prompts.py): `src/prompts.py`
- [Player tools](https://github.com/fernanh98/secretcodellm/blob/main/src/tools.py): `src/tools.py`
- [Model wrapper](https://github.com/fernanh98/secretcodellm/blob/main/src/llm_wrapper.py): `src/llm_wrapper.py`

### Game data

- [Word bank](https://github.com/fernanh98/secretcodellm/blob/main/src/words.py): `src/words.py`
- [Game and result schemas](https://github.com/fernanh98/secretcodellm/blob/main/src/schemas.py): `src/schemas.py`

### Other components

- **Ollama model**

## Connections

- Game engine → Board setup: sets up (evidence: `src/game.py`)
- Game engine → Game and result schemas: creates results (evidence: `src/game.py`)
- Game engine → Captains and guessers: runs turns (evidence: `src/game.py`)
- Captains and guessers → Role prompts: uses prompts (evidence: `src/game.py`)
- Captains and guessers → Model wrapper: requests responses (evidence: `src/game.py`)
- Captains and guessers → Player tools: uses tool calls (evidence: `src/game.py`)
- Board setup → Word bank: draws words (evidence: `src/game.py`)
- Model wrapper → Ollama model: invokes (evidence: `src/llm_wrapper.py`)
- Model wrapper → Game and result schemas: returns messages (evidence: `src/llm_wrapper.py`)
