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 6 of 10
Quantization tradeoffs
- Focus
- The first tuning knob, and the first week your harness earns its keep.
- Medium
- Video-first. The lectures are the entry point, the papers are the deep dive.
- Deliverable
- FP8 and INT4/AWQ variants benchmarked against the FP16 baseline on both throughput and a quality proxy.
- MIT 6.5940 Lecture 5: Quantization Part I (Song Han), first half. Course page.
- Finish Lecture 5, start Lecture 6 for AWQ, GPTQ, and SmoothQuant depth. SmoothQuant and AWQ came out of this lab.
- Quantization section of Lilian Weng's survey. Write down which method each engine you run actually implements.
- Serve an AWQ or GPTQ checkpoint and an FP8 variant. Capture throughput and memory under the same sweep as week 5. vLLM quantization docs.
- Run a fixed eval set or perplexity proxy across FP16, FP8, and INT4. This table is the deliverable, not the speedup number.
- QLoRA talk (Tim Dettmers, author of LLM.int8() and QLoRA), then LLM Compressor office hours.
Read first: short explainers for this week
- How GGUF works.
What it covers (10)
- What is a model and what are weights
- What is local inference
- The problem before GGUF
- What is GGUF
- What is stored inside a GGUF file
- What is quantization
- Understanding quantization names like Q4_K_M
- How GGUF loads fast with memory mapping
- Why GGUF is cross-platform and extensible
- GGUF in the real world
- The Mixture of Experts (MoE) architecture - understanding what experts are, how the router picks them, why MoE makes large models faster and cheaper, and why it powers many of today's most powerful Large Language Models (LLMs).
What it covers (8)
- Why Mixture of Experts was needed
- What an "expert" really means
- The router and how it picks experts
- Where MoE sits inside a Transformer
- Sparse activation and why it saves compute
- Load balancing across experts
- Advantages and challenges of MoE
- Why MoE powers many modern LLMs
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.