Skip to main content
Watch: I Built an AI App Without Leaving Databricks

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 memory

Downloads

The official weights and every quantization listed for this model, with file sizes from Hugging Face.

Phi-4 downloads and file sizes
DownloadFormatSizeRepo
Official weightsBF1629.3 GBmicrosoft/phi-4
Q4_KGGUF9.1 GBmicrosoft/phi-4-gguf
Q8_0GGUF15.6 GBmicrosoft/phi-4-gguf
4bitSmallest listedMLX8.2 GBmlx-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.

Ollama

Terminal
ollama run phi4

Source: ollama.com/library/phi4

Not sure which runtime to use? Compare local LLM runtimes by platform, API and features.

License

License
MITmit
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.

Newsletter

New open weights, every week

One email per week. New model releases, open-weight drops and what they mean for what you build.