Llama-2-7B GGUF size and VRAM requirements

License: llama2 ⬇ 20,700 ❤ 209
Parameters6.74B
Context4,096

TheBloke/Llama-2-7B-GGUF is a mid-size language model with 6.74 billion parameters, built on the llama architecture. It is released under the llama2 license and has been downloaded 20,700 times.

To run TheBloke/Llama-2-7B-GGUF locally at a 4,096-token context, its quantized versions need between 5.43 GB (Q2_K, lowest quality) and 9.47 GB (Q8_0, highest quality) of memory, weights plus KV cache and a system margin included.

For most users the best balance is Q6_K, needing about 7.95 GB. That means TheBloke/Llama-2-7B-GGUF fits entirely in the VRAM of a 6 GB GPU or larger, running fully on the GPU.

→ Guide: How much VRAM do you need?

GGUF file size and memory by quantization

Compare real GGUF weight sizes, estimated KV cache and total memory for Q4, Q5, Q8 and every quantization published in this repository.

Quant.Bits QualityWeights KVTotal Speed~Verdict
Q2_K 3.36 Fair 2.63 GB 2.0 GB 5.43 GB 152.0 t/s Fits in VRAM
Q3_K_S 3.5 Fair 2.75 GB 2.0 GB 5.55 GB 145.7 t/s Fits in VRAM
Q3_K_M 3.92 Fair 3.07 GB 2.0 GB 5.87 GB 130.2 t/s Fits in VRAM
Q3_K_L 4.27 Good 3.35 GB 2.0 GB 6.15 GB 119.4 t/s Fits in VRAM
Q4_0 4.54 Good 3.56 GB 2.0 GB 6.36 GB 112.3 t/s Fits in VRAM
Q4_K_S 4.58 Good 3.59 GB 2.0 GB 6.39 GB 111.4 t/s Fits in VRAM
Q4_K_M 4.85 Good 3.8 GB 2.0 GB 6.6 GB 105.2 t/s Fits in VRAM
Q5_0 5.52 Very good 4.33 GB 2.0 GB 7.13 GB 92.3 t/s Fits in VRAM
Q5_K_S 5.52 Very good 4.33 GB 2.0 GB 7.13 GB 92.3 t/s Fits in VRAM
Q5_K_M 5.68 Very good 4.45 GB 2.0 GB 7.25 GB 89.8 t/s Fits in VRAM
Q6_K 6.56 Excellent 5.15 GB 2.0 GB 7.95 GB 77.7 t/s Fits in VRAM
Q8_0 8.5 Excellent 6.67 GB 2.0 GB 9.47 GB 7.5 t/s Offload

KV cache computed from the model's exact architecture. Speed is a rough estimate bounded by memory bandwidth.

Frequently asked questions

How much VRAM do you need to run TheBloke/Llama-2-7B-GGUF?

You need about 5.87 GB of VRAM to run TheBloke/Llama-2-7B-GGUF entirely on the GPU using the Q3_K_M quantization (at a 4,096-token context). Smaller quantizations lower the requirement at the cost of quality.

Can I run TheBloke/Llama-2-7B-GGUF on an 8 GB GPU?

Yes. With 8 GB of VRAM you can run TheBloke/Llama-2-7B-GGUF fully on the GPU using Q6_K (about 7.95 GB).

Can I run TheBloke/Llama-2-7B-GGUF on a 16 GB GPU?

Yes. With 16 GB of VRAM you can run TheBloke/Llama-2-7B-GGUF fully on the GPU using Q8_0 (about 9.47 GB).

Can I run TheBloke/Llama-2-7B-GGUF on a 24 GB GPU?

Yes. With 24 GB of VRAM you can run TheBloke/Llama-2-7B-GGUF fully on the GPU using Q8_0 (about 9.47 GB).

What is the best quantization for TheBloke/Llama-2-7B-GGUF?

If memory allows, higher bits-per-weight means better quality. A common sweet spot is a Q4_K_M or Q5_K_M quantization, which keeps most of the quality while roughly halving the memory versus 8-bit. Pick the highest quantization that still fits in your VRAM.