Microsoft - Dense - verified
Run Phi-4 locally
Phi-4 is a 14.7B dense model from Microsoft with a 16K-token context window, released under MIT (commercial use is allowed); the smallest listed download is 8.2 GB, the 4bit MLX build from mlx-community/phi-4-4bit.
Official weights: microsoft/phi-4
- Total params
- 14.7B
- Architecture
- Dense
- Context
- 16K
- Smallest download
- 8.2 GB
Fits in
Smallest download at most 85% of memoryDownloads
The official weights and every quantization listed for this model, with file sizes from Hugging Face.
| Download | Format | Size | Repo |
|---|---|---|---|
Official weights | BF16 | 29.3 GB | microsoft/phi-4 |
Q4_K | GGUF | 9.1 GB | microsoft/phi-4-gguf |
Q8_0 | GGUF | 15.6 GB | microsoft/phi-4-gguf |
4bitSmallest listed | MLX | 8.2 GB | mlx-community/phi-4-4bit |
GB is decimal: 1 GB = 10^9 bytes. Add memory for the context and the operating system on top of the file size.
Run it
Copied verbatim from the page linked under each command. Server commands from model cards often assume a multi-GPU node; check the flags before you run them.
Not sure which runtime to use? Compare local LLM runtimes by platform, API and features.
License
- License
- MIT
mit - Commercial use
- Commercial use: YesCommercial use is allowed.
- Gated download
- No. The files download directly.
Worth knowing
Microsoft publishes its own GGUF builds in microsoft/phi-4-gguf, and the card states a 16K token context.
Released (per the model card).
FAQ
How big is the Phi-4 download?
The official BF16 weights in microsoft/phi-4 are 29.3 GB. The smallest listed download is 8.2 GB, the 4bit MLX build from mlx-community/phi-4-4bit. Plan for more memory than the file size: the context (KV cache) and the operating system need room too.
Can I use Phi-4 commercially?
Phi-4 is released under MIT, and commercial use is allowed. The license text is at https://huggingface.co/microsoft/phi-4/blob/main/LICENSE.
How much memory do I need for Phi-4?
By this directory's rule of thumb it fits in 16 GB and up: the smallest listed download, 8.2 GB, is at most 85% of 16 GB, which leaves room for the context and the operating system.
How do I run Phi-4 with Ollama?
Run "ollama run phi4", as shown at https://ollama.com/library/phi4. The Ollama library lists the phi4:14b tag at 9.1GB.
What is the context length of Phi-4?
16,384 tokens. A longer context needs more memory for the KV cache, so you can run with a shorter one when memory is tight.
Sources
Last verified from the pages below.
- HF API - huggingface.co
- HF file tree - huggingface.co
- Model card - huggingface.co
- Vendor GGUF tree - huggingface.co
- Ollama phi4 - ollama.com
Newsletter
New open weights, every week
One email per week. New model releases, open-weight drops and what they mean for what you build.
Keep exploring
Best local AI models
Our curated picks by hardware tier, with benchmarks and the reasoning.
Model API pricing and specs
First-party prices per 1M tokens when you would rather call an API.
AI benchmark leaderboards
Sourced scores, for when you need to compare quality.
Setup guides
Point your coding tools at the model you picked.