# dheeraj932/llm-20-questions-game architecture

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

- Interactive diagram: https://gitdiagram.com/dheeraj932/llm-20-questions-game
- Repository: https://github.com/dheeraj932/llm-20-questions-game

## Overview

This repository is a notebook-based 20 Questions gamebot. A user supplies yes/no answers while the bot alternates between asking questions and making word guesses, ending when it guesses correctly or reaches 20 questions. The README documents that the Meta-Llama-3.1-8B-Instruct model supports both question and guess generation through Hugging Face Transformers. No source excerpts were provided, so the graph reflects documented behavior only; the notebook’s internal call structure is not verified.

Main entry points: [`LLM 20 Questions Game.ipynb`](https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb) (Game interaction loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game runtime"]
  node_loop["Game interaction loop"]
  node_questions["Question generation"]
  node_guesses["Word guessing"]
  node_termination["Game termination"]
end

subgraph group_model["Language model"]
  node_llama["Meta-Llama 3.1 8B"]
  node_transformers["Hugging Face Transformers"]
end

node_user(("Player"))

node_user -->|"answers yes/no"| node_loop
node_loop -->|"asks questions"| node_questions
node_loop -->|"makes guesses"| node_guesses
node_questions -->|"generates questions"| node_llama
node_guesses -->|"generates guesses"| node_llama
node_loop -->|"ends on success or limit"| node_termination
node_llama -->|"uses library"| node_transformers

click node_loop "https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb"
click node_questions "https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb"
click node_guesses "https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb"
click node_termination "https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb"

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_loop,node_questions,node_guesses,node_termination toneBlue
class node_llama,node_transformers toneAmber
class node_user toneIndigo
```

## Components

### Game runtime

- [Game interaction loop](https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb): `LLM 20 Questions Game.ipynb`
- [Question generation](https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb): `LLM 20 Questions Game.ipynb`
- [Word guessing](https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb): `LLM 20 Questions Game.ipynb`
- [Game termination](https://github.com/dheeraj932/llm-20-questions-game/blob/main/LLM%2020%20Questions%20Game.ipynb): `LLM 20 Questions Game.ipynb`

### Language model

- **Meta-Llama 3.1 8B**
- **Hugging Face Transformers**

### Other components

- **Player**

## Connections

- Player → Game interaction loop: answers yes/no (evidence: `README.md`)
- Game interaction loop → Question generation: asks questions (evidence: `README.md`)
- Game interaction loop → Word guessing: makes guesses (evidence: `README.md`)
- Question generation → Meta-Llama 3.1 8B: generates questions (evidence: `README.md`)
- Word guessing → Meta-Llama 3.1 8B: generates guesses (evidence: `README.md`)
- Game interaction loop → Game termination: ends on success or limit (evidence: `README.md`)
- Meta-Llama 3.1 8B → Hugging Face Transformers: uses library (evidence: `README.md`)
