How Much VRAM Do You Need to Run an LLM Locally?
Three things fill a GPU’s memory when a model runs: the weights, the cache that grows with every token of context, and the runtime itself. Each can be worked out before you download anything.
The short answer
Memory needed ≈ weights + KV cache + runtime overhead. For Llama 3.1 8B at the popular Q4_K_M quantisation with an 8K-token context, that is 4.2 GB + 1.0 GB + 0.8 GB = 6.0 GB, within reach of a card with 8 GB. Qwen2.5 32B at the same settings needs 20.0 GB, which fits a 24 GB card — the jump from small to mid-sized models is mostly a jump in memory.
1. The weights
A model is mostly a very large list of numbers. Llama 3.1 8B has 8.03 billion of them. The memory they take is the count multiplied by how many bits each one is stored in:
parameters × bits per weight ÷ 8 = bytes
At full 16-bit precision that is 15.0 GB. Quantisation stores the weights in fewer bits: Q4_K_M averages 4.5 bits per weight, bringing the same model down to 4.2 GB. The quality cost of 4- to 6-bit quantisation is small for most uses; below that it becomes noticeable.
| Quantisation | Bits/weight | Weights | Total |
|---|---|---|---|
| FP16 / BF16 | 16 | 15.0 GB | 16.8 GB |
| Q8_0 | 8.5 | 7.9 GB | 9.7 GB |
| Q6_K | 6.6 | 6.2 GB | 8.0 GB |
| Q5_K_M | 5.5 | 5.1 GB | 6.9 GB |
| Q4_K_M | 4.5 | 4.2 GB | 6.0 GB |
| Q3_K_M | 3.9 | 3.6 GB | 5.4 GB |
2. The KV cache, which grows with context
While it generates, a model keeps a key and a value vector for every token in the conversation, in every layer. That cache is what lets it “remember” the context, and it grows linearly with the number of tokens:
2 × layers × KV heads × head size × bytes per value × tokens
For Llama 3.1 8B that is 128 KB per token at 16-bit precision. At short contexts the cache is small; at long ones it can outgrow the weights:
- 4K tokens: cache 0.5 GB, total 5.5 GB
- 8K tokens: cache 1.0 GB, total 6.0 GB
- 32K tokens: cache 4.0 GB, total 9.0 GB
- 128K tokens: cache 16.0 GB, total 21.0 GB
Storing the cache in 8 bits instead of 16 halves it, with little measurable quality cost: at 128K tokens the total falls from 21.0 GB to 13.0 GB. Models that use grouped-query attention — most recent ones — have far fewer KV heads than attention heads, which is why their caches are much smaller than older designs of the same size.
3. Runtime overhead
The inference runtime needs working memory of its own for activations, buffers and the CUDA or Metal context. The calculators allow 0.8 GB. Separately, not all of a card’s memory is usable for the model: the display, the driver and other programs take a share, so the calculators count about 92% of a card’s memory as available — 14.7 GB of the 16 GB on an RTX 5070 Ti.
Fitting a bigger model on a smaller card
Qwen2.5 32B at Q4_K_M with an 8K context needs 20.0 GB. On a 24 GB RTX 4090, with 22.1 GB usable, that is a fit; the longest context that fits at those settings is 17K tokens. The levers, in order of how little they cost in quality:
- Shorten the context, or store the cache in 8 bits.
- Drop one quantisation step, for example from 5-bit to 4-bit.
- Offload some layers to system memory — it works, but generation slows sharply.
- Use a smaller model from the same family.
Mixture-of-experts models are a special case: only a few experts run per token, which makes them fast, but every expert still has to sit in memory. Size them on total parameters, not active ones.
Every model, and the smallest card it fits on
At Q4_K_M, an 8K-token context and a 16-bit cache, smallest first. The card is the one with the least memory, among the consumer cards the calculator covers (10 GB and up), that holds the model with room to spare; each links to what else that card can run. The smallest models also run on cards with less memory than any listed here.
| Model | Size | Memory | Smallest listed card |
|---|---|---|---|
| Llama 3.2 1B | 1.2B | 1.7 GB | RTX 3080 |
| Qwen2.5 3B | 3.1B | 2.7 GB | RTX 3080 |
| Llama 3.2 3B | 3.2B | 3.4 GB | RTX 3080 |
| Qwen2.5 7B | 7.6B | 5.2 GB | RTX 3080 |
| Qwen2.5 Coder 7B | 7.6B | 5.2 GB | RTX 3080 |
| Mistral 7B v0.3 | 7.2B | 5.6 GB | RTX 3080 |
| Llama 3.1 8B | 8.0B | 6.0 GB | RTX 3080 |
| Gemma 2 9B | 9.2B | 8.3 GB | RTX 3080 |
| DeepSeek-R1 Distill Qwen 14B | 14.8B | 10.0 GB | RTX 3060 12GB |
| Qwen2.5 14B | 14.8B | 10.0 GB | RTX 3060 12GB |
| Phi-4 | 14.7B | 10.0 GB | RTX 3060 12GB |
| Qwen3 30B-A3B | 30.5B | 17.5 GB | RTX 3090 |
| Gemma 2 27B | 27.2B | 17.9 GB | RTX 3090 |
| Qwen3 32B | 32.8B | 20.0 GB | RTX 3090 |
| Qwen2.5 32B | 32.8B | 20.0 GB | RTX 3090 |
| Qwen2.5 Coder 32B | 32.8B | 20.0 GB | RTX 3090 |
| Mixtral 8x7B | 46.7B | 26.3 GB | RTX 5090 |
| Llama 3.3 70B | 70.6B | 40.3 GB | more than one card |
| Qwen2.5 72B | 72.7B | 41.4 GB | more than one card |
| Qwen3 235B-A22B | 235.1B | 125.4 GB | more than one card |
What this leaves out
These are estimates from each model’s published architecture. Real usage varies by runtime and version, by batch size, and by features such as sliding-window attention, which some models use to cap their cache. Memory is also only half the question: a model that fits can still generate slowly if the card’s memory bandwidth is low, and one spread across system memory will be much slower than one held entirely on the card.
Calculators used in this guide
- Local LLM VRAM calculator
- Llama 3.1 8B VRAM requirements
- What LLMs run on an RTX 4090
- What LLMs run on an RTX 5070 Ti