# wollymonjac/tiny-2.1 architecture

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

- Interactive diagram: https://gitdiagram.com/wollymonjac/tiny-2.1
- Repository: https://github.com/wollymonjac/tiny-2.1

## Overview

TINY 2.1 is a small DOS question-answering transformer with a separate Python training kit. The main user workflow is to enter a question in the DOS program, have its letter-by-letter model produce an answer, and see the live monitor and hear the robot voice. The training workflow turns fact files into varied question-answer examples, trains and evaluates a PyTorch model, then exports weights for DOS. The graph also shows geography fact enrichment. Some runtime and training details are supported by README statements rather than sampled implementation excerpts.

Main entry points: [`dos/TINY.C`](https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C) (Letterwise inference), [`training/train2.py`](https://github.com/wollymonjac/tiny-2.1/blob/main/training/train2.py) (Model trainer), [`training/facts`](https://github.com/wollymonjac/tiny-2.1/tree/main/training/facts) (Fact corpus), [`training/gen2.py`](https://github.com/wollymonjac/tiny-2.1/blob/main/training/gen2.py) (Question generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dos_runtime["DOS Runtime"]
  node_tiny_ui["Question interface<br/>[TINY.C]"]
  node_inference["Letterwise inference<br/>[TINY.C]"]
  node_neural_monitor["Neural monitor<br/>[TINY.C]"]
  node_speaker_voice["Speaker voice<br/>[TINY.C]"]
  node_dos_weights[("DOS weights<br/>[TINY.BIN]")]
end

subgraph group_training_data["Training Data"]
  node_fact_corpus[("Fact corpus")]
  node_geo_enrichment["Geography enrichment<br/>[geo2.py]"]
  node_extra_enrichment["Extra fact enrichment<br/>[extra_facts.py]"]
  node_question_generator["Question generator<br/>[gen2.py]"]
end

subgraph group_model_training["Model Training"]
  node_trainer["Model trainer<br/>[train2.py]"]
  node_checkpoint[("Model checkpoint<br/>[tiny2.pt]")]
  node_exported_weights["Exported weights"]
end

node_dos_user(("DOS user"))
node_training_user(("Training user"))

node_dos_user -->|"asks question"| node_tiny_ui
node_tiny_ui -->|"runs inference"| node_inference
node_inference -->|"reads weights"| node_dos_weights
node_inference -->|"reports progress"| node_neural_monitor
node_inference -->|"speaks letters"| node_speaker_voice
node_training_user -->|"generates examples"| node_question_generator
node_fact_corpus -->|"supplies facts"| node_question_generator
node_question_generator -->|"samples pairs"| node_trainer
node_trainer -->|"saves model"| node_checkpoint
node_trainer -->|"exports weights"| node_exported_weights
node_exported_weights -->|"replaces weights"| node_dos_weights
node_geo_enrichment -->|"writes geography facts"| node_fact_corpus
node_extra_enrichment -->|"writes extra facts"| node_fact_corpus

click node_tiny_ui "https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C"
click node_inference "https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C"
click node_neural_monitor "https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C"
click node_speaker_voice "https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C"
click node_dos_weights "https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.BIN"
click node_fact_corpus "https://github.com/wollymonjac/tiny-2.1/tree/main/training/facts"
click node_geo_enrichment "https://github.com/wollymonjac/tiny-2.1/blob/main/training/geo2.py"
click node_extra_enrichment "https://github.com/wollymonjac/tiny-2.1/blob/main/training/extra_facts.py"
click node_question_generator "https://github.com/wollymonjac/tiny-2.1/blob/main/training/gen2.py"
click node_trainer "https://github.com/wollymonjac/tiny-2.1/blob/main/training/train2.py"
click node_checkpoint "https://github.com/wollymonjac/tiny-2.1/blob/main/training/tiny2.pt"
click node_exported_weights "https://github.com/wollymonjac/tiny-2.1/tree/main/training"

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_tiny_ui,node_inference,node_neural_monitor,node_speaker_voice,node_dos_weights,node_dos_user,node_training_user toneBlue
class node_fact_corpus,node_geo_enrichment,node_extra_enrichment,node_question_generator toneAmber
class node_trainer,node_checkpoint,node_exported_weights toneMint
```

## Components

### DOS Runtime

- [Question interface](https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C): `dos/TINY.C`
- [Letterwise inference](https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C): `dos/TINY.C`
- [Neural monitor](https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C): `dos/TINY.C`
- [Speaker voice](https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.C): `dos/TINY.C`
- [DOS weights](https://github.com/wollymonjac/tiny-2.1/blob/main/dos/TINY.BIN): `dos/TINY.BIN`

### Training Data

- [Fact corpus](https://github.com/wollymonjac/tiny-2.1/tree/main/training/facts): `training/facts`
- [Geography enrichment](https://github.com/wollymonjac/tiny-2.1/blob/main/training/geo2.py): `training/geo2.py`
- [Extra fact enrichment](https://github.com/wollymonjac/tiny-2.1/blob/main/training/extra_facts.py): `training/extra_facts.py`
- [Question generator](https://github.com/wollymonjac/tiny-2.1/blob/main/training/gen2.py): `training/gen2.py`

### Model Training

- [Model trainer](https://github.com/wollymonjac/tiny-2.1/blob/main/training/train2.py): `training/train2.py`
- [Model checkpoint](https://github.com/wollymonjac/tiny-2.1/blob/main/training/tiny2.pt): `training/tiny2.pt`
- [Exported weights](https://github.com/wollymonjac/tiny-2.1/tree/main/training): `training`

### Other components

- **DOS user**
- **Training user**

## Connections

- DOS user → Question interface: asks question (evidence: `README.md`)
- Question interface → Letterwise inference: runs inference (evidence: `README.md`)
- Letterwise inference → DOS weights: reads weights (evidence: `README.md`)
- Letterwise inference → Neural monitor: reports progress (evidence: `dos/TINY.C`)
- Letterwise inference → Speaker voice: speaks letters (evidence: `README.md`)
- Training user → Question generator: generates examples (evidence: `README.md`)
- Fact corpus → Question generator: supplies facts (evidence: `README.md`)
- Question generator → Model trainer: samples pairs (evidence: `training/train2.py`)
- Model trainer → Model checkpoint: saves model (evidence: `training/train2.py`)
- Model trainer → Exported weights: exports weights (evidence: `README.md`)
- Exported weights → DOS weights: replaces weights (evidence: `README.md`)
- Geography enrichment → Fact corpus: writes geography facts (evidence: `training/geo2.py`)
- Extra fact enrichment → Fact corpus: writes extra facts (evidence: `training/extra_facts.py`)
