Ollama with four users: how much extra KV cache does Qwen 7B need?
· By Weerasak
Document-based guide · Methodology and limits
Quick answer
On one loaded Qwen2.5 7B Instruct runner, 8,192 configured tokens per slot model 448 MiB of raw f16 KV cache for one slot and 1,792 MiB for four. The difference is 1,344 MiB, not three extra copies of the model. Compare two setups below before changing your GPU.
Do you need four conversations at once, or four people in line?
If four people can wait their turn, a server can queue work instead of processing four requests at once. Those are different hardware requirements. This calculator compares configured simultaneous slots for one loaded local model, not the number of users with accounts and not the length of a waiting queue. Context means tokens available to one request, including its input, formatting/history and generated output, not just the user’s most recent sentence.
Compare two Ollama configurations
Where 56 KiB per token comes from
The linked artifact has 28 layers, four KV heads and 28 query heads. Its 3,584-wide embedding gives a head width of 3,584 ÷ 28 = 128. The cache stores keys and values, at two bytes per f16 element. Thus 2 × 28 × 4 × 128 × 2 = 57,344 bytes per token per slot. Use the four KV heads here, not the 28 query heads. Q4_K_M labels the quantized weights; it does not specify four-bit cache.
| Slots × context | Raw f16 KV | User tradeoff |
|---|---|---|
| 1 × 8,192 | 448 MiB | One active request gets the full context. |
| 2 × 8,192 | 896 MiB | Two concurrent requests keep that same per-request context. |
| 4 × 4,096 | 896 MiB | Four concurrent slots, but half the context per request. |
What to check on your machine
Identify the loaded tag and the actual server settings, including OLLAMA_NUM_PARALLEL and your context setting. Use ollama ps to inspect what is loaded and its processor/offload and context information; do not infer the slot count from a single context number. Compare memory and response times on the same representative requests at one and several active slots.
The calculator excludes weights, allocator padding, scratch buffers, other models and desktop use. It does not know which bytes are on the GPU or in system RAM. If queuing meets your latency needs, start with fewer slots. If you genuinely need concurrency, try a shorter context only if the real prompt and desired answer still fit it.
Sources and review scope
Ollama runtime documentation and this exact model artifact were checked December 2, 2026. This is theoretical f16 K+V storage for one loaded runner, not a measured VRAM total. The comparison supports 1–8 chosen slots and 1–32,768 tokens per slot; it makes no claim about other artifacts or extended-context scaling.
- Ollama artifact 2bada8a74506: block count, KV heads, embedding width and native context
- Qwen: upstream model dimensions and grouped-query attention configuration
- Ollama FAQ: concurrent requests, queues, per-model parallelism and KV cache types
- Ollama context-length guide: current context and offload information via ollama ps