Ship one LLM serving stack in 10 weeks
A 10-week, 30-minutes-a-day roadmap for engineers who want to actually run LLM inference in production, not just read about it. Every session feeds a single OpenAI-compatible service that you deploy on a rented GPU, instrument, load test, tune and publish as a benchmark.
Week 8 of 10
Disaggregated serving and Kubernetes
- Focus
- The prefill and decode asymmetry from week 1 becomes an architecture, then the operations layer that runs it.
- Medium
- Video-first for disaggregation. Text-first for Kubernetes, which changes too fast for video to stay current.
- Deliverable
- Your service on Kubernetes with autoscaling driven by queue depth rather than CPU.
- DistServe at OSDI 2024 (Yinmin Zhong, presenting author). Reports serving 7.4x more requests or holding 12.6x tighter SLOs. Paper.
- Splitwise (Microsoft, ISCA 2024): H100-for-prefill and power-capped-A100-for-decode gave 1.4x throughput at 20% lower cost. Then vLLM disaggregated prefilling.
- Mooncake (FAST 2025 best paper), KV-cache-centric, in production at Kimi. Then SGLang PD disaggregation. Compare how each engine splits the phases.
- Deploy with the vLLM production stack Helm charts, on a managed cluster or
kind. - Scale on the
num_requests_waitingcustom metric, not CPU. CPU-based autoscaling on a GPU service is the mistake this session prevents.
Read first: short explainers for this week
- Prefill-Decode Disaggregation, a way of running a large language model where the reading of the prompt and the writing of the answer happen on separate machines.
What it covers (13)
- How an LLM answers a request
- What is the KV Cache?
- Prefill is compute-heavy, Decode is memory-heavy
- The problem when both run on the same GPU
- TTFT vs TPOT
- The naive approaches and their issues
- What is Prefill-Decode Disaggregation?
- How Prefill-Decode Disaggregation works
- Walkthrough of one request
- Advantages of Prefill-Decode Disaggregation
- Disadvantages of Prefill-Decode Disaggregation
- Where it works well and where it is overkill
- Co-located vs Disaggregated serving
Interview questions this week prepares you for
Before you publish a benchmark
The mistakes that get public inference benchmarks taken apart. Read them in week 5, apply them in week 10.
- Sweep the request rate. A single concurrency level is an anecdote.
- Report exact input and output token lengths. KV cache size and therefore throughput depend entirely on them.
- Report p50, p95, and p99. Means hide the tail that users feel.
- Keep TTFT and inter-token latency separate. Collapsing prefill and decode into one number destroys the finding.
- Do not measure at the saturation point where the server is preempting. Report the knee, not the collapse.
- Avoid synthetic uniform-length traffic. Uniform lengths hide the heavy tail that makes continuous batching matter.
- Account for tokenizer differences between engines before comparing tokens per second.
- Pin engine versions and publish exact commands, so a critic can reproduce rather than speculate.
Who it is for, why the order matters, and setup
Who this is for
You should be comfortable with Python, transformers at the architecture level, and the command line. You do not need prior serving, Kubernetes, or CUDA experience.
If you already know a topic, the sessions marked skim are the ones to compress. Do not compress the build sessions, they are the point.
What you will have at the end
- A serving stack you configured, instrumented, and tuned yourself
- Grafana dashboards showing TTFT, inter-token latency, throughput, queue depth, and cost per request
- A load test harness that reproducibly drives 1000+ concurrent requests
- Benchmarked variants across FP16, FP8, INT4, speculative decoding, and KV eviction
- A cost/latency/quality router with per-request token budgeting
- A published benchmark writeup with pinned versions and reproducible commands
Time commitment
| Session length | 30 minutes |
| Sessions per week | 5, plus 2 buffer days |
| Total | 10 weeks, 50 sessions, 25 hours |
| GPU cost | Roughly one 24GB card rented by the half hour, plus two H100 sessions |
Buffer days exist so that missing a Tuesday does not collapse the plan. They are for catching up, not for new material.
How the roadmap is ordered
The order here is deliberate and differs from how most people write this list down. Five decisions drive it.
The roofline model comes first. Every optimization later is a move on the same plot. Quantization attacks memory-bandwidth-bound decode. Continuous batching raises arithmetic intensity toward the compute roof. Speculative decoding spends FLOPs, which are cheap in the memory-bound regime, to cut sequential memory loads. Disaggregation exists because prefill is compute-bound and decode is bandwidth-bound and they fight over one GPU. Without this model, the rest is a bag of tricks.
Measurement comes before optimization. Instrumentation lands in week 3 and load testing in week 5, well before the tuning knobs. Nothing after them is verifiable without them, and a public benchmark is mostly a credible measurement harness with a model attached.
Paged attention and continuous batching are not build exercises. vLLM implements both, and chunked prefill is the default scheduling strategy in vLLM and SGLang. Reimplementing them teaches less than reading the block manager and the scheduler until you can explain from the code why memory waste drops under 4 percent and why the GPU stops idling between requests.
The router sits next to unit economics. A router that picks a backend by cost, latency, and quality is the one component that forces a dollar figure and a latency budget into code. Studying economics the same week turns the reading into a routing policy instead of a blog post you agreed with.
Edge deployment is optional and last. ONNX Runtime, TensorRT-LLM, and WebLLM are client-side and embedded runtimes. They share almost no operational surface with the datacenter stack the other nine weeks build.
Setup
GPU access
A 7-8B model needs roughly one 24GB GPU. Rent by the half hour and shut the instance down between sessions.
| Provider | Good for |
|---|---|
| RunPod | Per-second billing, quick pods |
| Modal | Serverless, best for benchmark sweep scripts |
| Lambda / vast.ai | Cheap on-demand and marketplace GPUs |
| Colab | Pure-Python sessions, no serving |
All of week 1, most of week 3, the week 6 lecture days, and all of week 9 reading need no GPU at all. Batch your rentals around the build days. One H100 is needed for exactly two sessions: the 1000-concurrent test in week 5, and disaggregation in week 8 if you run it for real.
Tools you will install
pip install vllm
pip install guidellm
pip install sglang
Plus Docker for the Prometheus and Grafana stack, and kind or a small managed cluster for week 8.
Decision points, papers, courses and tools
Decision points
Moments where following the schedule blindly is the wrong move.
| If | Then |
|---|---|
Week 5. TTFT spikes and num_requests_waiting climbs before target concurrency. |
The server is preempting. Stop and tune --max-num-seqs, --gpu-memory-utilization, and chunked prefill first. A run measured at the preemption point is not publishable. |
| Week 6. INT4 costs more than 1-2% on your quality proxy for the throughput it returns. | Keep FP16 or FP8 as the default. Treat INT4 as a memory-pressure lever, not a throughput default. |
| Week 7. Speculative decoding slows you down at your real request rate. | Expected. Gains appear at low query rate and vanish when the GPU is compute-saturated. Publish the crossover point, it is more useful than the speedup. |
| Week 8. Kubernetes starts eating whole sessions on cluster plumbing. | Use a managed cluster, or fall back to single-node Docker plus the KEDA reading. The autoscaling signal matters more than a bespoke cluster. |
Reference
Papers
| Paper | Venue | Topic |
|---|---|---|
| PagedAttention / vLLM | SOSP 2023 | KV cache paging |
| Orca | OSDI 2022 | Continuous batching |
| SGLang | NeurIPS 2024 | RadixAttention, prefix reuse |
| SARATHI / Sarathi-Serve | OSDI 2024 | Chunked prefill |
| DistServe | OSDI 2024 | Prefill/decode disaggregation |
| Splitwise | ISCA 2024 | Phase splitting across GPU types |
| Mooncake | FAST 2025 | KV-cache-centric serving |
| StreamingLLM | ICLR 2024 | Attention sinks, long context |
| EAGLE | arXiv | Speculative sampling |
For GPTQ, AWQ, SmoothQuant, LLM.int8(), Medusa, H2O, SnapKV, and the FlashAttention family, use Lilian Weng's survey and the NVIDIA optimization survey, which cite them directly. Search exact titles rather than guessing arXiv IDs.
Courses and series
- Stanford CS336: Language Modeling from Scratch, taught by Percy Liang and Tatsunori Hashimoto. Lectures 5 (GPUs), 6 (Kernels), 7-8 (Parallelism), 10 (Inference).
- MIT 6.5940 EfficientML.ai, taught by Song Han. Fall 2023 and Fall 2024 recordings both work.
- vLLM Office Hours, bi-weekly, from the engine team.
- GPU MODE, kernel and systems-level lectures.
- USENIX, OSDI, NSDI, and ATC talks by paper authors.
Tools
| Tool | Use |
|---|---|
| vLLM | Primary serving engine |
| SGLang | Prefix-reuse comparison |
| GuideLLM | SLO-aware rate sweeps |
| genai-perf | TTFT and ITL measurement |
| LLMPerf | Hosted endpoint benchmarking |
| production-stack | Kubernetes deployment |
Reading habit
One 30-minute session a week: scan titles on arXiv cs.DC and the systems conferences, read exactly one paper's abstract, method figure, and evaluation, and track the applied writeups on the vLLM and LMSYS blogs and the Modal Almanac. Read the systems paper, skip the model-release press.
Notes on the sources
Every video here has a named speaker from a university, an engine team, or a conference, and is paired with a text covering the same material, so you can read instead of watch. Where no video met that bar, the week is text-only rather than padded.
A few things to keep in mind:
- Timestamps are targets. Talks get re-uploaded and re-cut, so use the on-video chapter markers to place split points.
- MIT 6.5940 was not offered in Fall 2025. Fall 2023 and Fall 2024 recordings both exist and either works.
- vLLM serves its blog at two URL shapes and its docs change with versions. If a link 404s, search the exact title rather than editing the path.
- Performance figures quoted here are the sources' own claims from their papers and blogs, not independently reproduced. Treat them as the number that source is willing to defend, not as ground truth for your hardware.
- Cost per million tokens and GPU hourly rates move fast. The economics reading is valuable for its method. Re-derive every number against your own hardware.
Roadmap from time-to-first-token by patchy631, adapted for this site. See Credits for its license.