A free, visual course in 14 lessons
An H100 does a thousand trillion operations a second. Llama 3.1 8B on it writes about 223 tokens a second for one user.
The gap is not a bug. It is the first thing to understand about serving language models, and this course starts there. It is for engineers who have called a model through an API and never had to run one. You need arithmetic, not a background in GPUs.
A fast clerk, a slow belt
The 3D view could not load. The three stages are described below.
By the end
You will be able to do three things
223 tokens/s
Predict speed from a spec sheet. Take a model's size and a GPU's memory bandwidth and work out the most tokens a second one user can get, before you rent anything.
52 conversations
Size the memory. Work out how many 8,192-token conversations fit on one 80 GB GPU beside the model, and which fixes buy more room.
141 GB on 80 GB GPUs
Serve a model that does not fit. The final exam is a Serving Lab challenge: Llama 3.1 70B on as few GPUs as you can, inside a latency promise.
How it works
One incident, one picture, one page
You are the first inference engineer at a small startup. Its chatbot, Parrot, runs Llama 3.1 8B on one H100. Every lesson opens with something going wrong, and answers it.
- A scene that plays by itself. The whole mechanism in one moving shot, with the real numbers on it.
- A short page. A few sections, each one idea, one figure and a few sentences.
- A playground. Sliders for the model, the GPU and the load, so you can break it yourself.
- A workbook. The formulas, the derivation, graded exercises and the sources, on a separate page.
Every number on the site is computed from the published model and hardware figures by one tested module. The Serving Lab is a simulator where you run a whole server and try the challenges.
The course
14 lessons, in order
Part 1 One request
What a GPU does to write one reply, and what limits it.
- The roofline
Incident: The fast GPU that types slowly
Why is generating a token so much slower than the GPU’s FLOP rating suggests?
- What one token costs
Incident: Where do 15 GB per token go?
Where do the FLOPs and bytes of a forward pass actually go?
- Prefill and decode
Incident: Slow to start, fast to type
Why are time to first token and time per token two different problems?
Part 2 What the model remembers
The notes a model keeps, and how they fill the memory.
- The KV cache
Incident: The memory alarm
What does a model remember between tokens, and how much memory does it take?
- Shrinking the cache: MQA, GQA, MLA
Incident: Should we switch models?
How do newer attention designs cut KV memory without losing quality?
Part 3 Many users at once
Sharing one GPU between everyone who is waiting.
- Continuous batching
Incident: Everyone waits for the slowest reply
How do servers keep the GPU busy when requests start and stop at different times?
- Paged KV memory
Incident: Full, but half empty
Why did borrowing virtual memory from operating systems double serving throughput?
- Prefix caching
Incident: The same 2,000 tokens, ten thousand times a day
When can two requests share work, and why must prefixes match token for token?
Part 4 Doing less work
Three ways to get the same answer for fewer bytes or fewer steps.
- FlashAttention
Incident: The long-document launch
How do you compute attention without ever writing the attention matrix to memory?
- Quantization
Incident: The GPU bill
When does using fewer bits make inference faster, and when does it only save memory?
- Speculative decoding
Incident: One user, twice as fast
How can a small model make a big model generate faster without changing its output?
Part 5 Running it for real
Long prompts, models too big for one GPU, and proving it works.
- Chunked prefill and disaggregation
Incident: One long prompt freezes everyone
How do you stop long prompts from stalling everyone else’s tokens?
- Tensor and pipeline parallelism
Incident: The model that does not fit
How do you serve a model that does not fit on one GPU?
- Measuring a serving system
Incident: Prove it
What are TTFT, TPOT and goodput, and how do you benchmark them honestly?
The final exam
Serve a 70B model on the fewest H100s
Serve Llama 3.1 70B at 3 requests/s (about 1,000-token prompts, 256-token answers) with p99 time to first token under 0.5 s and p99 time per output token under 50 ms. Use as few GPUs as you can.