Interactive companion · Build a Large Language Model (From Scratch)
Go from raw text to a working assistant: tokenizers, attention, a full GPT, pretraining, loading real GPT-2 weights, and two kinds of fine-tuning. Every concept comes with a short explanation, a widget to play with, a notebook where you write the code, and a quiz that checks you really got it.
Three stages, nine steps. Click a step to see what you will build.
Every chapter follows the same loop.
Short, original explanations organized like the book's sections. Each starts with why, then how, with diagrams and math.
Chapter pageWidgets that isolate one idea at a time: change the input, temperature, mask or rank, and watch what happens. Each comes with a "Try this" prompt.
In the pageImplement every component yourself in TODO cells. Automatic checks give instant ✅/❌ with targeted hints.
Jupyter lab notebookChapter quizzes with explanations, spaced-repetition flashcards, the book's exercises and harder stretch challenges.
Quiz · cards · labAppendices sit where you need them. The capstone puts it all together.
Stored only in this browser.
| Chapter | Sections | Quiz best | Cards mastered | Cards due |
|---|
See README.md for details.
python3 -m http.server -d web 8000
# open http://localhost:8000source .venv/bin/activate
jupyter lab --port 8888 # from the project root
"Open the lab" links on chapter pages point to localhost:8888.
Sections are cited like 📖 Book §3.4, so you can read the original alongside. All text, diagrams and code here are original.