Microsoft

Phi 4

Generally availableOpen weights16K context

Summary

Phi 4 is an open-weight language model from Microsoft, released on 10 Jan 2025. It accepts text and generates text, with a 16K-token context window and up to 15K output tokens per response. As of 19 Nov 2026, the lowest listed API price is $0.07 per million input tokens and $0.14 per million output tokens (OpenRouter), across 1 provider we track.

[Microsoft Research](/microsoft) Phi-4 is designed to perform well in complex reasoning tasks and can operate efficiently in situations with limited memory or where quick responses are needed. At 14 billion...

Last verified 19 Nov 2026. Every figure on this page links to its source.

Specifications

DeveloperMicrosoft
Release date10 Jan 2025 [OpenRouter]
StatusGenerally available
WeightsOpen weights [Hugging Face]
Licensemit [Hugging Face]
Parameters14.7B [Hugging Face]
Context window16K (16,384 tokens) [OpenRouter]
Max output15K tokens [OpenRouter]
Knowledge cutoff30 Jun 2024 [OpenRouter]
InputText [OpenRouter]
OutputText [OpenRouter]
Reasoning modeNo [OpenRouter]
Tool callingNo [OpenRouter]
Structured outputYes [OpenRouter]
Hugging Facemicrosoft/phi-4 [Hugging Face]

Phi 4 API pricing by provider

USD per million tokens. Sorted by input price.

ProviderInputOutputCached inputContextSource
OpenRouter
microsoft/phi-4
$0.07$0.14–16KOpenRouter, 19 Nov 2026

Running Phi 4 locally

Estimated memory, from the parameter count and the architecture in config.json on Hugging Face. Includes about 0.8 GB of runtime overhead.

QuantizationWeightsTotal, 8K contextTotal, 32K context
Q4_K_M (4-bit)8.9 GB11 GB13 GB
Q8_0 (8-bit)16 GB18 GB20 GB
FP16 / BF16 (16-bit)29 GB32 GB33 GB

At 4-bit with an 8K conversation, Phi 4 needs about 11 GB, so it fits on a graphics card with 12 GB or more, such as the NVIDIA GeForce RTX 3060 12 GB. Check your own hardware, or see Best GPU for local LLMs on our sister site AIPCs.

Frequently asked questions

What is the context window of Phi 4?

Phi 4 has a context window of 16,384 tokens (16K) and can generate up to 14,745 tokens in a single response, according to OpenRouter.

How much does the Phi 4 API cost?

Phi 4 is listed from $0.07 per million input tokens and $0.14 per million output tokens (OpenRouter). Prices last verified 19 Nov 2026.

Is Phi 4 open source?

Phi 4 is an open-weight model: its weights are published on Hugging Face as microsoft/phi-4 under the mit license. Check the license terms before commercial use.

When was Phi 4 released?

Microsoft released Phi 4 on 10 Jan 2025, according to OpenRouter.

How much VRAM does Phi 4 need?

About 11 GB at 4-bit (Q4_K_M) with an 8K-token conversation, and about 18 GB at 8-bit. The 4-bit model fits on a graphics card with 12 GB or more, such as the NVIDIA GeForce RTX 3060 12 GB. These are estimates from the model's published parameter count and architecture.

Similar models from other labs

Comparable on output type, weights, release date, price and context window. Prices are the lowest listed, USD per million tokens.

ModelLabReleasedContextInput $/1MOutput $/1MWeights
Qwen2.5-Coder-32B-InstructAlibaba (Qwen)12 Nov 202433K$0.06$0.20Open
Mistral Small 3Mistral AI30 Jan 202533K$0.05$0.08Open
Qwen/Qwen2.5-7B-InstructAlibaba (Qwen)19 Sept 202433K$0.05$0.05Open
Reka Flash 3Rekaai10 Mar 202566K$0.10$0.20Open
Llama 3 8B LunarisSao10k13 Aug 20248K$0.04$0.05Open
Command R7BCohere13 Dec 2024128K$0.04$0.15Open

Change history

No changes detected since we started tracking this model. We re-check every source daily.

Sources