vLLM: inside the default engine

How vLLM v0.31.0 turns an HTTP request into tokens, read from its source with file and line: the processes, the scheduler loop, the KV cache manager and prefix cache, the model runners, the knobs that matter, the metrics that show them, upgrades and a first patch. Its real scheduler recorded step by step and its knobs measured on CPU, serving Qwen3-0.6B. A child of Topic: inference-and-serving. Data as of October 2026. Reading: 41 min, plus 15 in closed details.

The idea in one screen

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.

  1. The API server tokenizes. C's question, "Do you sell batteries for electric bikes?", arrives as an HTTP request with stream: true. The API server process speaks HTTP, applies the chat template and tokenizes, on its own CPU: 104 token ids, most of them the shop's system prompt that every customer shares.
  2. Two processes, two queues. The token ids go to the engine core as one msgpack message over ZeroMQ and join the scheduler's waiting queue between two steps; outputs come back the same way (section 1).
  3. One loop, three calls. No phases, only a token budget. Every step the busy loop calls schedule(), the model, update_from_output() (v1/engine/core.py L630). In step 4 of the recording the scheduler gives A and B, already decoding, 1 token each and C 40: 42 of the 64-token budget. Prefill, chunked prefill, decode and speculative tokens are all "give this request some tokens this step" (section 2).
  4. Memory is a pool of 16-token blocks on a GPU (32 tokens on this CPU). The KV cache manager finds C's first 2 blocks (64 tokens) already cached by hash, shared with A and B, and hands it blocks 7 and 8 for the rest from the head of the free queue. A free queue whose order is the eviction policy, and a map from block hash to block that is the whole prefix cache (section 3).
  5. The GPU side is a model runner per GPU. The worker's model runner lays the step's 42 tokens out as one flat batch, runs one forward pass through Qwen3-0.6B's 28 layers, writes their keys and values into the blocks, and samples one token for each request whose prompt is complete, C's first among them. With one GPU the worker lives inside the engine core; Model Runner V2 by default since v0.29.0 (section 4).
  6. Tokens stream back. update_from_output() appends each sampled id; the outputs go back over ZeroMQ; the API server detokenizes, checks stop strings and writes one server-sent event. The loop repeats until C finishes at step 24: "Yes, we do sell batteries for electric bikes. Let me know if you need help with that!" Its blocks are freed: block 8, partial and unhashed, to the front of the free queue; block 7, full and hashed, to the back, kept as cache; blocks 1 and 2 stay with A and B.
  7. Where each knob acts. --api-server-count on the API server; max_num_seqs, max_num_batched_tokens and max_loras in the scheduler; gpu_memory_utilization, enable_prefix_caching and block_size on the pool; the -O level (CUDA graphs, torch.compile) on the worker. Section 5 gives each one's default and trade.

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.

Engine core
the process that runs the busy loop: scheduler, KV cache manager, and (with one GPU) the worker.
Token budget
max_num_batched_tokens: the most tokens one step may compute, across all requests.
Block pool, free queue
every KV block's metadata, and the list of blocks nobody is using, in the order they will be handed out.
Block hash
a hash of a full block's tokens and its parent block's hash: the prefix cache's key.
Model runner, persistent batch
the per-GPU object that turns the scheduler's decision into tensors, keeping them allocated across steps.
MRV2
Model Runner V2, the rewritten runner, default since v0.29.0.

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).

How the evidence was made, and running the CPU image yourself (provenance)

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.

Where vLLM comes from (context)

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).

1. One request, through vLLM's code

