Answers for LLM inference engineers

How many concurrent requests fit in vLLM? A KV cache planner that follows vLLM's own startup math

vLLM answers this at startup, and you can compute the same number before you launch. It takes total GPU memory × gpu_memory_utilization, keeps what the weights, the activations and the CUDA graphs need, cuts what is left into blocks of 64 tokens (16 up to v0.33.0), and logs GPU KV cache size: N tokens, Maximum concurrency for L tokens per request: X.XXx. X is the number of blocks divided by the blocks one request of max_model_len tokens needs. Lowering --max-model-len does not free memory; it only raises X. How many requests really run together is capped separately by --max-num-seqs (256 or 1,024 by default).

The planner below runs that calculation in your browser, from a config.json before launch or from a startup log afterwards. It follows vLLM v0.34.0 and, with the version switch, v0.33.0 and earlier. It uses vLLM's layer grouping, so it also gets models with sliding-window layers right (Gemma 2 and 3, gpt-oss), where "bytes per token × context" overshoots by a factor of two or more.

Published 2026-11-12 · Corrected 2026-11-14: two rows of the version table (v0.8.4, v0.20.0) · Updated 2026-11-17: follows vLLM v0.34.0 (2026-11-16), with a switch for v0.33.0 and earlier · Agrees with vLLM's own planning code on 40,000 random configurations for each of the two releases and with 8 public startup logs (details) · Tool version 1.1.0 · no GPU run by us

