Skip to content
inhausi

How much VRAM does your LLM really need? A guide to working it out

How much graphics memory a language model needs and how to work it out yourself. The formula for model weights, KV cache and simultaneous users, with worked examples.

8 min readby inhausi

In short

The need for graphics memory is made up of two parts. The weights of the model need a fixed amount that depends on the number of parameters and on the quantisation. On top of that, every running conversation needs memory for its KV cache, which grows with the length of the context. Both together, with some reserve, give the number of graphics cards.

When someone asks how much VRAM they need for a particular model, the honest answer is that it depends. That sounds unsatisfying, but it is true, because the VRAM requirement is made up of two very different components that scale differently. The first is fixed and predictable. The second grows with every user and every token you process.

Anyone who understands both components can estimate their requirement to within a few gigabytes without having to guess.

The two components of the VRAM requirement

The total requirement is the model weights plus the KV cache plus a small buffer for the overhead of the framework.

Model weights are the learned parameters of the model. They are loaded into VRAM once and stay there for the whole running time. This component is static.

The KV cache is the working memory of the model during a conversation. For every token the model has already processed, it stores intermediate results so that it does not have to compute them again. This cache grows with the length of the conversation and with the number of simultaneous users.

Framework overhead is the memory the inference engine itself needs for the CUDA context, activations and internal buffers. As a rule of thumb it is roughly 10 to 20 per cent of the model weights.

In total that is model weights + KV cache + 10 to 20% overhead.

Working out the model weights

The formula is simple. You take the number of parameters in billions and multiply it by the bytes per parameter for the quantisation level.

FormatBytes per parameterExample: 70B model
BF16 / FP162.0 bytesapprox. 140 GB
Q8approx. 1.0 byteapprox. 70 GB
Q4_K_Mapprox. 0.5 bytesapprox. 35 GB

In practice the factor for Q4_K_M is closer to 0.55 to 0.60, because the compression is not applied evenly across all layers and some layers are quantised a little less aggressively than others. For a planning calculation, 0.5 bytes per parameter is still the right starting point.

Applied to models we deploy, MiniMax-M2.5 has 230 billion parameters and its Q4 file weighs 140 GB. That matches the calculation of 230B × 0.5 bytes × 1.2 overhead ≈ 138 GB. Kimi K2.5 with 1 trillion parameters comes to 621 GB in Q4, which is consistent as well.

One important point here is that with MoE models all expert layers have to sit in VRAM, even though only a fraction of them is active per token. This is a frequent misunderstanding. Anyone who thinks that an MoE model with 230 billion parameters in total and 10 billion active parameters needs only 10 billion parameters in memory is mistaken. Only the computing effort is smaller, not the memory requirement.

Working out the KV cache

This is where many plans go wrong. The KV cache is dynamic and grows in three dimensions at once, which are context length, number of users and model architecture.

The formula is:

KV cache = 2 × layers × KV heads × head dimension × context length × users × bytes per element

The "2" stands for key and value, the two matrices the model stores for every token. The architecture values (layers, KV heads, head dimension) are in the config.json of every model and on our model page.

To give you a feeling for the order of magnitude, we have already worked the values out as "KV per token", which is the memory per token and per user in kilobytes. Here is a comparison of models we deploy:

ModelKV per token10 users, 8K context20 users, 32K context
gpt-oss-120b72 KBapprox. 5.5 GBapprox. 44 GB
Qwen3.5-122B96 KBapprox. 7.5 GBapprox. 59 GB
MiniMax-M2.5248 KBapprox. 19 GBapprox. 155 GB
DeepSeek V3.231 KBapprox. 2.4 GBapprox. 19 GB
Kimi K2.531 KBapprox. 2.4 GBapprox. 19 GB
GLM-51,248 KBapprox. 96 GBapprox. 767 GB

The difference between these models is enormous, and the attention architecture explains it. Kimi K2.5 and DeepSeek V3.2 use Multi-Head Latent Attention (MLA), a technique that compresses the KV cache to about a tenth of its usual size. That is why these models have a very efficient VRAM footprint in operation despite their enormous total number of parameters. GLM-5, by contrast, has 64 KV heads with a head dimension of 64, which with 78 layers leads to a very large KV cache per token.

This has practical consequences. With an 8-GPU system and 768 GB of VRAM you can load Kimi K2.5 (621 GB of model weights) and still have around 140 GB for the KV cache. At 8K context that allows around 500 simultaneous users. With GLM-5 on the same system, the KV cache for 20 users and 32K context would already be larger than the space left over.

