Skip to main content
Vantaige
Phi screenshot

Microsoft's Phi family proves data quality beats scale. The Phi-4 generation (14B, MIT license) punches above its weight on math and reasoning, and runs on consumer hardware. Free to download, with paid hosted inference on Azure AI Foundry.

Features:APIOpen Source

Microsoft's Phi family is a series of small language models built on one core bet: that carefully curated synthetic training data can produce a model that outperforms rivals with far more parameters. Developed by Microsoft Research and released under the MIT license, Phi has grown from the 1.3B Phi-1 in 2023 to the Phi-4 generation, which as of early 2026 spans a 3.8B mini variant, a 5.6B multimodal model, a 14B flagship, and a 15B reasoning-vision model released in March 2026. All weights are freely available on Hugging Face under the microsoft org, and all carry the MIT license, meaning commercial use, fine-tuning, and redistribution are unrestricted. The lead researcher behind the early Phi bets, Sebastien Bubeck (formerly Microsoft's VP of generative AI research), left for OpenAI in October 2024, handing the baton to a team that has continued pushing the family forward.

The current lineup gives developers meaningful choices across hardware budgets. Phi-4 (14B) handles math, reasoning, and code on a consumer GPU with 8GB VRAM when quantized to 4-bit. Phi-4-mini (3.8B) supports a 128K context window and function calling, making it a legitimate edge deployment option. Phi-4-multimodal (5.6B) processes text, audio, and images, and topped the HuggingFace OpenASR leaderboard with a 6.14% word error rate as of February 2025. Phi-4-reasoning and Phi-4-reasoning-plus (both 14B) use supervised fine-tuning on reasoning traces generated by o3-mini, with the plus variant adding outcome-based reinforcement learning for longer, higher-accuracy chains. The newest member, Phi-4-reasoning-vision-15B (released March 4, 2026), extends multimodal reasoning to UI understanding and science problems. All are deployable via Ollama, Hugging Face Transformers, Azure AI Foundry, GitHub Models, and llama.cpp-compatible runtimes.

Phi at a glance, April 2026

The Phi-4 generation covers four main deployment targets:

  • Phi-4 (14B): Dense decoder-only Transformer. MIT license. 16K context. MMLU 84.8, GPQA 56.1, MATH 80.4, HumanEval 82.6. Trained on 9.8 trillion tokens including heavily synthetic math, coding, and reasoning data. Launched December 12, 2024 as a research preview on Azure AI Foundry; open-weighted under MIT in January 2025.

  • Phi-4-mini (3.8B): Grouped-query attention, 200K vocabulary, 128K context, function calling. Released February 26, 2025. The primary choice for edge and IoT deployments.

  • Phi-4-multimodal (5.6B): Text, audio, and image input; text output. ASR leader (6.14% WER). Released February 26, 2025.

  • Phi-4-reasoning / Phi-4-reasoning-plus (14B): Reasoning-chain models trained on o3-mini demonstrations. Released April/May 2025. Outperform DeepSeek-R1-Distill-Llama-70B on several reasoning benchmarks.

  • Phi-4-reasoning-vision-15B: 15B multimodal reasoning model. MIT license. Released March 4, 2026. Handles math, science, and UI understanding with vision input.

Phi-4's training ran 21 days on 1,920 H100-80G GPUs. Approximately 8% of training data is multilingual; the remainder is primarily English. Data cutoff is June 2024 for Phi-4 base; August 2024 for some later variants.

What Phi is actually good at

The synthetic data thesis pays off most visibly on structured tasks. Phi-4 (14B) scores 80.4 on the MATH benchmark and 82.6 on HumanEval, numbers that beat models two to five times its size. For developers running quantized models on consumer hardware, this is the core appeal: a model that fits in 8GB VRAM and handles real coding and math problems credibly.

