Learn everything you need to design, deploy, optimize, and operate LLM inference systems.

This handbook is the conceptual half of the AI Tools documentation. It explains how LLM inference works, which decisions matter when you deploy it, and which techniques are worth applying — independently of any particular product. For the practical guide to the tool this team runs, see the LLM Inference module User Guide.

Status of this handbook

The handbook structure is complete and every page carries its scope, learning objectives and planned outline. Most pages are still marked draft: they describe what will be covered rather than containing finished technical content. Draft pages are labelled in the sidebar and on the page itself.

How the handbook is organised

The sections are ordered as a path from concepts to operations. Reading them in order works, but each section is self-contained enough to enter directly.

Foundations

What inference is, how a model produces tokens, where inference runs, and the metrics that describe it.

Model preparation

Fine-tuning, quantization and distillation — what each changes before a model is served.

Model interaction

API surfaces, function calling, structured outputs, MCP, prompting and request parameters.

Kernel optimization

GPU architecture, kernel tooling and FlashAttention, for when the layers above are exhausted.

Who this is for

The handbook assumes you build or operate software, and does not assume you train models.

Where to start

If you are new to serving LLMs, begin with the Introduction, then What is LLM inference? — it establishes the prefill and decode vocabulary that the rest of the handbook relies on.

About this handbook

Why this handbook exists, who it is for, and how to read it.

  • Introduction Start here: what this handbook covers, who it is written for, and how it relates to the llm-inference service.

Foundations

The core vocabulary and mental models behind LLM inference.

  • What is LLM inference? Define LLM inference and distinguish the prefill and decode phases that shape every serving decision.
  • Training vs. inference Compare the two workloads and explain why infrastructure tuned for training rarely suits serving.
  • How does an LLM work? A serving-oriented tour of transformer inference: attention, layers and the autoregressive loop.
  • Where is LLM inference run? Survey the deployment targets for inference — cloud, on-premises, hybrid and edge — and their trade-offs.
  • Key metrics for LLM inference Define TTFT, TPOT, end-to-end latency, throughput and goodput, and explain what each one hides.

Planning your deployment

Sizing decisions to make before deploying: model, accelerators, memory and framework.

Model preparation

Techniques applied to a model before it is served: fine-tuning, quantization and distillation.

  • LLM fine-tuning Understand when fine-tuning is the right tool, and what it means for serving.
  • LLM quantization Reduce numeric precision to cut memory and increase throughput, and understand the accuracy cost.
  • LLM distillation Train a smaller model to reproduce a larger one's behaviour on a target task.

Model interaction

The API surface and prompting techniques used to drive a served model.

  • OpenAI-compatible API Understand the de facto standard inference API and what compatibility does and does not guarantee.
  • Anthropic-compatible API Understand the Anthropic Messages API shape and how it differs from the OpenAI-compatible surface.
  • Function calling Let a model request the execution of tools you define, and handle those requests safely.
  • Structured outputs Constrain model output to a schema so downstream systems can consume it reliably.
  • Model Context Protocol Understand MCP as a standard interface between models and external tools and data sources.
  • Prompt engineering Techniques for constructing prompts that produce reliable output, and how to evaluate them.
  • LLM inference parameters Understand the sampling and decoding parameters exposed at request time and their effects.

Inference optimization

Techniques that increase throughput and reduce latency for a given model and hardware.

Kernel optimization

Optimizing the GPU kernels that inference workloads spend their time in.

Infrastructure and operations

Running inference as a reliable, observable and scalable service.