Commit graph

1 commit

Author SHA1 Message Date
Claude
1d3ce8cff7
Add basic LLM implementation from scratch
Implements a character-level GPT-style Transformer:
- model.py: CausalSelfAttention, FeedForward, TransformerBlock, LLM
- tokenizer.py: CharTokenizer (char -> int mapping)
- train.py: training loop with AdamW, gradient clipping, checkpointing, sampling
- generate.py: load checkpoint and generate text from a prompt

Verified working on a built-in Shakespeare excerpt (805k param model).

https://claude.ai/code/session_01SWXLQb3nFTiygbp74dpjVa
2026-03-22 22:51:49 +00:00