A worked example

Let us take a medium-sized company that wants to run MiniMax-M2.5 on 2 to 3 RTX PRO 6000 Blackwell cards. This configuration has 192 to 288 GB of VRAM.

MiniMax-M2.5 in Q4 needs 140 GB for the model weights. For framework overhead we allow 20 GB. That leaves 32 to 128 GB for the KV cache.

KV per token is 248 KB. At 8K context and 10 simultaneous users that gives:

248 KB × 8,000 × 10 = approx. 19 GB

That fits without any problem. Even with 20 users and 16K context (approx. 38 GB of KV cache) we stay within the limit with 3 cards. On this hardware the model reaches more than 100 tokens per second for a single request, which is faster than any cloud API under real conditions.

The example also shows that when you increase the context from 8K to 32K, the KV cache quadruples. That is the most frequent reason why a system that works with short conversations suddenly collapses under load. Anyone who wants to analyse long documents or keep conversations lasting several hours has to plan for the KV cache in advance, and not only when the server throws its first out-of-memory message.

What GQA and MLA mean

Older models use Multi-Head Attention (MHA), in which every query head has its own key and value head. That is hungry for memory. Newer models use Grouped Query Attention (GQA), in which several query heads share one KV head. Llama 3, for example, has 64 query heads but only 8 KV heads, so the cache shrinks to an eighth.

MLA goes further still and compresses the KV matrices into a latent space before they are stored. As a result Kimi K2.5 has only 31 KB per token despite 61 layers. That makes these models particularly attractive for deployments with many simultaneous users or long contexts.

As a rule of thumb, models with an MLA architecture (currently DeepSeek and Kimi) are considerably more efficient for workloads that are heavy on the KV cache than models with classic GQA. Anyone who wants to run a customer support bot with long conversation histories, for example, has a much easier time with Kimi K2.5 or DeepSeek V3.2 than with MiniMax-M2.5, even if the latter shows similar quality in other benchmarks.

How vLLM and SGLang change the requirement

The choice of inference engine affects the effective VRAM requirement, because it determines how efficiently the KV cache is managed.

llama.cpp reserves a predefined block of memory for every request, even if the user ends up writing only a short sentence. If the maximum context length is set to 32K, then 32K × KV per token is reserved for every active slot, whatever the actual use. That wastes 60 to 80 per cent of the reserved KV cache memory.

vLLM and SGLang solve this with PagedAttention and RadixAttention. The KV cache is divided into small pages that are allocated dynamically and released immediately once a request is finished. With this, vLLM wastes less than 4 per cent of the memory. In practice that means that with the same VRAM several times as many simultaneous users can be served as with llama.cpp at the same context lengths.

SGLang goes one step further and caches shared prefixes automatically. If 50 users send the same system prompt, the KV cache for this prefix is computed once and shared by all of them. For an internal company assistant with a constant system prompt this can reduce the effective KV cache requirement considerably.

For planning this means that the figures in the table above apply to naive operation without PagedAttention. With vLLM or SGLang you can in practice budget for 30 to 50 per cent less VRAM per user.

The formula in summary

For a first estimate without deep knowledge of the model, follow these steps.

Step 1: Estimate the model size in GB. For Q4 that is the number of parameters in billions × 0.5, for Q8 it is × 1.0.

Step 2: Add 15 to 20 per cent overhead.

Step 3: Add the KV cache. Take the value from the model page (KB per token) × context length in tokens × number of simultaneous users, then divide by 1,024 × 1,024 to get GB.

Step 4: With vLLM or SGLang you can deduct 30 to 40 per cent of the KV cache requirement.

The result is the minimum. In practice we recommend a buffer of 10 to 20 per cent on top, because models can become unstable under load when the VRAM budget is tight. One card more is better than a crash in the middle of the night.

For specific recommendations for your models and numbers of users, use our configurator or write to us at office@inhausi.at. We work it through for your use case free of charge.

Published on 5 April 2026. Models, prices and the legal situation change all the time. The current figures are in the model overview and in the configurator. All figures without guarantee.

Would you like to work this out for your company?

In a first call of half an hour we work out whether an AI machine of your own makes sense for you, how large it would have to be and what it costs. The call is free.

Or write to us at office@inhausi.at and call us on +43 650 37 50 530