One streamed request crosses two processes and back: follow it function by function

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

  1. The client sends one request. A JSON body with the prompt and stream: true. FastAPI routes it to create_completion (api_router.py L47).
  2. The serving layer builds sampling parameters. OpenAIServingCompletion.create_completion (serving.py L109) turns the request into SamplingParams and calls engine_client.generate() (L203), an async generator.
  3. Tokenize, in the API server. AsyncLLM.add_request runs the InputProcessor (async_llm.py L449): chat template and tokenizer, on this process's CPU. It also creates the request's own output queue, a RequestOutputCollector (L495).
  4. Register, then send to the engine. The OutputProcessor gets an incremental detokenizer for this request (L547); then add_request_async (L550) sends an EngineCoreRequest, msgpack over a ZeroMQ socket (core_client.py L1259).
  5. Engine core: an I/O thread receives it. A dedicated input thread decodes the message and puts it on a Python queue (core.py L1754), so socket work never blocks the loop.
  6. The busy loop picks it up. Each loop iteration first drains the input queue (_process_input_queue, L1496), so new requests join between steps; Scheduler.add_request (scheduler.py L2557) appends it to the waiting queue and its full blocks are hashed for the prefix cache.
  7. schedule(): who runs, how many tokens. The scheduler fills a token budget: running requests first, then waiting ones, allocating KV blocks for each (scheduler.py L562). Our request is admitted and gets its prompt (or a chunk of it). Section 2 opens this function.
  8. The model runs. execute_model (core.py L641) goes through the executor to the worker's model runner: build input ids, positions and block tables, run the forward pass (model_runner.py L1676), then sample one token per request (L2050).
  9. update_from_output(): append, check, free. The sampled id is appended to the request; EOS, stop token ids and max_tokens are checked here; a finished request's blocks go back to the pool (scheduler.py L1967).
  10. Outputs leave the engine. The step's outputs for every running request go on the output queue (L1526); an output thread sends them over ZeroMQ (L1856). The loop is already scheduling the next step.
  11. Detokenize, check stop strings. The API server's output_handler task (async_llm.py L813) hands them to process_outputs (output_processor.py L646): incremental detokenizing and stop-string checks (L720), then a put into this request's collector (L745).
  12. Stream it out, and repeat. generate() yields from that collector (L735); the serving layer writes one server-sent event. Steps 7 to 12 repeat once per output token until the request finishes.

Three consequences, each a classic production surprise:

  • Tokenizing and detokenizing happen in the API server, not on the GPU's critical path, so at high request rates that single Python process can saturate before the GPU does; the architecture overview sizes CPU cores for this, and --api-server-count scales it out.
  • The scheduler sees token ids, never text. Stop strings are checked in the API server after detokenizing (output_processor.py L720), which then aborts the request in the engine; stop token ids and max_tokens are checked in the engine itself.
  • Each step returns outputs for every running request at once, and the API server fans them out to one queue per request (RequestOutputCollector), so one slow client does not slow the loop.
Predict: vllm serve <model> -tp 4 on one server with four GPUs. How many vLLM processes run?

Async scheduling hides the CPU's work behind the GPU's: the same three steps, before and after

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

  1. Step 1. The engine core schedules (3 ms), then waits while the GPU runs the forward pass (10 ms); only then can it apply the sampled tokens (1 ms). The GPU is idle while the CPU decides.
  2. Step 2. The next schedule() cannot start before step 1's tokens are applied, so the GPU idles another 4 ms between forward passes.
  3. Step 3. The same gap again: every step costs the CPU's time plus the GPU's, 14 ms.
  4. Step 4. Four steps take 56 ms, and the GPU is busy 71% of the time.

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.

2. The scheduler loop

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:

# There's no "decoding phase" nor "prefill phase" in the scheduler. # Each request just has the num_computed_tokens and num_tokens_with_spec. # At each step, the scheduler tries to assign tokens to the requests # so that each request's num_computed_tokens can catch up its # num_tokens_with_spec. This is general enough to cover chunked prefills, # prefix caching, speculative decoding, and the "jump decoding" optimization. (L564 to L573, abridged)

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

  1. Two numbers per request. A has computed 105 of its 106 tokens (it is decoding: it needs 1); B 87 of its 111-token prompt (it needs 24); C has just arrived with 104 tokens and none computed. The scheduler closes those gaps within the budget.
  2. Loop 1, running requests first. In order of admission (L630): tokens wanted, capped by what is left of the budget (L681), then allocate_slots for the blocks those tokens need. A gets 1 token, B 24 and block 8 for its last ones: 25 of 64 used. If the pool is empty, preempt and retry (below).
  3. Loop 2, waiting requests. Only if nothing was preempted this step (L873), and while fewer than max_num_seqs run (L893; 4 here): look up the prefix cache, cut the prompt to what the budget allows, allocate. C's whole prompt (4 blocks) fits in the 21 free blocks, so it is admitted with the 39 tokens left and blocks 9 and 10. The first request that does not fit stops the loop (L1223): first come, first served, including the head-of-line blocking that implies.
  4. One flat batch. The model runner (section 4) lays the 64 tokens out in one row, A's 1, B's 24 and C's 39, each with its position and its request's block table, so attention reads and writes the right blocks: no padding, no separate prefill and decode passes.
  5. One forward pass. All 64 tokens go through Qwen3-0.6B's 28 layers together, and each token's keys and values are written into its own request's blocks: A's block 4, B's blocks 7 and 8, C's blocks 9 and 10.
  6. After the model runs. update_from_output (L1967) appends each sampled token, checks EOS, stop ids and max_tokens, and frees the blocks of finished requests. A and B each gain one token (B's prompt is now complete, so this is its first output token); C's chunk ends mid-prompt, so it gets none and finishes its prompt over the next two steps (62, then 3 tokens).

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).

