Skip to content

Try local GPU's before you buy them at Vast.ai

Vast.ai

The local AI publication

Microsoft · Released December 2024

Phi-4

What it takes to run Phi-4 locally: memory by quantization, the GPUs that handle it, and how fast it runs.

Updated

Parameters
14.7B
Architecture
Dense
Context
16K tokens
License
MIT license
Memory at Q4_K_M
~12GB

What do you need to run Phi-4?

Phi-4 needs about 12GB of VRAM at Q4_K_M with 8K context (9.1GB for the weights plus KV cache and overhead). The smallest GPU that runs it comfortably at Q3_K_M is a 12GB card like the RTX 3060 12GB.

See the full hardware guide for Phi-4

What to buy

GPUs for Phi-4

Full hardware guide

Cheapest that runs it

RTX 3060 12GB

12GB · ~$270 used

Quant
Q3_K_M
Speed (est.)
~34 tok/s
Runs well

Fastest

RTX 5090

32GB · ~$4,300

Quant
Q8_0
Speed (est.)
~84 tok/s
Runs well

Unified memory

Ryzen AI Max+ 395

128GB unified · ~$3,300

Quant
Q8_0
Speed (est.)
~12 tok/s
Runs well

Speeds are estimates at the quantization shown with 8K context. We may earn a commission when you buy through these links. Learn more.

Memory

Phi-4 VRAM requirements by quantization

Lower-bit quantizations shrink the model at some cost to quality. Q4_K_M is the usual sweet spot. Totals include the KV cache for the context length shown plus runtime overhead.

Memory needed for Phi-4 at each quantization level
QuantizationQualityWeightsTotal @ 8K ctx
Q2_KRough5.6 GB8.0 GB
Q3_K_MUsable7.3 GB9.8 GB
Q4_K_MRecommendedDefault9.1 GB12 GB
Q5_K_MVery good11 GB13 GB
Q6_KNear-lossless12 GB15 GB
Q8_0Practically lossless16 GB18 GB
BF16Full precision29 GB32 GB

KV cache note: 2 x 40 layers x 10 KV heads x 128 dims x 2 bytes = 204,800 bytes (200 KiB) per token, about 1.7GB at 8K and 3.4GB at the full 16K context.

Performance

How fast Phi-4 runs

All GPUs

Single-user generation speed at 8K context on popular GPUs that fit the model entirely in memory, at the best quantization each can hold. Measured values require the exact hardware, model, and quantization at that context; other rows use estimates.

  1. RTX 5090

    Q8_0 · 32GB · 8K context

    ~84tok/s

  2. RTX PRO 6000

    Q8_0 · 96GB · 8K context

    ~84tok/s

  3. RTX 5070

    Q3_K_M · 12GB · 8K context

    ~69tok/s

  4. RTX 5080

    Q5_K_M · 16GB · 8K context

    ~67tok/s

  5. RTX PRO 5000 72GB

    Q8_0 · 72GB · 8K context

    ~65tok/s

  6. RTX 5070 Ti

    Q5_K_M · 16GB · 8K context

    ~63tok/s

  7. RTX 4080 Super

    Q5_K_M · 16GB · 8K context

    ~52tok/s

  8. RTX 4090

    Q8_0 · 24GB · 8K context

    ~49tok/s

  9. RTX 4070 Ti Super

    Q5_K_M · 16GB · 8K context

    ~48tok/s

  10. RTX 6000 Ada

    Q8_0 · 48GB · 8K context

    ~47tok/s

Estimated (method)

Overview

About Phi-4

Phi-4 is Microsoft's 14B dense model, trained heavily on synthetic data to punch above its size on math and reasoning. Microsoft has not released a Phi-5, so it remains the current base model of the Phi line, alongside reasoning-tuned variants such as Phi-4-reasoning. At Q4_K_M it needs about 12GB with 8K context, which is tight on a 12GB card and comfortable on 16GB. Its 16K context limit and narrow knowledge make Qwen3.5 9B or gpt-oss-20b better general picks in 2026.

Strengths

  • +Strong math and logic for a 14B non-reasoning model
  • +Dense and simple to run in every runtime
  • +MIT license

Weaknesses

  • −16K context window
  • −Narrow world knowledge and weak creative writing
  • −Text only, with no reasoning mode in the base model
  • −Outclassed by smaller 2026 models such as Qwen3.5 9B
ReasoningMathCodingChat

Setup

How to run Phi-4

Ollama
$ ollama run phi4:14b
llama.cpp
$ llama-server -hf bartowski/phi-4-GGUF:Q4_K_M -c 8192 -ngl 99
MLX (Mac)
$ mlx_lm.chat --model mlx-community/phi-4-4bit

Weights: microsoft/phi-4 · GGUF: bartowski/phi-4-GGUF

Alternatives

All models

Frequently asked questions

How much VRAM do you need to run Phi-4?

About 12GB at Q4_K_M with 8K tokens of context: 9.1GB of weights, 1.7GB of KV cache, and 0.9GB of runtime overhead. Higher-precision quants and longer contexts need more; see the table above.

What is the cheapest GPU that can run Phi-4?

The smallest card in our database that runs it comfortably is the RTX 3060 12GB (12GB), at Q3_K_M and ~34 tokens/sec.

Is Phi-4 free for commercial use?

Phi-4 is released under the MIT license. That is a permissive license, so commercial use is allowed.

How long a context does Phi-4 support?

Up to 16,384 tokens (16K). Long contexts need a lot of extra memory for the KV cache, so most local setups run 8K to 32K.

Sources: Phi-4 model card (Hugging Face), Phi-4 technical report. Capability score basis: Placed between the Llama 3.1 8B and Qwen3 32B anchors from its Artificial Analysis Intelligence Index v3 standing (October 2025).