Serving and benchmarking
a small language model.
A minimal server, two sequence-length experiments, and an illustrated introduction to prefill and decode. Follow the code, explore the measurements, and test your intuition.
Inference is what happens when a trained language model processes a prompt and generates a response. Learn how it works by building the pieces yourself.
This series starts with a small model server, then works through generation loops, KV caches, batching, and GPU kernels. Each lesson pairs working code with measurements to understand what makes a model faster, what uses memory, and which tradeoffs matter when serving real requests.
A minimal server, two sequence-length experiments, and an illustrated introduction to prefill and decode. Follow the code, explore the measurements, and test your intuition.