Predict: the budget is 64 tokens, two requests are decoding, and a new 150-token prompt is waiting with plenty of free blocks. How many of its tokens are computed this step?
Predict: the pool is full and the running list, in admission order, is [A, B, C]. A needs one more block to decode. What does the scheduler do?
Predict: a 4,000-token prompt arrives; 150 blocks of 16 tokens are free (2,400 tokens); the budget is 2,048 and chunked prefill is on. Is its first chunk scheduled?
What v0.31.0 added to the scheduler (release detail)

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).

What it costs, when it matters, how to check
Cost: a preemption throws away all of a request's computed tokens; head-of-line blocking can hold short requests behind a long one that does not fit. When it matters: when the KV cache is near full, with long prompts, and under bursts. How to check: vllm:num_preemptions rising, vllm:num_requests_waiting growing while vllm:kv_cache_usage_perc sits near 1, and vllm:request_queue_time_seconds (section 6). Step through the real thing at the end of section 3.

3. The KV cache manager: blocks, a free queue, and hashes

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:

KVCacheBlockkv_cache_utils.py L176: a block id, a reference count (how many running requests use it), the block's hash once it is full and cached, and two pointers for the free list. Metadata only: the tensors live on the GPU, indexed by block id.
FreeKVCacheBlockQueueL246: a doubly linked list threaded through the blocks themselves, with fake head and tail, so a block can be removed from the middle in O(1) when a request hits it in the cache. The head is the next block to hand out; the tail is the last to be evicted.
BlockPoolblock_pool.py L136: all blocks, the free queue, and a map from block hash to block. Block 0 is a reserved null block (L187), so a pool of N blocks holds N − 1 usable ones.
KVCacheManagerkv_cache_manager.py L131: the scheduler's interface: get_computed_blocks (prefix lookup), allocate_slots, free; one block table per request.

Four operations, and the order that makes a cache out of a free list

OperationWhat it doesSource
allocatePop 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
cacheWhen 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
freeA 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
touchA 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.

  1. A fresh pool. 11 blocks; block 0 is the null block, so blocks 1 to 10 wait in the free queue in order. The head, on the left, is the next block to hand out.
  2. Allocate. Request 0 takes blocks 1 to 6 (87 tokens: five full blocks and one partial); request 1 takes 7, 8 and 9. Each comes off the head, leaving 10 alone in the queue.
  3. Cache. A block that fills up gets its hash and enters the map: request 0's blocks 1 to 5, and request 1's three blocks, all full. Block 6 is partial, so it has no hash.
  4. Free request 0, tail first. Block 6 has no hash: it goes in front of the never-used block 10, to be reused first while its memory is warm. Blocks 5 to 1 are hashed and are appended to the back, last block first. The queue is now 6, 10, 5, 4, 3, 2, 1, as the test asserts: block 1, the start of the prompt, is the last to be evicted.
  5. Free request 1. When request 1 also finishes the queue becomes 6, 10, 5, 4, 3, 2, 1, 9, 8, 7: its hashed blocks go to the back, tail first.
  6. Touch: a cache hit. A new request whose first two blocks equal request 0's finds blocks 1 and 2 by hash. Each is unlinked from the middle of the queue and its count goes to 1, so nobody can evict it while it is in use: 6, 10, 5, 4, 3, 9, 8, 7.
  7. Allocate, and evict. It needs three more blocks: 6 and 10 come off the head with no hash, then 5, which still carries one. Its hash leaves the map: request 0's tail is evicted before its prefix, and nobody can find block 5's tokens any more. The queue is 4, 3, 9, 8, 7.

Prefix caching is a hash chain

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).

Against SGLang's radix tree, and hashes across machines (depth)

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).

Real block hashes from the recorded engine: where two requests' chains meet and part

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.

What it costs, when it matters, how to check
Cost: hashing every full block with SHA-256 over pickled tuples, on the engine core's CPU (--prefix-caching-hash-algo xxhash is faster but not collision resistant, and then uses a random seed per process unless PYTHONHASHSEED is set, L160). When it matters: shared system prompts, multi-turn chat, agents and few-shot templates; for unique prompts it is pure overhead, and it is on by default. How to check: vllm:prefix_cache_hits / vllm:prefix_cache_queries is the hit rate in tokens; section 6 reads both from a live server, and the parent page's Engine bench tab measured the time to first token with caching on and off.

