Skip to content
SpecsCalc

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

The exact artifact is qwen2.5:7b-instruct-q4_K_M, with f16 keys and values. A and B are alternatives on one runner. Use the per-request token limit, not an estimate from a character count.

Setup B models 1344 MiB more raw KV cache A: 1 × 8192 tokens → 448 MiB raw f16 KV (0.4375 GiB). B: 4 × 8192 tokens → 1792 MiB raw f16 KV (1.75 GiB). The two setups are alternatives, not simultaneous allocations. Weights, runtime buffers, other apps and placement are excluded. This is not a VRAM fit or throughput result.

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.

Two ways to spend the same raw cache budget
Slots × contextRaw f16 KVUser tradeoff
1 × 8,192448 MiBOne active request gets the full context.
2 × 8,192896 MiBTwo concurrent requests keep that same per-request context.
4 × 4,096896 MiBFour 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.