LLM·Dex
Open weightsMicrosoftsmalltext

Phi-4

Microsoft's 14B model, exceptional quality-per-parameter via curated synthetic training data.

Updated


Quick facts

Released
Dec 2024
Context
16K tokens
Output / 1M
Pricing not published
License
MIT

About Phi-4

Phi-4 is Microsoft's 2024 push to demonstrate that small models trained on curated synthetic data can punch far above their parameter count. The 14B model trades blows with much larger models on math and reasoning benchmarks.

For on-device and edge deployments where hardware budgets are tight, Phi-4 is consistently the highest-quality option in its size class.

Benchmarks

Published scores from Microsoft's model card or independent leaderboards. We do not publish numbers we cannot source, see methodology.

HumanEval
82.6
Python coding pass@1
MMLU
84.8
Broad academic knowledge
GPQA
,
Graduate-level reasoning
SWE-bench
,
Real software-engineering tasks
  • MMLU84.8
  • HumanEval82.6

Capabilities

Strengths

  • Exceptional quality at 14B parameters
  • MIT license, clean commercial use
  • Strong on math

Tracked weaknesses

  • Short 16k context
  • No vision

Pricing

Per-million-token rates as published by Microsoft.

Per-token pricing not yet published for Phi-4. Check the official provider site for current tiers.

Call Phi-4 from your code

Drop-in snippet for the Microsoft SDK. Set your API key in the environment and run.

typescript
import OpenAI from "openai";

const client = new OpenAI({
  // Use OPENAI_API_KEY for OpenAI, or your provider's key + baseURL.
  apiKey: process.env.OPENAI_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "phi-4",
  messages: [
    { role: "user", content: "What's the time complexity of quicksort?" },
  ],
});

console.log(completion.choices[0].message.content);

Best for

Tasks where Phi-4 ranks among LLMDex's top picks.

Compare Phi-4 with…

Frequently asked

  • How much does Phi-4 cost?
    Microsoft has not published per-token API pricing for Phi-4 at the time of writing. Check the official site for current pricing tiers, or compare against alternative models on LLMDex.
  • What is Phi-4's context window?
    Phi-4 supports a context window of 16K tokens.
  • Is Phi-4 open source?
    Phi-4 ships with open weights under the MIT license. You can self-host it, fine-tune it, and (subject to the license terms) deploy it commercially.
  • When was Phi-4 released?
    Phi-4 was released on Dec 12, 2024 by Microsoft.
Friday digest

Intelligence, distilled weekly.

One short email every Friday, new model launches, leaderboard moves, and pricing drops. Curated by hand. Free, no spam.