The scheduler and the pool together, recorded on the real engine

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).

How this was recorded (provenance)

Queues after schedule()

This step's token budget

Block pool (after the step)

Free queue, head (next to hand out) to tail (last to evict)

Requests

4. The model runner, and Model Runner V2

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.

Why a second model runner

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):

Request B finishes and E joins: V1 rewrites rows, V2 writes one row and gathers

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.

V1 against V2, all five differences (design doc table)
Model Runner V1Model Runner V2
Persistent stateState tensors are the inputs; rows reordered when requests join or leaveEach 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 schedulingRetrofitted, with an async barrier around CPU buffersDesigned in: no CPU synchronization in the step; CPU writes go to unpinned buffers copied through a temporary pinned one
Block tablesCopied from CPUStagedWriteTensor: diffs staged on CPU, one kernel applies them
Input preparation and samplingPython and PyTorchTriton kernels for input ids, positions and sequence lengths; a Triton Gumbel-max sampler; top-k logprobs without a full-vocabulary softmax
CUDA graphsImplicit, mixed into dummy_runAn 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.

Exactly when you get V1 instead (the fallback list at v0.31.0)

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.

Predict: you upgrade a deployment that uses n-gram speculative decoding from v0.28 to v0.31. Which model runner does it run?

CUDA graphs and torch.compile, by link

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.

5. The knobs that matter

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 controlsRaise it andHow 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
Four more knobs: long_prefill_token_threshold, block_size, performance_mode, -O level (reference)
Knob (default)What it controlsRaise it andHow 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:

Devicemax_num_batched_tokens, server / offlinemax_num_seqs, server / offline
GPU with at least 160 GiB (B200, B300, MI300X)16,384 / 16,3841,024 / 1,024
GPU with at least 70 GiB, not an A100 (H100, H200)8,192 / 16,3841,024 / 1,024
Other GPUs (A100, L40S, RTX 5090 and smaller)2,048 / 8,192256 / 256
CPU backend, per worker2,048 / 4,096128 / 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.

Predict: the CPU server here was given a 2 GiB KV cache (VLLM_CPU_KVCACHE_SPACE=2) for Qwen3-0.6B in float32 (229,376 bytes per token) with the CPU's 128-token blocks. How many tokens can it hold?

Three knobs turned on a live server

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?

The other measures of this sweep (TTFT, peaks, load)

max_num_seqs from 2 to 16: throughput rises, each user's time per token rises with it

The other measures of this sweep (ITL p99 and median, load)

max_num_batched_tokens 2,048 against 128: a big budget stalls the users already streaming

The other measures of this sweep (KV usage, throughput, load)

KV cache 1 GiB against 3 GiB: memory pressure shows up as waiting, not preemption

Set-up of the measured runs (image, model, load generator, machine)

6. Reading the metrics

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.

A run as the dashboards see it: running, waiting and KV usage, one scrape a second

Symptom in the metricsWhat it meansWhat to change
num_requests_waiting grows, kv_cache_usage_perc near 1, num_preemptions risingMemory-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 1The concurrency cap, not memory, is the limit.Raise max_num_seqs if TPOT allows.
request_queue_time_seconds high while running and KV are lowHead-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 finePrefill 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 promptsPrefixes 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 lowPrefill 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.

Every metric the live server exported, before and after a run (reference)

7. Upgrades: what a new release changes under you

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.