"I've had great success with quantized Phi-4 12B and Ollama so far. It's as fast as Llama 3.1 8B but the results have been (subjectively) higher quality." - accrual, Hacker News, December 2024

The MIT license is a genuine differentiator. Where Gemma carries Google's Gemma License (with reporting requirements at scale) and Llama carries Meta's Llama License (commercial use permitted but with conditions for high-traffic deployments), Phi-4's MIT is the cleanest of the three for teams embedding models in commercial products without legal review overhead.

Phi-4-mini is arguably the most underrated model in the family. At 3.8B parameters with a 128K context window and reliable function calling, it fits the edge agent use case that Phi-4 base cannot serve (16K context is a hard limit for document-heavy tasks). Microsoft published a tutorial specifically on building AI agents on IoT devices with Phi-4-mini via Ollama, and the community reception was positive for that specific deployment pattern.

"These look quite incredible.. Phi-4 releases set it apart as the only competition below ~7B." - refulgentis, Hacker News, May 2025 (on Phi-4-reasoning models)

Where Phi breaks, the failure modes users keep hitting

The gap between benchmark scores and real-world instruction following is Phi's most persistent problem. It predates Phi-4 and has not been fully resolved. In a documented test from January 2025, a developer ran Phi-4 through 30 chess games where the model had to follow a constrained prompt. Phi-4 scored zero wins and zero draws, broke prompt rules after an average of 7.7 moves, generated nearly six times more tokens than Gemma 2 9B, and made ten times as many errors. The developer concluded: "My overall impression of small models that shine across evals is not that good when used in real life." This verbosity pattern extends to the reasoning models too. Simon Willison tested Phi-4-reasoning in May 2025 and noted it generated 56 sentences of reasoning in response to a simple "hi" greeting, a pattern he described as "a tendency to overthink."

The 16K context ceiling on the Phi-4 base model is a recurring complaint. A Hugging Face discussion thread titled "Limited Context Length - Yarn/Rope?" captures the frustration: at the time Phi-4 shipped with 16K, Llama 3.2 and Gemma 3 both offered 128K. Phi-4-mini later fixed this with 128K, but the flagship model's context remains limited relative to the competition. For any task involving long documents, codebases, or multi-turn context, this is a hard constraint.

Multilingual use is another sore spot. With approximately 8% multilingual training data, Phi-4 underperforms on non-English prompts. Users needing Chinese, Arabic, or other languages report needing fine-tuning or switching to Gemma 3, which covers 140 languages natively.

Finally, benchmark skepticism has followed the Phi family since Phi-3. Multiple community members have suggested the models show signs of benchmark data contamination. Microsoft addressed this directly in the Phi-4 technical report, describing improved data decontamination procedures, but the perception persists among some evaluators. One HN commenter noted plainly in December 2024: "the Phi models always have great benchmark scores, but they always disappoint me in real-world use cases."

Phi vs. Llama 3.2 vs. Gemma 3

Phi-4 (14B, MIT) is a dense decoder-only Transformer trained primarily on synthetic English data. Its core advantage is math and reasoning performance per parameter. Its core limitations are the 16K context on the base model and minimal multilingual training.

Llama 3.2 (Meta, Llama License) ships in 1B, 3B text-only and 11B, 90B multimodal variants. The key mechanical difference is context: Llama 3.2 supports 128K tokens versus Phi-4's 16K. Llama 3.2 uses grouped-query attention (GQA) that reduces KV cache memory to 1/8 of traditional architectures. The downstream ecosystem is unmatched: llama.cpp, vLLM, Ollama, TGI, and every major inference runtime support Llama natively. On MMLU, Llama 3.2 3B sits around 61.8% versus Phi-4's 84.8% at 14B, but Llama 3.3 70B outpaces Phi-4 on general tasks when parameter budget is not a constraint.

