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.
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.
Multi-GPU setups
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
Related guides
Frequently asked questions
Can I run Llama 3.1 70B on a single RTX 4090?
Does Llama 3.1 70B Q4_K_M lose quality vs FP16?
How much VRAM does Llama 3.1 70B at Q4 actually need?
Can tensor parallelism split Llama 3.1 70B across two 4090s?
Related tools
RAM Latency Calculator
Convert DDR3/DDR4/DDR5 timings (CL, tRCD, tRP, tRAS) into true latency in nanoseconds.
Use toolPower Cost Estimator
Estimate annual electricity costs for your PC, Server, or TV.
Use toolData Transfer Calculator
Calculate file transfer time or the speed you need over USB, Wi-Fi or Ethernet, with latency.
Use toolMemory and Storage Throughput Visualizer
Visualize the large speed gap between CPU cache, RAM, and storage.
Use tool