Phi-4 review, pricing and limits

Microsoft's 14B MIT-licensed instruct model that tops GPT-4o on two science and math benchmarks per Microsoft's own table, built for cost-efficient STEM reasoning where prompts stay short.

  • ga
  • open source
  • instruct
  • Phi-4 family
Visit website

Pick Phi-4 for cheap, self-hostable STEM reasoning where prompts stay short. Azure lists it at $0.125 in and $0.50 out per million tokens, and Ollama's build is a 9.1 GB download. Skip it for coding, factual recall, long documents or non-English work, where the card's own table favors larger models.

What changed

  • · New feature Phi-4-Reasoning Variant Released with Chain-of-Thought (phi-4-reasoning-20250430) source
  • · Release Phi-4 Publicly Available on Hugging Face Under MIT License (phi-4-14b-instruct-hf-20250109) source
  • · Release Phi-4 Released on Azure AI Foundry (phi-4-14b-instruct-20241212) source

All changes across Hokai this week

Phi-4 is Microsoft's 14-billion-parameter dense language model, released December 12, 2024 under the MIT license. Microsoft's model card reports 56.1 on GPQA and 80.4 on MATH, both ahead of GPT-4o in the same table, with a 16K-token context window and text-only input and output.

Where it sits

  • $0.219/M$ per 1M tokensBlended price (3:1)Lower is better#17 / 92peer median $1.70/Mvendor price, checked by Hokai
  • 40 tok/stokens/sOutput speedHigher is better#48 / 53peer median 92 tok/scited: Artificial Analysis
  • 56.1%% correctGPQA DiamondHigher is better#56 / 60peer median 87.6%per source, see benchmark scores

Cheaper than 82% of the 92 GA models with a published price, in the bottom third on GPQA Diamond (rank 56 of 60), and one of 85 whose vendor states it does not train on customer data.

Ranks are against GA models on Hokai that publish the same figure; ties share a rank.

Provider: Microsoft · Family: Phi-4

More about Microsoft on Hokai

Context window: 16,384 tokens · Max output: 16,384

Input modalities: text · Output: text

About Phi-4

Phi-4 is a 14-billion-parameter dense decoder-only Transformer from Microsoft Research, released on December 12, 2024. Microsoft trained it for 21 days on 1,920 H100-80G GPUs across 9.8 trillion tokens, drawing on synthetic datasets, filtered public-domain web data and acquired academic books and Q&A sets, with a data cutoff of June 2024. Alignment combined supervised fine-tuning with iterative DPO. The family has grown since: Azure's Foundry price list now carries Phi-4-mini, Phi-4-multimodal, Phi-4-reasoning and Phi-4-reasoning-plus, and Microsoft shipped Phi-4-reasoning-vision (15B) in March 2026.

Microsoft's model card, run through OpenAI's simple-evals framework, reports 84.8 on MMLU, 56.1 on GPQA, 80.4 on MATH, 82.6 on HumanEval and 3.0 on SimpleQA. In that same table GPT-4o scores 50.6 on GPQA and 74.6 on MATH, so Phi-4 leads on both, while GPT-4o leads on MMLU (88.1), HumanEval (90.6) and SimpleQA (39.4). GPT-4o Mini sits at 40.9 on GPQA and 73.0 on MATH, but at 86.2 on HumanEval and 9.9 on SimpleQA. These are vendor-run figures. Artificial Analysis, which scores models on its own Intelligence Index v4.3.2, gives Phi-4 a 6 and measures about 40 output tokens per second.

The weights are MIT licensed and published on Hugging Face as microsoft/phi-4. Ollama's phi4 build is a 9.1 GB download with a 16K context window, and the model card documents vLLM and SGLang serving. For a managed endpoint, Azure Foundry sells it serverless at $0.125 per million input tokens and $0.50 per million output tokens. The context window is 16,384 tokens, input and output are text only, and Microsoft trained it primarily on English: the card states it is not intended to support multilingual use, and multilingual data is about 8% of the training mix. It documents chat-format prompting and no dedicated function-calling or JSON-mode parameter.

Who should not pick Phi-4: its lead is narrow. For coding, broad knowledge and factual recall, the card's own table favors GPT-4o and GPT-4o Mini, and a SimpleQA score of 3.0 means answers about the world need retrieval behind them. Newer open-weight releases such as Gemma 4 12B and Qwen3.8 27B arrived after it, so check their pages before defaulting to a December 2024 checkpoint. For a shortlist method see how to choose the right LLM, and for laptop-sized coding options see best AI models for local coding. The full field is on the models hub.

Pricing

Azure's Foundry price list shows Phi-4 at $0.125 per 1M input tokens and $0.50 per 1M output tokens. The same page lists Phi-4-reasoning at those rates and Phi-4-mini at $0.075 in and $0.30 out. Fine-tuning Phi-4 there costs $3 per 1M training tokens plus $0.80 per hosting hour. Running the MIT-licensed weights yourself carries no license fee, only hardware and power. To compare per-token rates, open [GPT-4o Mini](/hub/models/gpt-4o-mini) and [Mistral Medium 3](/hub/models/mistral-medium-3).

