On-prem models / Microsoft

Run Phi-4 on-prem

Microsoft's 14B dense model trained heavily on synthetic textbook-style data plus filtered web and academic sources. It targets reasoning, math and coding in a small footprint, primarily in English.

14B dense16K contextMITtextreleased 2024-12

Memory needed

PrecisionWeightsKV per request, 8K
BF16 (full precision)28.0 GB1.68 GB
FP814.0 GB0.84 GB
INT4 (AWQ / GPTQ)7.84 GB0.84 GB
GGUF Q4_K_M8.40 GB0.84 GB

KV cache from the published config: 40 layers, 10 KV heads x 128 dims. 16-bit cache for BF16 rows, 8-bit otherwise.

Fit for ERP and manufacturing work

Fits narrow English-language tasks such as classification, short extraction from text or fine-tuned SQL generation for a fixed schema. The 16K context and lack of tool calling limit agentic ERP use.

Strengths

  • Strong math and logic for 14B
  • MIT licence
  • Runs on a single 16GB to 24GB GPU when quantized
  • Small, simple dense architecture supported everywhere

Watch out for

  • Only 16K context
  • Multilingual data is about 8 percent of training, so non-English quality is limited
  • No native tool-calling format in the base release
  • Code training focused on common Python packages

GPUs that run it

One user, 8K context, FP8

HardwareCountMemory usedTok/s per user
NVIDIA L4 24GB117 / 21 GB12
NVIDIA A10 24GB117 / 21 GB24
NVIDIA GeForce RTX 4090 24GB117 / 21 GB39
NVIDIA GeForce RTX 5090 32GB117 / 28 GB67
NVIDIA A100 40GB PCIe117 / 36 GB59
NVIDIA L40S 48GB117 / 43 GB34
NVIDIA RTX A6000 48GB117 / 43 GB30
NVIDIA RTX 6000 Ada 48GB117 / 43 GB38

20 people at once, 16K context, FP8

HardwareCountMemory usedTok/s per user
NVIDIA GeForce RTX 5090 32GB251 / 57 GB54
AMD Instinct MI210 64GB150 / 57 GB29
NVIDIA A100 40GB PCIe251 / 72 GB48
NVIDIA A100 80GB PCIe150 / 72 GB35
NVIDIA A100 80GB SXM150 / 72 GB37
NVIDIA H100 PCIe 80GB150 / 72 GB36
NVIDIA H100 SXM 80GB150 / 72 GB59
NVIDIA H100 NVL 94GB150 / 84 GB67

Serving and licence

vLLM, SGLang, TensorRT-LLM, llama.cpp and Ollama (phi4) support it.

MIT. MIT permits commercial use, modification and redistribution with no restrictions beyond the notice.

Model card on Hugging Face

Design a Phi-4 deployment

Preloaded with Phi-4. Add your ERP and documents, change GPUs or users, and export the diagram.

Loading the architecture builder...

Questions

How much VRAM does Phi-4 need?

The weights alone take about 28.0 GB in BF16, 14.0 GB in FP8 and 7.84 GB in 4-bit. On top of that each request holds a KV cache of about 0.84 GB at 8K tokens of context (FP8 cache), so 20 people generating at once need roughly 16.8 GB more, plus a few GB of runtime overhead.

What is the smallest GPU setup that runs Phi-4?

For a single user at 8K context in FP8, 1 x NVIDIA L4 24GB (24 GB each) fits, at an estimated 12 tokens per second. For a team, size for concurrent requests and context; the builder above does that.

Is Phi-4 allowed for commercial use?

Phi-4 is released under MIT. MIT permits commercial use, modification and redistribution with no restrictions beyond the notice. Check the licence text on the model card with your legal team before production use.

Which engine should serve Phi-4 on-prem?

vLLM, SGLang, TensorRT-LLM, llama.cpp and Ollama (phi4) support it.