Correction to the old page
The old page said v0.28.0 doubled max_num_batched_tokens from 8,192 to 16,384 for "any deployment that never set it". The release note says so in one line, but the change itself (PR #51726, merged 2026-08-11) only adds a new tier: the API server on GPUs with at least 160 GiB of memory now gets 16,384. An H100 or H200 server still defaults to 8,192, and the offline LLM class already used 16,384 there (arg_utils.py L2858 to L2887). Section 5 has the full table.

An upgrade checklist that follows from the code

  1. Diff the resolved configuration, not the flags. vLLM logs its final VllmConfig at start-up; save it for the old and new versions and compare max_num_batched_tokens, max_num_seqs, the cache size in tokens and the CUDA graph sizes.
  2. Check which model runner you got. Grep for "Model Runner V2 does not yet support" (section 4).
  3. Check the removed flags, methods and environment variables in your launch scripts, and the CUDA version your images build on (a release can drop a speculative method or a CUDA version outright: the table below); an unknown CLI flag stops the server, while a removed VLLM_ environment variable only logs "Unknown vLLM environment variable detected" (platforms/interface.py L1344) and its setting is lost (--fail-on-environ-validation, off by default, turns that into an error: arg_utils.py L836).
  4. Replay real traffic with the same load generator at the same arrival rate and compare TTFT and ITL percentiles and preemptions (section 6), not one throughput number.
  5. Re-check prefix-cache behaviour when hashes change: v0.29.0 changed the seed default and v0.31.0 changed the extra keys, so caches shared across machines (LMCache, Mooncake, llm-d) must run the same version on every node.
  6. Check what the server now exposes and accepts. v0.32.0 and v0.33.0 each serve a new endpoint by default and stops sending permissive CORS headers, so review the network policy in front of the server and add --allowed-origins for browser clients; clients that parse Responses reasoning events or count on max_tokens being reserved from the context need retesting.
Releases v0.28 to v0.33: changed defaults and breaking changes (dated release notes)

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.

ReleaseSizeWhat changes for a running deploymentBreaking
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 offloadingbitsandbytes 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 modelsscale-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 hashper-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-kernelsPython 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.0release 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).

8. A first patch: the missing eviction metric

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:

1. Count it where it happens

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.

2. Carry it with the step's stats

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.

3. Export it

A Prometheus counter vllm:prefix_cache_evicted_blocks registered next to prefix_cache_hits in PrometheusStatLogger and incremented in record().

4. Test it

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 new counter in a running server, next to the hit counters

The diff (the four source files)

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.

RunResultThe new test
Unpatched v0.31.0373 passed, 1 failedfails: AttributeError: 'PrefixCacheStats' object has no attribute 'evicted_blocks', as a test written first should
Patched374 passedpasses, 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.

How to get a change merged (contributing guide at v0.31.0)

From the contributing guide at v0.31.0, checked against the old page's notes:

  • Set-up for Python-only work: VLLM_USE_PRECOMPILED=1 uv pip install -e . reuses the released compiled kernels, so editing the scheduler needs no CUDA build; kernel work needs PyTorch first and --no-build-isolation. Tests are plain pytest; lint with pre-commit.
  • Every commit needs a DCO Signed-off-by: line; PR titles start with tags such as [Bugfix][Scheduler].
  • AI-assisted contributions must be disclosed in the PR and marked with commit trailers (for example Co-authored-by: Claude); "pure agent" PRs and one-line busywork PRs are not accepted; the human submitter must have reviewed every line and run the tests.
  • Large changes (over 500 lines, excluding kernels, data, config and tests) need an RFC issue first, or the PR gets rfc-required.
  • Review: a reviewer is assigned and gives status updates every 2 to 3 days; ping after 7 days without review.
  • Where to start: issues labelled "good first issue"; the scheduler and KV cache code in vllm/v1/core/ is readable and well tested, as this section shows; new model support follows the existing files under vllm/model_executor/models/.

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.

Interview rehearsal: three questions that need the whole page (optional)
Walk me through what happens inside vLLM between an HTTP request arriving and the first token streaming back.
API server: route, sampling params, tokenize (InputProcessor), register a detokenizer and an output queue, send an EngineCoreRequest over ZeroMQ. Engine core: an input thread queues it; the busy loop adds it to the waiting queue (hashing its full blocks); schedule() admits it if its whole prompt fits, allocating blocks after a prefix-cache lookup, and gives it budget; the executor runs the forward pass and samples; update_from_output appends the token; an output thread sends it back. API server: detokenize, check stop strings, put into the request's queue, write a server-sent event. TTFT is queue time plus the prefill steps plus these hops.
Your p99 inter-token latency spikes whenever long prompts arrive. Which knobs?
Lower max_num_batched_tokens (smaller prefill chunks per step, so decode steps stay short), or set long_prefill_token_threshold; at the cost of slower TTFT for the long prompts. If it is a separate population, disaggregate prefill and decode (distributed page). Measure with vllm:inter_token_latency_seconds and the chunk sweep of section 5.
Throughput is flat but the waiting queue grows and KV usage is near 100%. What is the limit and what do you change?
Memory, not compute: requests cannot be admitted because their prompts do not fit. Options: raise gpu_memory_utilization if there is headroom, an FP8 KV cache (half the bytes per token), lower max_model_len to stop huge requests, more replicas, or a model with a smaller cache (GQA, MLA). Raising max_num_seqs does nothing here.