What a real job costs

JobInputOutputTotal
Summarise a 20-page PDF$0.0037$0.0005$0.0043
Support reply$0.0003$0.0001$0.0004
One coding agent run$0.025$0.010$0.035

Budgets: 20-page PDF = 30k in / 1k out · Support reply = 2k in / 300 out · Coding agent run = 200k in / 20k out. Computed from the vendor's per-token prices at render time; cached-input discounts are not applied.

Key Features

  • Ahead of GPT-4o on GPQA and MATH: In Microsoft's table Phi-4 posts 56.1 and 80.4 on those two tests, against 50.6 and 74.6 for GPT-4o, which leads on MMLU, HumanEval and SimpleQA.
  • MIT License for Commercial Use: The weights can be downloaded, fine-tuned and deployed commercially with no royalty beyond keeping the license notice.
  • Runs Locally on One GPU: One consumer GPU can serve the 9.1 GB default Ollama package, so no cloud API is required.
  • Several Serving Options: The model card documents Transformers, vLLM and SGLang, and Azure Foundry offers a serverless endpoint.

Pros

  • Leads GPT-4o on GPQA and MATH in the vendor's own table despite a much smaller size.
  • MIT license removes the friction bigger vendors add: fine-tune, redistribute and self-host commercially.
  • A local build lets privacy-sensitive teams keep prompts off external APIs.
  • The hosted list price on Azure is modest next to larger managed models.

Cons

  • Context tops out at 16,384 tokens, so long documents and long chats get truncated.
  • No documented function calling or JSON mode in the base model.
  • Trails GPT-4o and GPT-4o Mini on HumanEval and SimpleQA in the same table.
  • Trained primarily on English, and the data cutoff is June 2024.

Benchmarks

  • MATH: 80.4% vendor-reported · 29 Sep 2026 — Competition maths problems, % solved.
  • MMLU: 84.8% vendor-reported · 29 Sep 2026 — General-knowledge exam across 57 subjects, % correct.
  • HumanEval: 82.6% vendor-reported · 29 Sep 2026 — Small programs that must pass hidden tests, % passing.
  • GPQA Diamond: 56.1% vendor-reported · 29 Sep 2026 — PhD-level science questions that are hard to search for, % correct.
  • AA Intelligence Index: 6 cited: Artificial Analysis · 29 Sep 2026 — Composite of 10 evaluations run by Artificial Analysis, 0 to 100.
  • AA blended price: $0.22/M cited: Artificial Analysis · 29 Sep 2026 — Price per 1M tokens at a 3:1 input to output blend, as listed by Artificial Analysis.
  • Output speed: 40 tok/s cited: Artificial Analysis · 29 Sep 2026 — Median tokens written per second as measured by Artificial Analysis.

A benchmark is an exam, not the job. Scores transfer unevenly between tasks, so weigh the one closest to your workload and read every figure with its source.

Frequently Asked Questions

How much does Phi-4 cost on Azure?

Azure lists Phi-4 serverless at $0.125 for input and $0.50 for output, each per million tokens, matching its rates for Phi-4-reasoning. One call with a 500-token prompt and a 400-token answer costs about $0.00026. Fine-tuning is billed separately at $3 per million training tokens plus an hourly hosting fee.

Can you run Phi-4 for free?

The weights are MIT licensed, so downloading, self-hosting and commercial use carry no license fee; you pay only for the hardware. Ollama's default package weighs 9.1 GB and supports 16K tokens of context. No hosted free tier was verified in this review, so treat any free API access as unconfirmed until you check the host.

Which models are alternatives to Phi-4?

GPT-4o Mini is ahead on HumanEval and SimpleQA in Microsoft's own table, so it suits coding and factual questions better. Phi-4-mini is Microsoft's cheaper sibling, listed at $0.075 in and $0.30 out with a 128K window. Newer open-weight options include Gemma 4 12B and Qwen3.8 27B; compare their pages for context length and licensing.

Does Phi-4 beat GPT-4o Mini at reasoning?

On the model card's numbers it does for science and math: 56.1 versus 40.9 on GPQA and 80.4 versus 73.0 on MATH. GPT-4o Mini scores higher on HumanEval (86.2 against 82.6) and SimpleQA (9.9 against 3.0). All of these are vendor-run results from one framework, so validate on your own prompts before committing.

How do you start using Phi-4?

The quickest local route is the phi4 model in Ollama, which pulls a 9.1 GB build. For code, load microsoft/phi-4 from Hugging Face with the transformers library, or serve it with vLLM or SGLang. For a managed endpoint, deploy it serverless from the Azure Foundry catalog. Prompt it in chat format, and keep inputs under 16K tokens.

Top Alternatives

  • GPT-4o Mini: Pick GPT-4o Mini for coding and factual recall, where it scores higher in Microsoft's table; pick Phi-4 for open weights and stronger GPQA and MATH results.
  • Mistral Medium 3: Pick Phi-4 for MIT-licensed weights and a low per-token price; check Mistral Medium 3's page for its context window and tool support before choosing.

Hokai guides that mention Phi-4

More AI Models on Hokai

Visit Phi-4 Official Page