Can I run Llama 2 7B locally?
Llama 2 7B has 6.74 billion parameters (Hugging Face). At the popular Q4_K_M quantization it needs roughly 7.0 GB of GPU memory ESTIMATE. It has been on Hugging Face since 2023-07-13. This is an older model; see the current list for newer options.
Memory needed by quantization
| Quant | Weights | Total needed (est.) |
|---|---|---|
| IQ1_S | 1.3 GB | 4.1 GB |
| IQ2_XXS | 1.7 GB | 4.6 GB |
| IQ2_M | 2.3 GB | 5.1 GB |
| Q2_K | 2.7 GB | 5.6 GB |
| IQ3_XXS | 2.6 GB | 5.5 GB |
| Q3_K_S | 3.1 GB | 6.0 GB |
| IQ3_M | 3.1 GB | 6.0 GB |
| Q3_K_M | 3.4 GB | 6.3 GB |
| IQ4_XS | 3.6 GB | 6.5 GB |
| Q4_0 | 3.8 GB | 6.7 GB |
| Q4_K_M | 4.1 GB | 7.0 GB |
| MXFP4 | 3.9 GB | 6.8 GB |
| Q5_K_M | 4.8 GB | 7.8 GB |
| Q6_K | 5.5 GB | 8.5 GB |
| Q8_0 | 7.2 GB | 10.3 GB |
| F16 | 13.5 GB | 16.9 GB |
KV cache by context length ESTIMATE
| Context | f16 | q8_0 | q4_0 |
|---|---|---|---|
| 4k | 2.15 GB | 1.14 GB | 0.60 GB |
From config.json: 32 KV-caching attention layers, 32 KV heads × 128 head dim. Max context 4k. The tables above assume 4k context.
Which GPUs and Macs can run it?
✅ fits · ⚠️ fits with little headroom · ❌ doesn't fit on this one device (multiple GPUs or RAM offload may work; check your setup). Apple Silicon assumes macOS lets the GPU use ~67–75% of unified memory. All fit verdicts are estimates.
Get the weekly "new models & what it takes to run them" email
Free. One email a week. Unsubscribe anytime.