Deeply Understand Large Language Models
CookLLM helps you master every detail of large language models through from-scratch code implementations and clear interactive documentation.
Why CookLLM
Calling an API is not the same as understanding it
When a model breaks, those who only call APIs are stuck; those who understand the internals can debug, optimize, and improve. CookLLM takes you down the second path.
Treating models as a black box
- Only importing libraries, tuning params by trial and error
- Training diverges or OOMs, with no idea where to look
- Freezing up when asked about internals in interviews
- Understanding the math in papers, but unable to code it
Building every layer from scratch
- Implement every core module yourself, no blind spots
- Know the root cause when things break, and how to fix it
- Reason from first principles, ace the interview
- Map every formula to code, and truly master it
Curriculum
Six pillars of Fundamentals + a Hands-on Training track, covering every key decision in training an LLM
Six pillars, from the ground up to the frontier
Organized around the key decisions you must make to train an LLM — from language-model foundations all the way to post-training alignment.
- BasicsTokenization · Transformer · Optimization
- SystemsGPU Kernels · Parallelism · Inference
- ScalingScaling Laws · Compute Budget
- DataCleaning · Filtering · Dedup · Mixing
- EvaluationBenchmarks · Parsing · Reliability
- Post-trainingSFT · RLHF · GRPO · DPO
Train and align a small model from scratch
Built on the cookllm-bento codebase — from data and tokenizer to pretraining, fine-tuning, and alignment, running your own small model end-to-end (BentoLM 29M→134M).
- Data prepDownload · Clean · Pack
- Tokenizer trainingRustBPE · tiktoken
- Model buildBentoLM · RoPE · Muon
- PretrainingBase LM · Lightning
- MidtrainingLong context · RoPE scaling
- Post-training alignmentSFT · RLHF · PPO
What Makes It Different
Not just reading along — actually writing it yourself
From Scratch
No high-level framework wrappers; every core module is built by hand from first principles.
Interactive Docs
Formulas, diagrams, and runnable code combined — read and run as you go.
Companion Code
Two complete codebases — fundamentals (recipes) and training (bento) — to follow alongside the docs.
Private Repo + Lifetime Updates
Pay once to permanently unlock the GitHub private repo and all future chapters.
Pricing
Pay once, get lifetime access to all chapters and code
Lifetime
One-time payment for all premium features
- Full runnable source code
- Exclusive interactive visualizations
- Deep dive into model training
- Production-grade hands-on projects
- Free content updates forever
- Unlock all current and future chapters
- Early access to experimental features (Beta)
FAQ
Answers about the content, who it's for, and how you'll learn
Start deeply understanding large language models today
From tokenizer to distributed training, build your own LLM engineering skills from scratch.