phi-2 GGUF size and VRAM requirements
TheBloke/phi-2-GGUF is a mid-size language model with 2.78 billion parameters, built on the phi2 architecture. It is released under the other license and has been downloaded 22,411 times.
To run TheBloke/phi-2-GGUF locally at a 4,096-token context, its quantized versions need between 3.14 GB (Q2_K, lowest quality) and 4.8 GB (Q8_0, highest quality) of memory, weights plus KV cache and a system margin included.
For most users the best balance is Q8_0, needing about 4.8 GB. That means TheBloke/phi-2-GGUF fits entirely in the VRAM of a 6 GB GPU or larger, running fully on the GPU.
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 | Quality | Weights | KV | Total | Speed~ | Verdict |
|---|---|---|---|---|---|---|---|
| Q2_K | 3.38 | Fair | 1.09 GB | 1.25 GB | 3.14 GB | 366.0 t/s | Fits in VRAM |
| Q3_K_S | 3.6 | Fair | 1.16 GB | 1.25 GB | 3.21 GB | 343.4 t/s | Fits in VRAM |
| Q3_K_M | 4.26 | Good | 1.38 GB | 1.25 GB | 3.43 GB | 290.2 t/s | Fits in VRAM |
| Q4_0 | 4.61 | Good | 1.49 GB | 1.25 GB | 3.54 GB | 268.0 t/s | Fits in VRAM |
| Q3_K_L | 4.62 | Good | 1.49 GB | 1.25 GB | 3.54 GB | 267.6 t/s | Fits in VRAM |
| Q4_K_S | 4.65 | Good | 1.5 GB | 1.25 GB | 3.55 GB | 265.8 t/s | Fits in VRAM |
| Q4_K_M | 5.15 | Very good | 1.67 GB | 1.25 GB | 3.72 GB | 240.0 t/s | Fits in VRAM |
| Q5_0 | 5.56 | Very good | 1.8 GB | 1.25 GB | 3.85 GB | 222.1 t/s | Fits in VRAM |
| Q5_K_S | 5.56 | Very good | 1.8 GB | 1.25 GB | 3.85 GB | 222.1 t/s | Fits in VRAM |
| Q5_K_M | 5.97 | Very good | 1.93 GB | 1.25 GB | 3.98 GB | 207.2 t/s | Fits in VRAM |
| Q6_K | 6.58 | Excellent | 2.13 GB | 1.25 GB | 4.18 GB | 188.0 t/s | Fits in VRAM |
| Q8_0 | 8.51 | Excellent | 2.75 GB | 1.25 GB | 4.8 GB | 145.2 t/s | Fits in VRAM |
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/phi-2-GGUF?
You need about 4.8 GB of VRAM to run TheBloke/phi-2-GGUF entirely on the GPU using the Q8_0 quantization (at a 4,096-token context). Smaller quantizations lower the requirement at the cost of quality.
Can I run TheBloke/phi-2-GGUF on an 8 GB GPU?
Yes. With 8 GB of VRAM you can run TheBloke/phi-2-GGUF fully on the GPU using Q8_0 (about 4.8 GB).
Can I run TheBloke/phi-2-GGUF on a 16 GB GPU?
Yes. With 16 GB of VRAM you can run TheBloke/phi-2-GGUF fully on the GPU using Q8_0 (about 4.8 GB).
Can I run TheBloke/phi-2-GGUF on a 24 GB GPU?
Yes. With 24 GB of VRAM you can run TheBloke/phi-2-GGUF fully on the GPU using Q8_0 (about 4.8 GB).
What is the best quantization for TheBloke/phi-2-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.