vLLM is one loop in its own process: every step it calls schedule(), runs the model once, and calls update_from_output(). The scheduler gives each request a share of a per-step token budget and the blocks to hold it from a pool of fixed-size KV blocks; almost every production knob changes the budget, the pool, or how fast the model step runs.
Fig. 1, step by step: one loop between the API server and the GPU, and where each knob acts
Customer C of the recorded run in section 3 (prefix caching on), through vLLM's processes. The token counts and block numbers are what the real engine held; the layout is schematic. source: vLLM v0.31.0; measured here: the recording.
You need: continuous batching, paged attention and prefix caching as ideas, with their papers: Batching, KV cache and scheduling in depth owns them, and this page shows only how vLLM's code implements them. How many bytes one token's cache takes for a given model: Long context (KV-cache calculator). Prefill, decode, TTFT and ITL: the root, Topic: inference-and-serving.
Everything is read at the release tagged v0.31.0 (2026-10-05, commit db9527a4), with file and line linked. The running example is the parent page's chat assistant shrunk to a laptop: Qwen3-0.6B answering customers of a bicycle shop, every request starting with the same system prompt. Numbers are labelled measured here (vLLM's own CPU image, whose scheduling and caching code is byte-identical to the tag, so the decisions are a GPU server's and only the speed is not) or source (the code, release notes and docs, dated).
measured here: vLLM's own CPU image vllm/vllm-openai-cpu:v0.31.0-arm64 in Docker on an Apple M1 Pro (5 CPUs and 9.7 GiB for Docker's virtual machine, 4 CPUs for the stepper's recordings; float32 weights). Its Python files for the scheduler, the KV cache manager, the block pool, the engine core, the async front end and the metrics are byte-identical to the v0.31.0 tag (eight files, MD5 compared, src/inputs/image_vs_tag_md5.txt), so the scheduling and caching decisions are exactly what a GPU server makes; only the speed is not.
Not run here: CUDA graphs, torch.compile on GPU, tensor parallelism, FlashAttention kernels, and Model Runner V2 itself (the CPU backend still uses the V1 model runner, section 4). Each is described from source and docs, and labelled.
Running the CPU image yourself: four traps the sibling pages hit. In Docker it needs --shm-size (it wants about 160 MiB of shared memory, more than Docker's 64 MiB default) and a --gpu-memory-utilization below the memory actually free, because by default it reserves 0.92 of the virtual machine's RAM (LLM serving in production, which ran it for start-up and multi-LoRA tests). Tensor or pipeline parallelism above 1 needs VLLM_CPU_OMP_THREADS_BIND set by hand, since the automatic binding asserts one NUMA node per worker and refuses two workers on a one-node machine; and VLLM_ENABLE_V1_MULTIPROCESSING=0 (engine in the calling process) is not supported by the CPU backend's OpenMP thread setup (vllm/platforms/cpu.py L317 to L324 at v0.31.0). Distributed and disaggregated serving (section 4, closed block "Measured here") ran TP 2 and PP 2 on this image.
It began as the PagedAttention paper's engine in the Sky Computing Lab at UC Berkeley (README), became a PyTorch Foundation hosted project on 2025-05-07 (PyTorch Foundation), and is also the generation engine inside RL post-training stacks: TRL's GRPO and online DPO trainers generate with vLLM 0.21.0 to 0.31.0 (TRL docs), and verl lists vLLM, SGLang and Transformers for rollouts (verl README). The V1 rewrite that gave it the process split of section 1 was announced on 2025-01-27 (V1 announcement).
source: vLLM v0.31.0, every line number linked in the caption. The token chip shows what travels at each step: text, token ids, a scheduler decision, a sampled token id, text again.
The problem. A GPU must never wait for Python. Tokenizing, detokenizing, parsing JSON and writing HTTP are CPU work; if the loop that feeds the GPU did them, the GPU would idle between steps. So since the V1 rewrite the work is split across processes: one API server (FastAPI, chat template, tokenizer, detokenizer, stop strings, streaming; --api-server-count adds more), one engine core per data-parallel rank (the busy loop, with two I/O threads and two Python queues so socket work never blocks it), and the GPU worker, which lives inside the engine core with one GPU (executor "uni", parallel.py L1033) and is one process per GPU with tensor parallelism. ZeroMQ sockets carry msgpack-encoded requests one way and outputs the other.
The animation, step by step: one streamed request, function by function
Three consequences, each a classic production surprise:
illustrative durations (CPU work 3 ms, GPU work 10 ms per step) to show the mechanism; the mechanism itself is the source's: with async scheduling the engine core keeps a batch queue of 2 (vllm.py L592) and step_with_batch_queue schedules step N+1 before step N's result is back (core.py L670). The CPU platform turns it off (cpu.py L314), so the recorded runs in section 3 are synchronous.
Async scheduling. The CPU work of a step (scheduling, then applying the sampled tokens) can run while the GPU computes the previous step, as long as the scheduler does not need that step's tokens first.
The animation, step by step
What async scheduling costs. Step N+1 is decided before step N's token is known, so a request that will finish at step N is scheduled once more; the running loop skips a request whose in-flight tokens already reach max_tokens (scheduler.py L635), and outputs that arrive for a request preempted in between are marked stale (scheduler.py L1563). It matters for small models and small batches, where a GPU step is a few milliseconds and the CPU work is the same order; a profile with gaps between GPU kernels at batch 1 means the CPU is the bottleneck.
The problem. Every step, choose which requests run and how many of their tokens, without running out of KV blocks and without letting one long prompt freeze everyone else's stream. vLLM's answer is one function, Scheduler.schedule() (scheduler.py L562), whose first comment states the design:
So a request is two numbers: how many of its tokens exist (prompt plus output so far, plus draft tokens when speculating) and how many already have their keys and values in the cache. A new request has 2,000 tokens and 0 computed: it needs 2,000. A decoding request has 2,301 tokens and 2,300 computed: it needs 1. A prefix-cache hit simply starts a request with some tokens already computed. The scheduler hands out a per-step token budget (max_num_batched_tokens, section 5) to close those gaps.
Fig. 2, step by step: one call of schedule() and the model step after it, in the order the code runs
Step 4 of the recorded run with prefix caching off (section 3): the real engine's token counts and block numbers, a 64-token budget, 32-token blocks, 29 usable blocks. measured here
Preemption. Under FCFS the victim is self.running[-1], the most recently admitted request (L771); under the priority policy, the lowest priority, latest arrival (stepped through against this same code on the Batching, KV cache and scheduling page, section 6). Its blocks are freed, its computed count reset to 0, and it goes to the front of the waiting queue (L1538 to L1580). There is no swap to CPU memory in this engine: preemption is recompute. (CPU offload exists, but as a KV connector tier, not as the preemption path.)
Two admission rules that surprise people. First, a waiting request is admitted only when its whole prompt fits in free blocks, not just the first chunk: scheduler_reserve_full_isl defaults to True (config/scheduler.py L191) and is passed as full_sequence_must_fit (L1218; checked in kv_cache_manager.py L519). The parent page's Serving simulator found this when its scheduler was checked against this very code: it had to change to match, and then agreed with vLLM on all 10 traces, 2,535 steps and 39 preemptions. Second, chunking is on by default (config/scheduler.py L135); with it off, a prompt longer than the remaining budget waits for a step with room (L1115).
From the release notes: requests that already hold KV blocks wait in their own queue and are tried first (L887); --max-num-active-seqs caps running requests separately from max_num_seqs; and long_prefill_token_threshold, off by default, no longer chunks a request that is alone (L611 to L626).
The problem. Every token of every running request keeps a key and a value in every layer: 229,376 bytes per token for Qwen3-0.6B in float32 (114,688 in 16-bit: 2 × 28 layers × 8 KV heads × 128 dims × bytes; sizing for any model is Long context's calculator). That memory must be handed out as requests grow, taken back when they finish, and, if another request starts with the same tokens, found again instead of recomputed. Why it is paged at all is Batching, KV cache and scheduling in depth and the PagedAttention paper page; vLLM does it with four small classes:
| Operation | What it does | Source |
|---|---|---|
| allocate | Pop blocks from the head of the free queue. If a popped block still carries a hash, it is a cached block being evicted: its hash is removed from the map first. This is the only place eviction happens. | block_pool.py L669 |
| cache | When a block fills up, during prefill or decode, give it its hash and enter it in the map. Only full blocks are ever cached. | L226 |
| free | A finished or preempted request returns its blocks tail first (kv_cache_manager.py L616). Each block's count drops; at zero, a block without a hash goes to the front (reused first), a block with a hash to the back (kept as long as possible). | block_pool.py L777 |
| touch | A cache hit: increment the count and, if the block was free (count 0), unlink it from the free queue so nobody can evict it while it is in use. | L755 |
Put together: the free queue is a list of blocks nobody is using, ordered so that partial and unhashed blocks go first, then cached blocks from least to most recently freed, and within one request from its last block to its first. Evicting from the head is therefore least recently used eviction, and a request's tail goes before its prefix, because a prefix is more likely to be shared. No timestamps, no heap: the order of the list is the policy.
Fig. 3, step by step: the free queue is the eviction policy, in vLLM's own unit test
The first five steps replay test_prefix_caching.py, test_evict, whose queues are asserted; the last two apply the four operations above to a new request (illustrative). Structure from block_pool.py and kv_cache_utils.py L246 at v0.31.0. White blocks have no hash; teal blocks are full, hashed and still findable by the prefix cache.
A block's hash is sha256(pickle((parent_hash, tuple(block_tokens), extra_keys))) (hash_block_tokens, L684; hashing.py L26), where the first block's parent is a fixed seed hash ("vllm-none-hash", L122). Because each hash includes its parent's, equal hashes at block k mean equal tokens in blocks 0 to k: one dictionary lookup per block finds the longest cached prefix, with no tree to walk. The extra keys carry what tokens alone do not say: LoRA adapter, image or audio content, prompt embeddings, and an optional per-request cache_salt on the first block, which isolates tenants because every later hash inherits it (L614).
SGLang keeps the same information as a radix tree matched token by token; the SGLang page's section 3 runs both on the same traces, and the Batching, KV cache and scheduling page's section 3 compares LRU with other eviction policies. The seed has been deterministic by default since v0.29.0, so hashes agree across processes and machines (needed by distributed KV caches), and v0.31.0 tagged the extra keys by source so a LoRA name and a salt can no longer collide (release notes).
measured here: the first 4 bytes of each block hash as vLLM v0.31.0 computed it while serving Qwen3-0.6B (the recording at the end of this section, prefix caching on). Each cell is one block with its text (32 tokens per block here: the CPU attention backend needs a multiple of 32, while GPUs default to 16); blue cells hold a hash both requests have, which is what get_computed_blocks reuses. The last partial block never has a hash.
Two details that change numbers. A full-prompt hit still recomputes the last block: the lookup is capped at num_tokens − 1 tokens because the model must produce logits for the last prompt token (kv_cache_manager.py L289 to L295), and the cap rounds down to a block boundary. And vllm:kv_cache_usage_perc is 1 − free blocks / usable blocks (block_pool.py L880): cached blocks that nobody is using count as free, so a server can show low usage while holding a large warm cache, and 100% means every block belongs to a running request.
vLLM v0.31.0's own scheduler and KV cache manager, recorded step by step while the real engine served Qwen3-0.6B: five customers of the bicycle-shop assistant sharing one system prompt, and one customer (A2) coming back with a follow-up. Every block, queue and number is what vLLM's objects held after that step. Predict first: with prefix caching on instead of off, how many fewer tokens will the engine compute for the same arrivals? Then pick a run and step; the stepper opens on the step that answers it, and never plays by itself.
Reading it. Prefix caching off against on, same arrivals: 686 against 398 tokens computed, because 288 prompt tokens came from the cache. Squeezing the pool (tight memory) forced 2 preemptions and evicted 6 cached blocks, and the engine computed 632 tokens: recompute is the price of preemption, and the warm cache softened it (448 tokens served from cache).
The problem. The scheduler's decision is a small dictionary ({request: tokens this step}, plus new block ids). The GPU needs dense tensors: one flat list of input token ids for all requests, their positions, where each request's tokens start, every request's block table, and per-request sampling settings. Building those in Python from scratch every step would cost more than the forward pass of a small model, so the model runner, one per GPU, keeps a persistent batch: tensors that stay allocated across steps and change only where a request joined or left.
Each step the runner (1) applies the scheduler's diff (new requests, finished ones, new blocks), (2) gathers the step's inputs and attention metadata, (3) runs the model, replaying a captured CUDA graph when the batch shape allows, (4) computes logits for the last position of each request, and (5) samples. Then the sampled ids go back to update_from_output.
The V1 runner's persistent batch used its state tensors directly as model inputs, so a request finishing in the middle forced rows to be reordered, and it kept a duplicate copy of each request's state; asynchronous scheduling was retrofitted onto it. Model Runner V2 (MRV2) was rewritten "from first principles" (design doc):
The mechanism is the design doc's: V1 "uses persistent state tensors directly as model and sampler inputs", so joins and finishes need "tensor-wide reordering" and a backup copy of request state (CachedRequestState); V2 gives each request "a permanent row for its active lifetime" and gathers the step's inputs on the GPU. V1's moves are its code's: a new request fills the first empty row (gpu_input_batch.py L326), then rows are swapped so decodes come before prefills (swap_states, L582; gpu_model_runner.py L1135). The four requests are illustrative; not run here.
The other four differences follow the same idea of keeping the CPU out of the step: async scheduling designed in rather than retrofitted, block-table diffs applied by one kernel, Triton kernels for input preparation and a Gumbel-max sampler, and explicit CUDA graph management.
| Model Runner V1 | Model Runner V2 | |
|---|---|---|
| Persistent state | State tensors are the inputs; rows reordered when requests join or leave | Each request owns a fixed row (up to max_num_reqs, 1,024 on most platforms) until it finishes or is preempted; inputs are gathered from those rows on the GPU each step |
| Async scheduling | Retrofitted, with an async barrier around CPU buffers | Designed in: no CPU synchronization in the step; CPU writes go to unpinned buffers copied through a temporary pinned one |
| Block tables | Copied from CPU | StagedWriteTensor: diffs staged on CPU, one kernel applies them |
| Input preparation and sampling | Python and PyTorch | Triton kernels for input ids, positions and sequence lengths; a Triton Gumbel-max sampler; top-k logprobs without a full-vocabulary softmax |
| CUDA graphs | Implicit, mixed into dummy_run | An explicit CUDAGraphManager; several draft-model steps captured in one graph |
Every row from the design document at v0.31.0, the authors' description; not run here.
Which runner you get. MRV2 has been the default for every model since v0.29.0 (2026-09-09, release notes), with V1 deprecated and its removal targeted for v0.32. Unsupported configurations fall back to V1 with one warning line, "Model Runner V2 does not yet support ...", and the CPU backend used on this page always runs V1: nothing here measures MRV2.
At v0.31.0 the choice is a property, use_v2_model_runner (vllm.py L701 to L761): VLLM_USE_V2_MODEL_RUNNER forces either way; otherwise V2, unless Triton is missing or the configuration uses something V2 does not support yet, listed in L3051 to L3103: stock torch.compile mode, sequence parallelism with TP > 1, pipeline parallelism under the external launcher, the speculative methods ngram, ngram_gpu, suffix, medusa, mlp_speculator (both removed from vLLM in v0.33.0) and custom_class, parallel drafting for EAGLE, dual-batch overlap's unsupported cases, elastic expert parallelism, and Mamba cache mode "all". Then vLLM logs "Model Runner V2 does not yet support ..." and falls back. On ROCm, a few architectures default to V1 for speed. The CPU backend used on this page runs CPUModelRunner, a subclass of the V1 GPU runner (cpu_model_runner.py L23): nothing here measures MRV2.
At batch 1 a decode step launches hundreds of small kernels, and the launch overhead can rival the work (the parent page's "third regime"). vLLM captures CUDA graphs for a fixed set of batch sizes and replays them. The default, FULL_AND_PIECEWISE, captures a full graph for pure decode batches and piecewise graphs (attention left outside) for prefill and mixed batches (compilation.py L606); the optimization levels -O0 to -O3 trade start-up time for this (-O2 is the default: torch.compile plus FULL_AND_PIECEWISE; -O0 no compilation and no graphs, optimization_levels.md). Capture costs start-up time and memory: v0.30.0 cut capture from 12 s to 2 s and engine start from 28.9 s to 8.2 s on an H200 by freezing the garbage collector during capture (release notes, the project's measurement). How graphs work and what breaks them: Streams, CUDA graphs and multi-GPU. What torch.compile and Inductor do to the model: Compiler stack. The attention kernels themselves (FlashAttention, split-KV decode): Writing kernels.
Dozens of flags exist; a handful decide how a deployment behaves, and each trades one thing for another. Defaults are read at v0.31.0; "how to check" names the metric of section 6; the first three are measured on a live server below the tables.
| Knob (default) | What it controls | Raise it and | How to check |
|---|---|---|---|
| max_num_batched_tokens (per hardware, below) | The per-step token budget: how many prompt tokens a step may prefill on top of the decodes. | Prompts finish prefill in fewer steps (better TTFT, more throughput from big matrix multiplies), but every step that carries a big chunk is long, so users already streaming see a stall (worse ITL tail). | ITL p99 against TTFT; measured below |
| max_num_seqs (1,024 / 256 / 128 per CPU worker) | The most requests in the running list. | More users share each step (throughput up) until the step lengthens or the cache runs out; each user's TPOT rises. | num_requests_running at the cap with a growing waiting queue; measured below |
| gpu_memory_utilization (0.92, cache.py L103) | Share of the whole GPU vLLM may use; the KV cache gets what is left after weights, activations and CUDA graphs. | A bigger cache (more concurrent users, fewer preemptions), less headroom for anything else on the GPU. It is a share of the whole GPU, not of the cache: two vLLM servers on one GPU need fractions that sum below 1. | The start-up line with the cache size in tokens; kv_cache_usage_perc, num_preemptions |
| enable_prefix_caching (on, L142) | Hashing and reusing full blocks across requests (section 3). | Off: saves the hashing on unique prompts; loses every shared-prefix hit. | prefix_cache_hits / prefix_cache_queries |
| enable_chunked_prefill (on, scheduler.py L135) | Whether a prompt may be split across steps. | Off: a long prompt waits for a step with room for all of it and then stalls everyone for that step. | ITL p99 |
| max_model_len (the model's) | The longest request accepted; at start-up the cache must hold at least one such request. | Lower it to start on a smaller GPU or to refuse giant prompts that would block admission. | The "maximum concurrency" start-up line |
| kv_cache_dtype (auto = model dtype) | Bytes per cached number; fp8 halves them against 16-bit. | Twice the tokens in the same memory; a small accuracy risk (the parent page's Engine bench measured 8-bit and 4-bit caches in llama.cpp). | Cache size in tokens; quality on your eval |
| enable_lora, max_loras (off; 1, lora.py L37) | Serving many LoRA adapters on one base model: max_loras is the most distinct adapters in one step; max_lora_rank (16, L35) the largest rank accepted; max_cpu_loras (defaults to max_loras, must not be smaller, L121) how many stay in CPU memory. | More adapters share a step. With the default of 1, a waiting request on a second adapter is skipped while another adapter is running (scheduler.py L911 to L922), so mixed-adapter traffic queues; each LoRA layer preallocates GPU buffers for max_loras adapters of max_lora_rank (lora/layers/base_linear.py L135 to L149), so once LoRA is enabled, raising either costs GPU memory before any adapter is loaded. | num_requests_waiting with KV and running low; per-adapter TTFT. Why multi-LoRA batching works and what it costs: LLM serving in production, section 4 |
| Knob (default) | What it controls | Raise it and | How to check |
|---|---|---|---|
| long_prefill_token_threshold (0, off) | A per-request cap on prefill tokens per step, so one long prompt cannot take the whole budget. | Fairer budget among several prefills; each long prompt takes more steps. | TTFT by prompt length |
| block_size (16 on GPU, L71; 128 on CPU) | Tokens per block: the unit of allocation and of prefix-cache matching. | Less metadata and fewer table entries; coarser sharing (a prefix is reused only in whole blocks) and more waste in each request's last block. | Hit rate against block size |
| performance_mode (balanced) | "throughput" doubles the default batch tokens and sequences (arg_utils.py L3064) and, per its docstring, uses larger CUDA graphs and throughput-oriented kernels (vllm.py L448); "interactivity" captures graphs for every batch size up to 32. | One switch for the throughput-or-latency trade when you have not tuned the two knobs above. | Both latency percentiles and throughput |
| -O level (-O2) | torch.compile and CUDA graph mode (section 4). | -O0 starts fastest and runs slowest; use it to iterate, never to benchmark. | Start-up time; batch-1 decode speed |
The per-hardware budget is chosen in get_batch_defaults (arg_utils.py L2829 to L2920) from the device's memory, and differs between the HTTP server and the offline LLM class, because an offline batch job wants throughput and a server wants smooth streams:
| Device | max_num_batched_tokens, server / offline | max_num_seqs, server / offline |
|---|---|---|
| GPU with at least 160 GiB (B200, B300, MI300X) | 16,384 / 16,384 | 1,024 / 1,024 |
| GPU with at least 70 GiB, not an A100 (H100, H200) | 8,192 / 16,384 | 1,024 / 1,024 |
| Other GPUs (A100, L40S, RTX 5090 and smaller) | 2,048 / 8,192 | 256 / 256 |
| CPU backend, per worker | 2,048 / 4,096 | 128 / 256 |
TPUs have their own smaller values in the same function. Set both knobs explicitly in production: a default that depends on which GPU the scheduler landed on is a benchmark you cannot reproduce.
vLLM's CPU image with Qwen3-0.6B in float32, one knob changed per sweep under the same load, two runs each (ticks: the runs; bar: their mean) measured here. Absolute speeds are a CPU's, about a hundred times below a datacenter GPU; the directions and the trade-offs are the scheduler's and transfer. Predict before each: which number gets worse when the knob goes up?
vLLM's API server exports Prometheus metrics at /metrics, defined in one class, PrometheusStatLogger (loggers.py L509 onward). Their values come from two places, and knowing which tells you how fresh they are: gauges and counters about the scheduler (running, waiting, KV usage, prefix-cache queries and hits) arrive with every step's outputs as a SchedulerStats object built in the engine core (scheduler.py L2859); per-request histograms (TTFT, ITL, queue time, prefill and decode time) are computed in the API server from timestamps the engine attaches to each request's events.
measured here: the CPU server's own /metrics, scraped every second during the runs of section 5. Pick a run and match it to a row of the table below: with max_num_seqs 2 running stays pinned at the cap while waiting grows; with a 1 GiB cache, KV usage sits high and waiting grows instead.
| Symptom in the metrics | What it means | What to change |
|---|---|---|
| num_requests_waiting grows, kv_cache_usage_perc near 1, num_preemptions rising | Memory-bound: prompts do not fit; running requests evict each other. | More cache (utilization, FP8 KV), shorter max_model_len, more replicas. |
| num_requests_running pinned at max_num_seqs, waiting grows, KV usage well below 1 | The concurrency cap, not memory, is the limit. | Raise max_num_seqs if TPOT allows. |
| request_queue_time_seconds high while running and KV are low | Head-of-line blocking or an engine stuck on something else (start-up, a long prefill without chunking). | Check chunking; look at the iteration logs. |
| inter_token_latency_seconds has a long tail, TPOT mean fine | Prefill chunks are lengthening some decode steps. | Smaller max_num_batched_tokens, or disaggregate (Distributed and disaggregated serving). |
| prefix_cache_hits / prefix_cache_queries low on traffic that shares prompts | Prefixes differ in the first block (a timestamp at the top of the system prompt), requests land on different replicas, or blocks are evicted before reuse. | Put the variable part last; prefix-aware routing; more cache. |
| time_to_first_token_seconds high but queue time low | Prefill itself is slow: long prompts, or a budget too small to finish them in few steps. | Raise max_num_batched_tokens; prefix caching. |
Gaps worth knowing. No exported metric counts how many cached blocks are evicted to make room (only residency histograms, which need --kv-cache-metrics sampling) or how much work preemption threw away. Section 8 adds the first one, as a worked example of a contribution.
vLLM ships a minor release about every two weeks, each with several hundred commits. Most lines of a release note are model and kernel work; what an operator must read are the changed defaults and the breaking changes, because a deployment that never set a flag silently inherits the new value. The code walked through on this page is the v0.31.0 tag; what changed in the releases around it is in the closed table below.
All six from the GitHub releases, v0.28 to v0.31 read 2026-10-08, v0.32 read 2026-10-19 and v0.33 read 2026-11-16.
| Release | Size | What changes for a running deployment | Breaking |
|---|---|---|---|
| v0.28.0 2026-08-26 | 584 commits, 270 contributors (76 new) | max_num_batched_tokens 16,384 for the API server on GPUs with at least 160 GiB (B200, B300, MI300X); prefix caching on by default for Mamba models; Blackwell CUDA graph capture size up to 1,024; tiered KV offload to disk; Model Runner V2 gains prefill/decode/encode disaggregation and weight offloading | bitsandbytes moved to an out-of-tree plugin; Transformers 5.15.0; calculate_kv_scales and override_attention_dtype removed |
| v0.29.0 2026-09-09 | 594 commits, 277 contributors (91 new) | Model Runner V2 becomes the default for all models (V1 deprecated, removal targeted for v0.32; the v0.32.0 notes only drop the model-specific V1 exceptions on ROCm and do not say V1 itself was removed); FlashInfer all-reduce on by default for TP; prefix-cache seed hash deterministic by default; new admission limits --max-num-queued-reqs and --max-num-queued-tokens; per-request speculative acceptance statistics in API responses (--per-request-spec-decode-metrics) | ten deprecated architectures removed; FlexOlmo, Olmo3, Hunyuan V1/VL moved to the Transformers backend; PyAV video decoder removed; python -m vllm.entrypoints.openai.api_server deprecated for vllm serve |
| v0.30.0 2026-09-22 | 762 commits, 315 contributors (104 new) | Fast Start: a per-GPU daemon keeps quantized, sharded weights resident so a restarted engine maps them (--load-format ipc_cache); CUDA graph capture 12 s to 2 s and engine start 28.9 s to 8.2 s on an H200 (project's measurement); Gumbel-max watermarking; HiSparse host tier for sparse-MLA models | scale-out endpoints need --enable-scale-out; GPTQ g_idx removed; two prefix-cache and hasher environment variables removed; Mamba cache mode "all" deprecated; YaRN aliases no longer rescale max_model_len |
| v0.31.0 2026-10-05 | 717 commits, 307 contributors (96 new) | vllm preload weight-cache daemon and experimental CRIU engine snapshots; scheduling controls (--max-num-active-seqs, adaptive long-prefill threshold, KV-holding requests first); draft-model speculative decoding on Model Runner V2; prefix-cache keys tagged by source and the LoRA path included in the block hash | per-request multimodal kwargs rejected unless --trust-request-mm-kwargs; tokenizer_mode="slow" removed; quantization="fp8" online quantization replaced by fp8_per_tensor; --enforce-eager now also disables JIT kernel warmup; AllSpark W8A16 removed |
| v0.32.0 2026-10-18 | 814 commits, 363 contributors (121 new) | a POST /v1/systemone endpoint for decision models (choice, noul and score questions over structured state), served by default; NVFP4 KV cache on SM8x, SM90 and SM12x, and FP8 KV by default for GLM-5.x on SM100 (project's measurement: +2.3 to 5.5% throughput, 7 to 11% higher TTFT, half the KV memory); least-loaded routing across API servers (+43 to 85% requests per second on short requests, project's measurement); Model Runner V2 gains a GPU n-gram speculator and becomes the default on ROCm; vllm download-kernels | Python 3.10 dropped (3.11 minimum); default CORS origins changed from * to none (--allowed-origins for browser clients); cascade attention removed (--disable-cascade-attn only warns, gone in v0.33.0); max_tokens is an upper bound on output and no longer reserved from the context window; Responses streaming reasoning events renamed to response.content_part.* with part.type="reasoning_text"; JSON schemas nested deeper than 64 levels rejected with 400; torch.compile sequence-parallel and AsyncTP passes and mamba_cache_mode="all" removed |
| v0.33.0 2026-11-02 | 927 commits, 389 contributors (122 new) | an OpenAI-compatible /v1/decisions endpoint, on by default for supported generation models (decision models such as Decision 3.0 and Cloudflare's Clef-Flash are served on /v1/systemone); DFlash and DSpark drafts no longer reserve slots in the token budget; FLy, an opt-in lossy (not exact) verification policy; PyTorch 2.14.0 | release wheels and images are CUDA 13.0 only (12.9 dropped); Medusa and the MLP speculator removed; the legacy Ray compiled-graph executor removed; requests sent while generation is paused get HTTP 503; NIXL connector needs NIXL 1.5 or newer; --mamba-cache-mode, LM Format Enforcer and --ir-op-priority deprecated |
The old page also listed model-specific kernel speedups from v0.28.0 and v0.29.0 (Kimi-K3, DeepSeek V4, Hy4-preview); they are verified in the release notes but belong to the models' own pages. Its "about 3x throughput" for decode context parallelism on long-context agentic workloads was not found in the release notes and is left out (unconfirmed).
Section 6 found a gap: the server says how often the prefix cache hits, but not how often it has to throw cached blocks away to make room, which is the number that says "this cache is too small for this traffic". Adding it touches each layer of the metrics path once, which makes it the shortest tour of how a number gets from the engine core to Prometheus.
The patch in four steps, engine core to /metrics:
In BlockPool.get_new_blocks, the only place a cached block is evicted, increment a counter when _maybe_evict_cached_block returns True; add take_num_evicted_cached_blocks() to read and reset it.
A new field evicted_blocks on PrefixCacheStats, filled in KVCacheManager.make_prefix_cache_stats(), so it travels to the API server inside each step's SchedulerStats like the hit counts.
A Prometheus counter vllm:prefix_cache_evicted_blocks registered next to prefix_cache_hits in PrometheusStatLogger and incremented in record().
A unit test built on the same fixture as test_evict: free a request with five cached blocks, allocate eight new ones, expect exactly three evictions (the five never-hashed free blocks go first), then zero after the reset.
The tests, run in vLLM's own CPU image measured here, 2026-10-08: the image's installed package with the four patched files mounted over it, and the clone's tests/ directory (which contains the new test) in both runs: test_prefix_caching.py, test_scheduler.py and metrics/test_stats.py.
| Run | Result | The new test |
|---|---|---|
| Unpatched v0.31.0 | 373 passed, 1 failed | fails: AttributeError: 'PrefixCacheStats' object has no attribute 'evicted_blocks', as a test written first should |
| Patched | 374 passed | passes, and the existing test_evict still passes |
Files: src/patch/apply_patch.py (applies it to a v0.31.0 checkout), src/patch/eviction_metric.diff (57 lines added, 1 removed, in 5 files), src/patch/tests_docker.sh and the two test logs. Not submitted upstream; a real PR would also need a line in the metrics design doc.
From the contributing guide at v0.31.0, checked against the old page's notes:
Correction to the old page: it gave the source install as plain uv pip install -e ., which compiles every kernel; the guide's Python-only path is the precompiled one above. Its "PRs need tests" is the practice the guide's testing section describes rather than a stated rule.
This page, the parent page and its siblings, the knowledge base pages that own the neighbouring subjects, and the best vLLM sources, each with an approximate time. Links checked on 2026-10-08.
The request path, the scheduler loop, the KV cache manager with the scheduler recorded step by step, the model runners, the knobs measured on a live server, metrics, upgrades and a first patch. Reading: 41 min, plus 15 in closed details
What every engine does, with its Serving simulator (checked against this scheduler), Engine bench and Capacity planner tabs. Reading: 34 min, plus 3 in closed details
The radix tree against this page's hash chain. Reading: 34 min, plus 16 in closed details
The mechanisms with their papers: Orca, PagedAttention, Sarathi-Serve, eviction policies, preemption by recompute against swap. Reading: 37 min, plus 21 in closed details
Why vLLM's scheduler counts draft tokens, and how verification works. Reading: 36 min, plus 8 in closed details
TP, PP, EP, KV connectors, Dynamo and llm-d around vLLM; its closed "Measured here" block in section 4 runs this page's CPU image with TP2 and PP2. Reading: 41 min, plus 21 in closed details
Routing, autoscaling, cold starts, multi-LoRA and honest load testing, with vLLM's CPU image in Docker. Reading: 34 min, plus 13 in closed details
llama.cpp, Ollama and MLX: running models on one machine. Reading: 41 min, plus 49 in closed details
The paper behind the block pool. 27 min
KV-cache sizing for any model, with its KV-cache calculator: how many tokens a given cache holds. 28 min, plus 13 in closed details
CUDA graphs in vLLM, capture sizes and what breaks them. Reading: 33 min, plus 15 in closed details
torch.compile, Inductor, Triton: what -O2 does. Reading: 37 min, plus 22 in closed details
FlashAttention and split-KV decode, the kernels the model runner calls. Reading: 34 min, plus 15 in closed details
The KV cache as physical memory. Reading: 27 min, plus 9 in closed details
The server-sent events the API server writes. 38 min
What the sampler at the end of each step computes. Reading: 22 min, plus 4 in closed details
The framework vLLM is built on. 30 min
Processes, entrypoints, workers; read before the code. 30 min
Read schedule() (L562 to about L1520) with the stepper open. 60 min
The block pool, hashing and eviction, with diagrams. 25 min
Why the runner was rewritten. 20 min
Every metric and why it exists. 30 min
The project's own advice on preemption, chunked prefill and parallelism. 20 min
Why the engine was re-architected in 2025. 20 min
Setup, tests, DCO, AI-assisted contributions, review expectations. 25 min
Read the highlights and breaking changes of every release you skip. 15 min each
Kwon et al., SOSP 2023. 45 min