curly-train
A transformer language model written and trained from scratch on anime dialogue, with a live 3D graph of the tokens it generates.
- Year
- 2026
- Status
- Built
- Stack
- Python, FastAPI, JavaScript, Three.js
- Links
- Source code
Context
A from-first-principles project: no pre-trained weights and no tokenizer libraries.
The problem
Understanding how a GPT works means building every part of one.
Architecture
A custom byte-pair-encoding tokenizer, a GPT-style transformer, a FastAPI backend that streams tokens over server-sent events, and a Three.js scene that places each token on a sphere.
Implementation
Trained on about 3,200 lines of Classroom of the Elite dialogue, with cosine learning-rate decay and pre-norm residual blocks.
Outcomes and lessons
6 GitHub stars.