How pranav1237/minillm works
MiniLLM is a small decoder-only Transformer project with two related paths: a documented character-level demo and a newer dialogue-model workflow. The main product flow processes dialogue CSVs, trains a tokenizer and Transformer, saves artifacts, then generates replies through a CLI or HTTP endpoint. The README also describes the standalone character-level path, and the model implementations are distinct. Edges reflect explicit README statements or shown calls; unsampled UI and deployment wiring is omitted.
Main entry points: train.py Training loop · infer.py Reply generation · chat.py HTTP chat API · data_pipeline.py Dialogue preprocessing
Components 17
Dialogue data
- Dialogue CSVs
data - Dialogue preprocessing
src/mini_llm/data_pipeline.py - Processed splits
data - Character training text
data/random.txt
Model training
- SentencePiece tokenizer
src/mini_llm/tokenizer_utils.py - Training loop
src/mini_llm/train.py - Model artifacts
- Device selection
src/mini_llm/runtime.py - Character LM training
train_char_lm.py
Generation
- Reply generation
src/mini_llm/infer.py - Chat CLI
scripts/chat.py - HTTP chat API
api/chat.py - Character generation
generate.py
Transformer models
- Dialogue Transformer
src/mini_llm/model.py - Standalone Transformer
mini_transformer.py
Other components
- User
- Web client
Connections 22
- Dialogue CSVs → Dialogue preprocessing: reads
src/mini_llm/data_pipeline.py - Dialogue preprocessing → Processed splits: writes
src/mini_llm/data_pipeline.py - Training loop → Dialogue preprocessing: processes splits
src/mini_llm/train.py - Training loop → Processed splits: reads
src/mini_llm/train.py - Training loop → SentencePiece tokenizer: trains and encodes
src/mini_llm/train.py - Training loop → Dialogue Transformer: builds and trains
src/mini_llm/train.py - Training loop → Device selection: selects device
src/mini_llm/train.py - Training loop → Model artifacts: saves weights
src/mini_llm/train.py - Reply generation → Model artifacts: loads weights
src/mini_llm/infer.py - Reply generation → SentencePiece tokenizer: loads and uses
src/mini_llm/infer.py - Reply generation → Dialogue Transformer: runs generation
src/mini_llm/infer.py - Reply generation → Device selection: selects device
src/mini_llm/infer.py - User → Chat CLI: enters prompts
scripts/chat.py - Chat CLI → Reply generation: requests replies
scripts/chat.py - Web client → HTTP chat API: sends prompts
- HTTP chat API → Model artifacts: loads bundled artifacts
api/chat.py - HTTP chat API → SentencePiece tokenizer: loads tokenizer
api/chat.py - HTTP chat API → Dialogue Transformer: builds and runs
api/chat.py - Character training text → Character LM training: trains from
readme.md - Character LM training → Standalone Transformer: trains
- Character generation → Standalone Transformer: loads model
generate.py - User → Character generation: provides prompt
readme.md