What v0.34.0 changed. A block is 64 tokens instead of 16 (PR #63231). On CUDA and ROCm the "extensible KV cache" is on by default: the cache is sized from the memory that is actually free after CUDA graph capture and warmup, not from an estimate, and gpu_memory_utilization, when not given, is 1.0 instead of 0.92. --no-enable-extensible-kv-cache, --kv-cache-memory-bytes, --num-gpu-blocks-override, other platforms and some KV connectors keep the estimate and 0.92. The grouping of layers and the blocks one request needs are the same code as in v0.33.0.

Planner

Examples:

 

Nothing you paste leaves the page. The same logic as a script: kvplan.py (one file, standard library only, MIT), python kvplan.py plan --config config.json --gpu-gib 24 --weights-gib 14.96 --max-model-len 32768 (add --vllm-version 0.33 for v0.33.0 and earlier) or python kvplan.py log --file vllm.log.

Which tab? The config tab is exact about the KV side (blocks, groups, what one request reserves) and only as good as your guess for the non-KV memory, which vLLM measures with a profiling pass. Once the server has started, the log tab is exact for both, and it works for every model, including the ones the config tab refuses (Qwen3.5 and other hybrids with linear-attention or Mamba layers, DeepSeek-V4, packed KV formats).

What does vLLM compute at startup?

Seven steps, all visible in the v0.34.0 source. The example is the planner's default: Llama-3.1-8B in bf16 on a 24 GiB GPU with nothing else on it, 14.96 GiB of weights, and an assumed 1.5 GiB for activations and CUDA graphs, 1.0 GiB of it a transient peak.

  1. Budget = ceil(total memory × gpu_memory_utilization). It is a share of the total, not of what is free. With the extensible KV cache the default is 1.0 and the budget is only a cap; with estimate-based sizing (and in every release up to v0.33.0) the default is 0.92, and if less than the budget is free, startup stops with Free memory on device ... is less than desired GPU memory utilization (worker/utils.py, config/cache.py). Example: 24 × 1.0 = 24 GiB; up to v0.33.0, 24 × 0.92 = 22.08 GiB.
  2. KV memory. With the extensible KV cache, vLLM measures after CUDA graph capture and warmup: min(budget − resident, free at startup − resident − margin) − transient peak, where resident is what stays allocated (weights, CUDA graphs, workspaces), the margin is max(1 GiB, 0.75 × transient peak) (3 GiB floor on ROCm), and the transient peak is the larger of the measured activation peak and the growth of PyTorch's reservation. It logs Memory after warmup: ... N KV cache blocks (X GiB) fit within the requested ...; the earlier Available KV cache memory line is only the address range reserved before warmup (extensible_kv_cache.py). Example: min(24 − 15.46, 24 − 15.46 − 1) − 1 = 6.54 GiB. With estimate-based sizing: budget − weights − activation peak of a profiling pass − estimated CUDA graph memory, which is the Available KV cache memory line (gpu_worker.py); up to v0.33.0, 22.08 − 14.96 − 1.5 = 5.62 GiB. --kv-cache-memory-bytes sets it directly.
  3. One page is one block of one layer: KV heads × (key dims + value dims) × bytes per element × block size (64 tokens; 16 up to v0.33.0). With tensor parallel, each GPU holds max(1, KV heads ÷ TP) heads (kv_cache_interface.py, config/model.py). Example: 8 × 256 × 2 × 64 = 262,144 bytes.
  4. Layers are put into groups that share a block table, and one block holds the pages of the widest group. A model whose layers are all alike is one group (kv_cache_planning.py). Example: 32 layers × 262,144 = 8,388,608 bytes per block, which is 128 KiB per token.
  5. Blocks = KV memory // bytes per block. Example: 837 blocks (2,877 blocks of 16 tokens from 5.62 GiB up to v0.33.0).
  6. Blocks one full-length request needs: ceil(L ÷ block size) for a full-attention group; for a sliding-window group, ceil(min(window − 1 + tokens in flight, L) ÷ block size) + 1, where tokens in flight = concurrent batches (2 with async scheduling, the default) × max_num_batched_tokens. Example at L = 32,768: 512 blocks.
  7. Maximum concurrency = blocks ÷ blocks per request, and GPU KV cache size = int(concurrency × L) tokens. One block is the permanently reserved null block: if a single request does not fit in the rest, startup stops and prints an estimated maximum model length. Example: 53,568 tokens, 1.63x at 32,768; 6.54x at 8,192; at 131,072 it refuses to start and estimates 53,504. Up to v0.33.0 the same GPU gives 46,032 tokens and 1.40x at 32,768.

How much KV cache does one token take?

It depends on the attention type of each layer, not only on the model size. b is the size of one element: 2 bytes for bf16 or fp16, 1 for fp8.

Layer typeBytes per token, per layerWhat one request holdsExample
Full attention (MHA, GQA, MQA)2 × KV heads × head dim × bevery token up to its lengthLlama-3.1-8B: 32 layers × 8 × 128 → 128 KiB per token; 64 KiB with fp8
MLA (DeepSeek-V2/V3, Kimi K2 and others)(kv_lora_rank + qk_rope_head_dim) × b; one latent vector, no separate V, not divided by tensor parallelevery tokenDeepSeek-V3: 61 layers × 576 → 68.6 KiB per token
Sliding-window layersame as full attentiononly window − 1 + tokens in flight, plus one blockGemma 3 (five of six layers; window 1,024 in the 27B config), gpt-oss (every other layer, window 128)
Linear attention, Mamba (Qwen3.5, Jamba, ...)a fixed-size state per request, independent of lengthuse the log tab
Sparse MLA (DeepSeek-V4), HiSparse, packed formats (int4, NVFP4, TurboQuant ...)page layouts chosen by the attention backenduse the log tab

--kv-cache-dtype auto means "the model's dtype", so a 4-bit AWQ or AutoRound model still gets a 16-bit KV cache. fp8 is opt-in, except for llm-compressor checkpoints that declare a KV cache scheme (attention.py).

Why is "bytes per token × context" wrong for Gemma 3 and gpt-oss?

Because their sliding-window layers do not keep the whole context, and vLLM sizes them by the window. Gemma 3 27B has 62 layers; 52 of them attend to the last 1,024 tokens only. The flat formula gives 496 KiB per token and 62.0 GiB for one 131,072-token request. vLLM instead builds 7 groups (one with the 10 full-attention layers, six with the sliding layers) and reserves:

Gemma 3 27B, bf16 KV, 40 GiB of KV memory, max_model_len 131,072One request reservesMaximum concurrency
Flat formula (every layer keeps every token)62.0 GiB0.65x, "does not fit"
vLLM, max_num_batched_tokens 8,192 (default on GPUs of 70 GiB and more)18.0 GiB2.23x
vLLM, max_num_batched_tokens 2,048 (default below 70 GiB)12.4 GiB3.24x
vLLM with --disable-hybrid-kv-cache-manager (also what a KV connector without hybrid support forces)62.0 GiBrefuses; estimated maximum model length 84,544

Three details move the number. The sliding layers hold window − 1 tokens plus everything the scheduler may have in flight, so a larger --max-num-batched-tokens lowers the concurrency of these models. The 52 sliding layers are split into six groups of at most 10, so vLLM reserves for 60: 8 padding layers, which it also reports in a warning. And every sliding group costs one extra block per request, because a window rarely starts on a block boundary. For gpt-oss-20b the same effect turns 6.0 GiB per 131,072-token request into 3.1 GiB.

A config that sets sliding_window without layer_types makes every layer a sliding-window layer in vLLM. Qwen2 and Qwen3 configs carry a sliding_window value but ignore it unless use_sliding_window is true, so they are plain full attention.

Readings of these numbers that go wrong

Six expectations the startup numbers seem to support, and what vLLM does instead.

ExpectationWhat vLLM does
A smaller --max-model-len uses less GPU memoryThe pool keeps its size; only the concurrency figure changes. A T4 with Llama-3.2-3B logged 5.83, 5.85 and 5.78 GiB of KV cache at 8,192, 4,096 and 16,384 tokens, and 6.66x, 13.37x and 3.30x (forum thread). To use less memory, lower --gpu-memory-utilization or set --kv-cache-memory-bytes.
gpu_memory_utilization is a share of the free memoryIt is a share of the total, for this instance. Two servers on one GPU need shares that add up to less than 1, and each needs its whole share to be free when it starts.
"Maximum concurrency 3.81x" means three requests at mostIt is the count for requests that all reach max_model_len. Blocks are handed out as tokens are processed, so shorter requests share the pool; the cap on running requests is --max-num-seqs. When the pool runs out the scheduler preempts a running request, frees its blocks and recomputes it later (scheduler.py). Watch vllm:kv_cache_usage_perc, vllm:num_preemptions and vllm:num_requests_waiting.
A 4-bit model leaves the saved memory freevLLM still takes its whole budget; what the smaller weights save becomes KV cache. That is why nvidia-smi shows the GPU nearly full for any model.
A larger --max-num-batched-tokens only speeds up prefillIt raises the activation peak, which comes out of the KV memory (an A30 went from 6.24 to 4.53 GiB between 64K and 80K, forum thread), and for sliding-window models it raises what each request reserves.
Everything needed is in config.jsonHub configs leave out keys that equal the class default. Gemma 3 4B's text_config has no head counts (discussion); 8 heads, 4 KV heads and head_dim 256 come from the transformers config class. The planner fills such keys from transformers 5.22.2 and says so under the result.

What are the defaults for max_num_seqs and max_num_batched_tokens?

They depend on the GPU's memory, and on whether you use vllm serve or the LLM class (get_batch_defaults in arg_utils.py; the function is the same code in v0.33.0 and v0.34.0):

GPU memorymax_num_seqsmax_num_batched_tokens, vllm serve / LLM
160 GiB and more1,02416,384 / 16,384
70 GiB and more, except A100 and GB10 (DGX Spark)1,0248,192 / 16,384
everything else, A100 80GB included2562,048 / 8,192

If the planner's "requests held at once" is above max_num_seqs, raise --max-num-seqs to use the memory. If it is below, the KV cache is the limit, and requests beyond it wait or trigger preemption.

What was this checked against?

vLLM's own code, and logs that people posted.

LogKV memory, GiBLogged capacityPlannerSource
Qwen3-1.7B, RTX 3090, v0.15.116.65155,904 / 3.81x at 40,960155,824 to 155,920 / 3.81xvLLM forum, 2026-02
Qwen3-8B50.32366,400 / 8.95x at 40,960366,368 to 366,448 / 8.95xLMCache FAQ
Qwen3-32B, TP=2, H10033.66275,760 / 6.73x at 40,960275,696 to 275,776 / 6.73xLMCache FAQ
Llama-3.1-70B, TP=4, H10032.06420,208 / 3.21x at 131,072420,144 to 420,272 / 3.21xLMCache FAQ
Llama-3.2-3B, T4, max_model_len 81925.8354,544 / 6.66x at 8,19254,528 to 54,624 / 6.66xvLLM forum, 2026-06
Llama-3.2-3B, T4, max_model_len 40965.8554,752 / 13.37x at 4,09654,720 to 54,816 / 13.37xvLLM forum, 2026-06
Llama-3.2-3B, T4, max_model_len 163845.7854,096 / 3.30x at 16,38454,064 to 54,160 / 3.30xvLLM forum, 2026-06
Gemma 3 4B, A100 80GB, v0.29, LLM class58.33729,735 / 22.27x at 32,768729,735 to 729,861 / 22.27xSOTAAZ, 2026-10

All eight logs are from releases before v0.34.0, so the planner column is the "v0.33.0 and earlier" setting (blocks of 16 tokens). We have not found a public v0.34.0 startup log yet. The T4 logs are from an older engine that prints blocks; capacity there is blocks × 16. The Gemma 3 4B run used the LLM class on an A100 (8,192 batched tokens, so 16,384 in flight).

What changed between versions?

SinceChange
v0.6.5 (2024-12)gpu_memory_utilization counts this instance only; before, memory used by other processes was subtracted from the KV cache
v0.8.4 (2025-04)the "does not fit" error prints an estimated maximum model length
v0.9.1 (2025-06)Available KV cache memory line; startup stops when less than the budget is free
v0.10.2 (2025-09)--kv-cache-memory-bytes
v0.14.0 (2026-01)--max-model-len -1 picks the longest context that fits
v0.20.0 (2026-04)default gpu_memory_utilization 0.9 → 0.92; the estimated CUDA graph memory is subtracted from the KV memory by default (VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0 turns it off; the variable exists from v0.18.0, off by default until here)
v0.20.1 (2026-05)GPU KV cache size = concurrency × max_model_len; before, blocks ÷ groups × block size, which understated models with sliding-window layers
v0.26.0 (2026-07)sliding-window layers reserve window − 1 + concurrent batches × max_num_batched_tokens; before, one batch
v0.28.0 (2026-08)the two capacity lines became one; GPUs of 160 GiB and more get 16,384 batched tokens
v0.34.0 (2026-11)default block 16 → 64 tokens; the extensible KV cache is on by default on CUDA and ROCm and sizes the cache from the memory free after CUDA graph capture and warmup (new log line Memory after warmup); default gpu_memory_utilization is 1.0 with it, 0.92 without; with it, less free memory than the budget no longer stops startup; the "does not fit" error ends with a different hint

Read from the release tags of the vLLM repository. On releases older than v0.26.0 the config tab can differ for sliding-window models; the log tab does not depend on the version.

Limits

Questions

How does vLLM calculate "Maximum concurrency"?

It divides the number of KV cache blocks by the blocks one request of max_model_len tokens needs. The blocks come from the KV memory: total GPU memory times gpu_memory_utilization, minus the weights, the activation peak of a profiling pass and the CUDA graph estimate, cut into blocks of 64 tokens (16 up to v0.33.0). For a full-attention model one request needs ceil(max_model_len / block size) blocks. From v0.34.0 on CUDA and ROCm the memory is measured after warmup instead of estimated, and gpu_memory_utilization defaults to 1.0.

Does lowering --max-model-len reduce vLLM's GPU memory use?

No. vLLM still takes total memory times gpu_memory_utilization and gives everything left after the weights to the KV cache. A shorter max_model_len only means each full-length request needs fewer blocks, so the logged concurrency goes up. To use less memory, lower --gpu-memory-utilization or set --kv-cache-memory-bytes.

Is "Maximum concurrency" the limit on simultaneous requests?

No. It is how many requests fit if every one of them grows to max_model_len. Blocks are handed out as tokens are processed, so shorter requests share the pool and more of them run together, up to --max-num-seqs (256 or 1,024 by default, depending on the GPU). When the pool runs out, the scheduler preempts a running request and recomputes it later.

How much KV cache does one token take in vLLM?

For standard attention: 2 x layers x KV heads x head dimension x bytes per element. Llama-3.1-8B (32 layers, 8 KV heads, 128 dims, 16-bit) takes 128 KiB per token; --kv-cache-dtype fp8 halves it; tensor parallel divides the KV heads per GPU. DeepSeek-style MLA stores one latent vector per layer (kv_lora_rank + qk_rope_head_dim values). Sliding-window layers keep only the window plus the tokens in flight.

Why does vLLM say the model's max seq len needs more KV cache than is available?

One request of max_model_len tokens must fit in the KV cache, with one block held back. If it does not, vLLM stops and prints the estimated maximum model length that would fit. Pass that value (or --max-model-len -1 from v0.14.0) as the context length, raise --gpu-memory-utilization, use --kv-cache-dtype fp8, or spread the model over more GPUs.

Sources

On this site: which PyTorch, CUDA and driver each vLLM release needs · tensor parallel hangs on two GPUs · which llama.cpp build a GGUF needs