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 10 of 10
Publish, then build the reading habit
- Focus
- Ship the artifact and set up the inputs that keep it current.
- Medium
- Deliverable
- A published repo and writeup with pinned versions and reproducible commands, plus a weekly research session on the calendar.
- Draft the writeup: hardware, model, exact token lengths, concurrency sweep, p50/p95/p99 for TTFT and ITL, throughput. Run the checklist below against it first.
- Add quantization, speculative decoding, and KV eviction as labeled variants with reproducible commands and pinned versions. Publish.
- Set up the weekly habit. arXiv cs.DC, MLSys, OSDI, NeurIPS efficiency tracks. Queue three items.
- First habit session. One paper's abstract, method figure, and evaluation in 30 minutes. Not the whole paper.
- Edge sampler: ONNX Runtime, TensorRT-LLM, WebLLM. Note these are client-side runtimes, not an extension of what you built.
- Circulate the benchmark for feedback. Criticism you can answer is proof the harness is real.
Read first: short explainers for this week
- How TensorRT-LLM works, NVIDIA's own engine that squeezes the highest possible speed out of an NVIDIA GPU when it runs a large language model.
What it covers (19)
- What is inference
- What is a GPU and what is a kernel
- The problem: the GPU spends its time on the wrong things
- What is TensorRT-LLM
- The big idea: prepare the model ahead of time
- The build step: from a model to an engine
- Kernel fusion
- Quantization
- Custom attention kernels
- The paged KV cache
- In-flight batching
- CUDA graphs
- Speculative decoding
- Running one model across many GPUs
- How we actually serve the model
- The PyTorch backend, the newer and easier path
- The full journey of one request
- TensorRT-LLM vs vLLM
- Where it works well and where it fails
- How Ollama works.
What it covers (11)
- What does running an LLM locally mean
- What is Ollama
- The big problem: models are huge
- Quantization and the GGUF file format
- The architecture: client and server
- What happens when we run a model
- How models are downloaded and stored
- How the model runs on CPU and GPU
- What is a Modelfile
- Using Ollama from code through its API
- Where it works well and where it fails
- How a Google TPU works.
What it covers (10)
- What is a TPU
- Why Google built the TPU
- A quick refresher: CPU and GPU
- The one operation that matters most
- The big idea: Systolic Array
- How data flows through a TPU
- The full journey of a TPU computation
- Why a TPU is so fast and power efficient
- Where TPUs are used
- Limitations of a TPU
- How an LPU works, the chip that was built for one single job, running a large language model and printing words on our screen as fast as possible.
What it covers (15)
- What is an LPU?
- How an LLM writes text, one token at a time
- The real bottleneck is memory, not math
- Why a GPU struggles here
- Idea 1: Keep the model on the chip
- The problem with on-chip memory
- Idea 2: Remove all the guesswork
- Idea 3: A network that never waits
- The assembly line
- What happens when we send a prompt
- Why an LPU is fast, all in one place
- Where an LPU works well
- Where an LPU does not work well
- LPU vs GPU
- When to use which one
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.