How notphrog/dumbgpt works
dumbGPT is a terminal-based text generator: users choose an n-gram size, load a registered template or provide text files, then prompt the trained engine and view generated text. Its documented runtime includes template reuse, custom training data, Katz backoff, weighted token selection, and punctuation-aware output. The implementation is a single C++ file; the source excerpt omits some template-loading and output-handling details, so those links are limited to documented behavior.
Main entry points: ai_markov.cpp Interactive CLI · template_registry.txt Template registry · templates Template manifests · training_data Training corpora
Components 13
Terminal workflow
- Interactive CLI
ai_markov.cpp - Generated text
Training data
- Template registry
template_registry.txt - Template manifests
templates - Training corpora
training_data
Generation engine
- File trainer
ai_markov.cpp - Text tokenizer
ai_markov.cpp - N-gram map
ai_markov.cpp - Backoff sampler
ai_markov.cpp - Text generator
ai_markov.cpp - Output formatting
ai_markov.cpp
Other components
- User
- Custom text files
Connections 19
- User → Interactive CLI: chooses settings
- Interactive CLI → Template registry: reads index
- Interactive CLI → Template manifests: loads manifest
- Interactive CLI → Custom text files: accepts paths
- Interactive CLI → File trainer: trains on files
- Training corpora → File trainer: provides text
- Custom text files → File trainer: provides text
- File trainer → Text tokenizer: tokenizes text
- Text tokenizer → N-gram map: adds transitions
- Interactive CLI → Text generator: submits prompt
- Text generator → Text tokenizer: tokenizes prompt
- Text generator → Backoff sampler: requests next token
- Backoff sampler → N-gram map: looks up contexts
- Backoff sampler → Text generator: returns token
- Text generator → Output formatting: formats sequence
- Interactive CLI → Generated text: displays result
- Output formatting → Generated text: produces text
- Interactive CLI → Template manifests: saves manifests
- Interactive CLI → Template registry: registers template