Tutorial 09
Beginner

LLM Infrastructure

Design, build, optimize, and operate production-grade systems that serve LLMs — GPUs, the transformer, model serving, quantization, inference optimization, vLLM, and multi-GPU scaling.

LLM Infrastructure: From Zero to Mastery

A complete, hands-on tutorial that takes you from knowing almost nothing about AI to being able to design, build, optimize, and operate production-grade systems that serve Large Language Models (LLMs).

This is not a “copy these commands” cheat sheet. It explains why every piece works the way it does, in plain language, so that you can reason about new situations on your own — which is what actually separates an industry expert from someone who memorized a tool.


Who this is for

You should read this if any of these describe you:

  • You are new to AI but you are technical-curious and willing to learn.
  • You can run a terminal command and edit a text file, but you do not need to be a programmer yet.
  • You want to operate, optimize, or deploy LLMs — not necessarily train them from scratch.
  • You want to genuinely understand GPUs, serving, quantization, and inference optimization, including the tool vLLM, rather than treat them as magic.

No prior machine-learning background is assumed. Every term is defined the first time it appears, and there is a full glossary you can keep open in another tab.


What you will be able to do by the end

By the time you finish the final module you will be able to:

  • Explain how an LLM turns text into an answer, token by token, and where the time and money go.
  • Read a GPU spec sheet and predict whether a given model will fit and how fast it will run.
  • Choose the right quantization scheme (and explain the quality/speed/memory trade-offs) for a deployment.
  • Stand up a high-throughput inference server with vLLM, tune it, and benchmark it properly.
  • Use continuous batching, PagedAttention, speculative decoding, prefix caching, and other optimization techniques — and know when each one helps and when it does not.
  • Scale a model across multiple GPUs and multiple machines using tensor, pipeline, and data parallelism.
  • Deploy to production with autoscaling, monitoring, and cost controls, and debug the things that go wrong.
  • Do realistic capacity planning and cost estimation for a serving workload.

The mental model: what “LLM Infrastructure” actually means

When people say LLM Infrastructure, they mean everything that sits between a trained model file and a happy user getting an answer. Training the model is a separate discipline. This tutorial is about inference — running an already-trained model to produce outputs — and doing it fast, cheaply, and reliably at scale.

A useful picture:

                    USER REQUEST


   ┌─────────────────────────────────────────────┐
   │              SERVING LAYER                    │
   │   (API, queueing, batching, scheduling)       │
   │                   vLLM                         │
   └─────────────────────────────────────────────┘


   ┌─────────────────────────────────────────────┐
   │            THE MODEL (weights)                │
   │   optionally QUANTIZED to save memory         │
   └─────────────────────────────────────────────┘


   ┌─────────────────────────────────────────────┐
   │              HARDWARE (GPUs)                  │
   │     memory, compute, interconnect             │
   └─────────────────────────────────────────────┘

This tutorial walks up and down this stack. We start at the bottom (hardware), because you cannot reason about the layers above without understanding what the GPU is doing. Then we climb up to serving, optimization, and production operations.


How the tutorial is organized

The content lives in the modules/ folder. Each module is a standalone Markdown file. They are designed to be read in order the first time, because later modules assume the vocabulary and intuition built earlier. After that, each works as a reference you can jump back to.

#ModuleWhat it coversWhy it matters
00Introduction to LLMs & InferenceWhat an LLM is, tokens, what “inference” means, the request lifecycleThe foundation everything else builds on
01GPU Fundamentals for AIWhat a GPU is, memory vs compute, VRAM, bandwidth, CUDA, reading a spec sheetYou cannot serve models without understanding the hardware
02Inside the TransformerAttention, the KV cache, prefill vs decode, why decoding is memory-boundThe single most important module for optimization intuition
03Model Serving FundamentalsLatency vs throughput, the key metrics (TTFT, TPOT), batching basics, SLOsThe language and goals of serving
04QuantizationNumber formats, FP16/INT8/INT4, GPTQ, AWQ, GGUF, FP8, KV-cache quantizationHow to fit big models on small hardware
05Inference Optimization TechniquesContinuous batching, PagedAttention, speculative decoding, prefix caching, FlashAttention, chunked prefillThe toolbox that makes serving fast
06vLLM Deep DiveArchitecture, installation, offline & online use, the OpenAI-compatible server, key config flagsThe flagship serving engine, end to end
07Distributed & Multi-GPU ServingTensor / pipeline / data / expert parallelism, interconnects, when to shardServing models too big for one GPU
08Production Deployment & OperationsContainers, Kubernetes, autoscaling, observability, reliability, securityTurning a server into a service
09Benchmarking, Cost & Capacity PlanningHow to benchmark honestly, cost-per-token math, capacity sizingMaking and defending engineering decisions
10Mastery: Putting It All TogetherA full worked design, a decision framework, an expert checklist, where to go nextSynthesizing everything into expertise

There is also a glossary covering every acronym and term used anywhere in the tutorial.


How to study this (suggested approach)

  1. Read actively. Each module has “Check your understanding” questions. Answer them in your head (or out loud) before moving on. If you cannot, re-read that section — it is cheaper to fix a gap now than three modules later.
  2. Build a sandbox if you can. You learn infrastructure by touching it. If you have access to a GPU (your own, a cloud instance, or a free/cheap notebook service), try the vLLM commands in Module 06. If you do not have a GPU yet, you can still read everything and understand it fully; the hands-on parts will make sense when you get hardware.
  3. Keep the glossary open. The field is acronym-heavy. There is no shame in looking up “TTFT” for the tenth time.
  4. Do not skip Module 02. It feels theoretical, but nearly every optimization trick in Modules 04–07 is just a clever response to something explained in Module 02. If you understand the KV cache and the difference between prefill and decode, the rest clicks into place.

A note on tone and depth

The language is kept deliberately simple — short sentences, everyday analogies, no assumed jargon. But simple language does not mean shallow content. Nothing important is skipped or hand-waved. Where a concept is genuinely hard (and a few are), we slow down and build it from the ground up rather than gloss over it. The goal is that a motivated beginner finishes this able to hold their own in a room of infrastructure engineers.

Let’s begin. Open Module 00.