Gemma 3 (Google DeepMind, Gemma License) is distilled from Google's Gemini architecture and uses a "thin and deep" design versus Llama's "wide and shallow" approach. Gemma 3 ships in 1B, 4B, 12B, and 27B variants, all with 128K context. The 4B+ variants include native image input, which Phi-4-mini lacks entirely (only the separate Phi-4-multimodal model handles vision). Gemma 3 covers 140 languages versus Phi-4's primarily English corpus. The license is not MIT: Gemma's terms require reporting requirements for deployments exceeding 700M MAU and include additional conditions absent from MIT. For most teams this is a non-issue, but for legal simplicity at scale, Phi-4's MIT wins.

The practical summary: if context length matters (document RAG, long conversations), pick Llama 3.2 or Gemma 3. If multilingual matters, pick Gemma 3. If MIT licensing purity matters and math/reasoning on a small footprint is the goal, Phi-4 is the strongest option.

Is the paid tier worth it?

There is no paid subscription for Phi. The models are free to download and run. Hosted inference on Azure AI Foundry is pay-per-token with no minimum commitment:

  • Phi-4-mini (hosted): $0.000075/1K input tokens, $0.0003/1K output tokens. The most affordable option in the family.

  • Phi-4 (hosted): $0.000125/1K input tokens, $0.0005/1K output tokens.

  • Phi-4-multimodal (text/image): $0.00008/1K input, $0.00032/1K output.

  • Phi-4-multimodal (audio): $0.004/1K input, $0.00032/1K output.

  • Fine-tuning: $0.003/1K training tokens. Hosting of fine-tuned models: $0.80/hr.

For teams that self-host, the cost is zero beyond infrastructure. A quantized 4-bit Phi-4 (14B) runs on a single consumer GPU with 8GB VRAM. For teams that want managed inference without managing GPU capacity, Azure's per-token rates are among the lowest in the market for models in this capability class. The decision is straightforward: self-host for free if you have the hardware and engineering capacity; use Azure for managed simplicity at a very low cost.

Best use cases (and when to skip it)

Phi is well suited to:

  • Edge and IoT agent deployments: Phi-4-mini at 3.8B with 128K context and function calling is built for this. Microsoft has published a dedicated tutorial for Ollama-based edge agents.

  • Math and structured reasoning: MATH benchmark of 80.4 at 14B is the headline number. For tutoring systems, coding assistants with math reasoning, and scientific Q&A in English, Phi-4 is the strongest small-model option.

  • Privacy-first or air-gapped deployments: MIT license, no telemetry requirements, runs fully locally. Teams in regulated industries (healthcare, finance) who cannot send data to cloud APIs have a usable path here.

  • Research and fine-tuning: The transparent training methodology (documented in Microsoft Research technical reports) and MIT license make Phi a natural starting point for academic and commercial fine-tuning projects.

Skip Phi when:

  • You need to process long documents, codebases, or multi-turn conversations exceeding 16K tokens on the base model (use Gemma 3 or Llama 3.2 with 128K context).

  • Your users or content are primarily non-English (Gemma 3's 140-language coverage is much broader).

  • You are building a production agentic pipeline where strict, concise instruction following is essential. The verbosity and occasional instruction-adherence failures documented by community testers are a real risk in complex agent loops.

  • You want the broadest inference engine support and largest community of fine-tuned derivatives (Llama wins here by a wide margin).

Getting started with Phi

The fastest path is Ollama: ollama pull phi4 for the 14B base model, or ollama pull phi4-mini for the 3.8B variant, both available without an account. For Hugging Face, the microsoft/phi-4 and microsoft/Phi-4-mini-instruct repositories include model cards and transformers pipeline examples. Models use ChatML-format tokens. For Azure AI Foundry, find any Phi-4 variant in the Model Catalog and deploy via managed pay-per-token inference with no GPU provisioning required.

User Reviews

No reviews yet. Be the first to share your experience!

Sign in to write a review.

Featured in collections

Curated lists that include Phi.

Related articles

Guides and articles related to Phi.