How much VRAM does Llama 3.1 70B need at Q4_K_M? Memory and GPU guide

By TechCompare · Updated · How we check

Q4_K_M is a common local-inference recipe for 70B-class models. It runs on two 3090s or one used A6000 at quality close to FP16. The catch is throughput: a single RTX 5090 with CPU offload still produces usable tokens per second, but slower than a fully resident multi-GPU setup.

Calculator

Estimated VRAM required

94.3 GB

70B params at Q4_K_M, 131,072 token context, batch 1, inference.

Weights
42.7 GB
KV cache
43.0 GB
Overhead
8.6 GB

Estimate accuracy: Weights within ~3% of most GGUF files from Q4_K_M up, ~7% for Q3_K_M and Q2_K. KV cache within ~5% for standard GQA models, ~10% for MLA or hybrid state estimates. Real VRAM may vary with framework (vLLM vs llama.cpp vs Transformers), Flash Attention, and driver overhead.

KV cache exceeds model weights: Consider lowering the context length to save on VRAM. Contexts between 8K and 64K are generally more typical for local setups.

Hardware that fits

Unified memory machines show a model budget, not their installed memory. We hold back 8 GB for the system, or use the vendor's GPU limit when that's lower. It's a planning estimate, not a hard limit.

RTX PRO 6000 96GB
Pro
96 GB
99% used
AMD Ryzen AI Max+ 395 128GB
Unified
~112 GB
85% of estimate
Apple M5 Max 128GB
Unified
~120 GB
79% of estimate

Multi-GPU setups

4× RTX 5090
Consumer · 24.4 GB per card
128 GB
76% used

Pooled cards show up once a model outgrows the biggest single card of that kind. Each card past the first keeps about 1 GB for its own buffers, and that's counted here. Your inference engine has to support the split, and speed also depends on how the cards connect.

Llama 3.1 70B at Q4_K_M (4-bit quantization, GGUF sweet spot) needs roughly 94.3 GB of VRAM with its native 128K context window. That puts it out of reach for consumer setups, but it fits on two 80 GB datacenter cards (160 GB in total), a high-end unified memory device, or split across pooled GPUs.

How this is calculated

Q4_K_M weights take up 43 GB. The KV cache adds another 43 GB at 128K context with FP16 KV. Overhead adds roughly 8.6 GB, totaling 94.3 GB.

Verdict

The FP16 cache covers 8 KV heads at head_dim 128 across 80 layers. The 94.3 GB total fits two 80 GB datacenter cards, a single 96 GB pro card, or a high-end unified-memory workstation (Mac Studio with 128 GB+).

On a single RTX 5090 (32 GB) the conversation is different: the KV cache alone exceeds the card, so partial CPU offload is mandatory and throughput drops while weights stream from system RAM. At 32K context the cache drops to 10.8 GB and the total falls to 58.8 GB, which fits a single 80 GB card with room.

More Llama scenarios

Kimi K3.1 Pro at Q4_K_M
A 2.78T expert pool with 24 latent attention layers and fixed state in the other 69.
View details
Mistral Large 4 at Q4_K_M
A 1T expert pool with 63 latent cache owners and 44 layers that also store an index key.
View details
Muse Spark Open at Q4_K_M
Only 16 of its 62 layers grow with context, and the other 46 hold a 2,048 token window.
View details

Frequently asked questions

Can I run Llama 3.1 70B on a single RTX 4090?
Not at Q4_K_M with native 128K context, the model needs roughly 94.3 GB total and a 4090 has 24 GB. Two 4090s with tensor parallelism only work at a short context, like 4K with a Q8 KV cache (47.8 GB), or you can drop to Q3_K_M (~41 GB) and use partial CPU offload at reduced context.
Does Llama 3.1 70B Q4_K_M lose quality vs FP16?
Quality loss is small, typically a 0.1 to 0.3 perplexity increase on standard benchmarks, and almost imperceptible on most chat or coding tasks. Q4_K_M is generally considered the best quality-to-size ratio for local inference.
How much VRAM does Llama 3.1 70B at Q4 actually need?
About 53 GB resident at the 16K context window: 42.7 GB of weights (~70B × 0.61 B/param at Q4) plus a 5.4 GB KV cache plus ~4.9 GB overhead. That's more than a single 48 GB pro GPU (like the RTX 6000 Ada or A6000) or two 24 GB cards hold, so at 16K you need a third 24 GB card, an 80 GB card or a shorter context.
Can tensor parallelism split Llama 3.1 70B across two 4090s?
Yes, with frameworks like vLLM or llama.cpp's multi-GPU mode. Two 24 GB RTX 4090s give you 48 GB of aggregate VRAM. That holds the 42.7 GB of Q4 weights, but only with a short context: 4K with a Q8 KV cache comes to 47.8 GB, while 8K needs 50.0 GB. The catch is interconnect: PCIe x16 between the cards is fine for inference, but NVLink-free pairs pay a synchronization tax that shows up as lower tokens per second than a single 48 GB card would deliver.