Skip to content
All courses

Course 04

Inference Engineering --- how models run in production

How models actually run - the generation loop, prefill and decode, batching, KV cache, the serving stack, and the workloads that changed the job.

For engineers who have trained a model and now need it to serve users - latency, throughput, the hardware budget.

8
modules
94
lessons
93
curated videos
15h 20m
of video
01

The Generation Loop

Understand how an LLM produces text token by token --- from the forward pass and logits through sampling and stopping to the serving stack that puts it all in production.

11 lessons · 11 videos · Free
02

The Hardware Floor

Measure and model GPU performance from first principles --- throughput vs latency, FLOPs and bytes, the memory hierarchy, arithmetic intensity, the roofline model, and why decode is memory bound. By the end you can read a profiler trace and name exactly which regime your bottleneck lands in.

12 lessons · 12 videos
03

The KV Cache

Design and measure the single most important inference optimisation. From why caching exists through the arithmetic, the memory wall, attention variants built to shrink it, fragmentation and paged allocation, prefix caching and radix trees, to hit rate as the production metric that drives both cost and latency.

11 lessons · 10 videos
04

The Batch

Turn a model server into a scheduler. One request at a time wastes the machine; this module covers continuous batching, chunked prefill and prefill/decode disaggregation, then the latency numbers that say whether any of it worked.

12 lessons · 12 videos
05

Fewer Bytes, Fewer Steps

There are only two levers on decode: move fewer bytes per step, or take fewer steps per token. Quantisation, FlashAttention and speculative decoding are all one or the other, and each has a regime where it makes things worse.

12 lessons · 12 videos
06

The Fleet

One GPU becomes many, and many users become one bill. Sharding a model across devices, serving mixture-of-experts, routing requests so the cache still hits, and arriving at a defensible cost per million tokens.

12 lessons · 12 videos
07

Serving Agents

An agent is not a chatbot. It is hundreds of turns against one enormous shared prefix, with a tool call stalling the loop in the middle of every one. That workload breaks the batching and cache assumptions modules 3 and 4 were built on, and turns the KV cache from a buffer into a storage tier.

12 lessons · 12 videos
08

Thinking Costs Tokens

A model that thinks before it answers moves the compute from training to serving, makes output length unpredictable, and drags reproducibility and the reinforcement-learning loop in behind it. Every number in modules 2 and 4 has to be recomputed for a request that emits thirty thousand tokens nobody reads.

12 lessons · 12 videos

Curated from 15 channels

Every video is a public YouTube video. We pick the single clearest explanation for each lesson and credit the channel that made it.

  • Stanford Online20
  • GPU MODE17
  • PyTorch16
  • Neural Magic8
  • Anyscale6
  • NVIDIA Developer6
  • Andrej Karpathy4
  • USENIX4
  • 3Blue1Brown3
  • Hugging Face3
  • Modal2
  • AI Engineer1