High-throughput LLM inference & serving · PagedAttention · OpenAI-compatible · verified against vLLM 0.28.x (2026)

vLLM cheat sheet

vLLM is a fast, memory-efficient engine for LLM inference and serving. Its PagedAttention + continuous batching pack many requests through the GPU at high throughput. Two modes: offline — the LLM class for batched local generation — and onlinevllm serve spins up an OpenAI-compatible HTTP server you hit with the plain openai client. Tensor/pipeline parallelism, quantization, and structured decoding are built in. Targets vLLM 0.28.x, Python 3.10–3.14, Linux + NVIDIA/AMD/Intel GPUs (also CPU/TPU/Gaudi).

offline inference chat / multimodal / embed online serving scaling & tuning deploy & ecosystem gotcha most common

Verified 2026-08-31 against the official docs at docs.vllm.ai (vLLM 0.28.0, released 2026-08-26). vLLM primarily targets Linux with a GPU; the same OpenAI-compatible API serves any supported model by swapping the --model.

Outline

Prototype offline with the LLM class, then serve the same model with vllm serve and call it through the OpenAI client. Scaling & tuning knobs apply to both.

Offline inference

  1. 1Install — pip / GPU
  2. 2Offline generate()
  3. 3SamplingParams

Chat / multimodal / embed

  1. 4Chat & multimodal
  2. 5Embeddings & pooling

Online serving

  1. 6vllm serve (OpenAI server)
  2. 7Query the server

Scaling & tuning

  1. 8Parallelism & scaling
  2. 9Quantization & memory
  3. 10Structured output

Deploy & ecosystem

  1. 11Performance & engine args
  2. 12Deploy & ecosystem

Offline Inference

The LLM class runs a model in-process for high-throughput batched generation.

1Installpip / GPU
2Offline generate()batched local
3SamplingParamsdecoding knobs

Chat, Multimodal & Embeddings

Apply chat templates automatically, feed images/audio, and pool embeddings.

4Chat & multimodaltemplated
5Embeddings & poolingencoder tasks

Online Serving

One command starts an OpenAI-compatible server; call it with any OpenAI SDK.

6vllm serve (OpenAI server)the gateway
7Query the serveropenai client

Scaling & Tuning

Spread big models across GPUs, shrink them with quantization, and constrain the output.

8Parallelism & scalingmulti-GPU
9Quantization & memoryfit more
10Structured outputguided decoding

Deploy & Ecosystem

Tune the engine, containerize, and plug vLLM into the wider stack.

11Performance & engine argsgo faster
12Deploy & ecosystemship it

Worth memorizing

two modesLLM() offline · vllm serve online
LLM(model=)load once; generate([prompts], sp)
SamplingParamstemperature / top_p / max_tokens / stop
llm.chat()applies the chat template (vs generate)
vllm serve MODELOpenAI server on :8000
OpenAI clientbase_url .../v1, api_key="EMPTY"
--tensor-parallel-size= #GPUs when model won't fit
--gpu-memory-utilizationVRAM fraction (default 0.9)
--quantizationawq / gptq / fp8 to shrink
guided_decodingjson / regex / grammar / choice
--enable-prefix-cachingreuse shared prompt prefixes
OOM fixlower util / max-model-len, add TP, quantize