﻿# What does the Qwen4 million-token cache estimate leave out of the server budget?

The vLLM integration note describes a compact cache for Qwen4-35B-A3B. Estimate accelerator and host memory separately before setting the context and concurrency limits.

Author: Retrivium editorial team
Updated: 2026-12-05
Canonical URL: https://retrivium.ai/journal/daily-20261205-compute-qwen4-vllm-context-admission/
Language: en

The Qwen team listed Qwen4-35B-A3B as available on its release page, and the vLLM integration note explains how the serving engine places its largest memory structures. The model card specifies a context window of up to one million tokens. An operator still has to decide what lengths and concurrency the server can admit without excessive latency or preemption.

## Separate the memory tiers

The architecture mixes recurrent layers that hold a fixed-size state with sparse attention layers that retain keys and values. The vLLM team reports about 8 GiB for the million-token context in its supported NVFP4 cache configuration. The estimate covers the context representation in that configuration. Allocate separately for model weights, runtime workspaces and memory used by other requests. Actual cache allocation also depends on the backend and runtime settings.

## Watch the host table as well

The per-layer n-gram table occupies about 20.5 GB in the FP8 checkpoint according to the integration note. vLLM describes putting that table in pinned host memory. Host capacity and transfer timing therefore matter alongside device memory. Record what the worker allocates at startup. A change in GPU memory consumption on its own cannot show the cost of reading table rows or the impact on another process on the host.

## Start with a length ladder

Pin the checkpoint, runtime build and cache format. Start with normal request lengths, then test longer inputs at the same output limit. Measure cold and warm requests separately and capture time to first token, inter-token latency and memory on both sides of the transfer. Run a representative multimodal request if that will be part of traffic. The image encoder and tokenized input can change the workload.

## Repeat under realistic concurrency

Increase active sessions and record evictions, preemptions and tail latency. Keep the memory that remains free after loading consistent across comparisons. Set separate limits for input length and active requests at the first point that reliably meets your latency target, then leave headroom for fluctuations. Advertise a higher limit only after repeating the test with the exact serving build and traffic shape.

## Practical takeaway

Record admission limits per worker rather than carrying a single model-level value across the fleet. A worker with the same GPU can still differ in host memory bandwidth or available pinned memory, so a proven limit belongs to the validated server profile.

## Primary sources

- [vLLM integration note](https://github.com/vllm-project/vllm-project.github.io/blob/main/_posts/2026-12-04-qwen4-35b-a3b.md)
- [Qwen model card](https://huggingface.co/Qwen/Qwen4-35B-A3B)
- [Qwen release notes](https://github.com/QwenLM/Qwen4/blob/main/README.md)

## Related reading

- [vLLM KV cache preemption: why requests are recomputed](/journal/vllm-kv-cache-preemption/)
- [LMCache CPU offload: size a reusable KV working set](/journal/lmcache-cpu-kv-offload/)
