Phi-4-reasoning VRAM & Memory Requirements
Specific checkpoints with sourced architecture and weight files. GGUF Q4_K_M (Unsloth): 10.12 GiB–10.77 GiB at 8,192 tokens, 1 sequence, FP16 KV, llama.cpp.
This result is an estimate, not a measured trace.Not verifiedFile-backed weights
Publisher and provenance
- PublisherMicrosoft
- Hugging Face
microsoft/Phi-4-reasoning - Revision
1de18ec97600877ce63dbf60c73b998da99f0195 - Total parameters14,659,507,200
- Layers40
- Query heads40
- KV heads10 (gqa)
- Head dimension128
- Recorded context capability32,768
- Completenesscomplete · full
Memory layers in this estimate
Artifact bytes, raw KV, engine extras, and total demand are separate. This is not a runtime trace.
- Weight artifact
- 8.43 GiB (9,053,117,728 bytes)
- Raw KV cache
- 1.56 GiB (1,677,721,600 bytes)
- Engine extras / workspace
- 0.13 GiB–0.78 GiB
- Total estimated demand
- 10.12 GiB–10.77 GiB
Published artifacts
| Quantization | Selected files | Bytes | Engine | Evidence |
|---|---|---|---|---|
| BF16 safetensors bf16 | 29,319,014,400 (27.31 GiB / 29.32 GB) | vllm, sglang, unspecified | file-metadata | |
| GGUF Q4_K_M (Unsloth) gguf-q4_k_m | phi-4-reasoning-Q4_K_M.gguf | 9,053,117,728 (8.43 GiB / 9.05 GB) | llama.cpp, ollama, unspecified | file-metadata |
| GGUF Q5_K_M (Unsloth) gguf-q5_k_m | phi-4-reasoning-Q5_K_M.gguf | 10,604,191,008 (9.88 GiB / 10.60 GB) | llama.cpp, ollama, unspecified | file-metadata |
| GGUF Q6_K (Unsloth) gguf-q6_k | phi-4-reasoning-Q6_K.gguf | 12,030,254,368 (11.20 GiB / 12.03 GB) | llama.cpp, ollama, unspecified | file-metadata |
| GGUF Q8_0 (Unsloth) gguf-q8_0 | phi-4-reasoning-Q8_0.gguf | 15,580,503,328 (14.51 GiB / 15.58 GB) | llama.cpp, ollama, unspecified | file-metadata |
| INT4 theoretical | No published file | 7,329,753,600 (theoretical) | — | theoretical |
Memory by quantization and context
Concurrent sequences = 1. KV defaults to FP16. The range includes documented runtime extras for the listed engine. These figures use the same core as the interactive calculator.
| Quantization | 2,048 tokens | 8,192 tokens | 32,768 tokens |
|---|---|---|---|
| BF16 safetensors | 28.32 GiB–30.21 GiB | 29.49 GiB–31.41 GiB | 34.18 GiB–36.24 GiB |
| GGUF Q4_K_M (Unsloth) | 8.95 GiB–9.50 GiB | 10.12 GiB–10.77 GiB | 14.81 GiB–15.79 GiB |
| GGUF Q5_K_M (Unsloth) | 10.39 GiB–10.97 GiB | 11.56 GiB–12.25 GiB | 16.25 GiB–17.26 GiB |
| GGUF Q6_K (Unsloth) | 11.72 GiB–12.33 GiB | 12.89 GiB–13.60 GiB | 17.58 GiB–18.62 GiB |
| GGUF Q8_0 (Unsloth) | 15.03 GiB–15.70 GiB | 16.20 GiB–16.97 GiB | 20.89 GiB–21.99 GiB |
| INT4 theoretical Theoretical rows are not downloadable artifacts. | 7.34 GiB–9.83 GiB | 8.51 GiB–11.29 GiB | 13.20 GiB–17.06 GiB |
Raw KV contribution
Standard GQA/MHA raw KV is 2 × layers × kvHeads × headDim × tokens × sequences × bytes per element. This page uses KV heads (10), not query heads (40). Using query heads would overstate this cache by 4×.
- 8,192 tokens, 1 sequence, FP16: 1,677,721,600 bytes (1.5625 GiB)
- 32,768 tokens: 6,710,886,400 bytes (6.2500 GiB)
Related pages
Sources
- Phi-4-reasoning model card
- config.json — revision 1de18ec97600877ce63dbf60c73b998da99f0195
- safetensors index — metadata.total_size=29319014400
- Artifact repo unsloth/Phi-4-reasoning-GGUF
Assumptions that affect this result
- Requested context is within the recorded native window of 32768 tokens.
- Full-resident weight estimates use total parameters, including inactive MoE experts.
- Weight bytes come from the selected weight files only, not from every file in the repository.
- Download file size is not peak GPU memory. Runtime layout, allocator padding, and KV are extra.
- Counted files: phi-4-reasoning-Q4_K_M.gguf.
- Context budget is the number of cached tokens per sequence (prompt plus reserved generation).
- Concurrent sequences share one model replica; weights are not multiplied by sequence count.
- KV dtype is independent of weight quantization unless you change it.
Calculator
Loading catalog snapshot…
Search or pick a catalog checkpoint to see memory demand.
Search or pick a catalog checkpoint to see memory demand.