LLM Reference

Phi-2

Released
2023-12-12
Last refreshed
2026-05-19
Status
Researched 25d ago
Open SourceCommercial use allowedCodingClassificationJSON / Tool use

Phi-2 is worth evaluating for coding, classification, and json / tool use when its provider route and context window match the workload.

Use it for

  • Teams evaluating coding, classification, and json / tool use
  • Workloads that can use a 2k context window
  • Buyers comparing 4 tracked provider routes

Do not use it for

  • Vision or document-understanding workloads
Specifications
Family
Phi-2
Released
2023-12-12
Context
2k
Parameters
2.7B
Architecture
Decoder Only
Specialization
general
Openness
Open source
License
MIT(OSI)Commercial use allowed
Training
finetuned
Created by

Advancing the state-of-the-art in AI and computing.

Redmond, Washington, United States
Founded 1991
Website
Pricing
Output / 1M
$0.070
Input / 1M
$0.070

Cheapest of 5 routes · Microsoft Foundry

About

Phi-2 is a compact language model by Microsoft endowed with 2.7 billion parameters and part of their Phi series. It shows formidable capabilities in reasoning and language understanding, outshining much larger models, even those with up to 25 times more parameters. Phi-2's training utilized a vast and diverse dataset of 1.4 trillion tokens, incorporating high-quality synthetic data and curated web content to bolster its common sense reasoning and general knowledge. Interestingly, despite lacking fine-tuning via reinforcement learning from human feedback (RLHF), it exhibits enhanced safety features and reduced bias. This makes Phi-2 a particularly useful asset in natural language processing research and development 127.

Phi-2 is an open-source model. The structured metadata tracks a 2k-token context window and structured outputs. This page tracks provider routes through Microsoft Foundry, Cloudflare Workers AI, Together AI, and 2 more, with the cheapest tracked route listed at $0.05 input and $0.25 output per 1M tokens. Headline tracked benchmarks include Google-Proof Q&A 41.2, HellaSwag 85.9, and HumanEval 59.7.

Top use-case fit: coding, agents, and build tasks

Coding

Q/$ A

1 relevant benchmark in the decision map.

Classification

Q/$ A

2 relevant benchmarks in the decision map.

JSON / Tool use

Included by capability and metadata signals in the decision map.

Provider price ladder

Compare all 5

Compare API pricing across 4 providers for input and output tokens, batch, and cached reads when available.

ProviderInput / 1MOutput / 1MRoute
Microsoft Foundry$0.070$0.070
Provisioned
Fireworks AI$0.100$0.100
Provisioned
Together AI$0.100$0.100
Serverless
Replicate API$0.050$0.250
Serverless

Available via routers & gateways(6)

Capabilities

Structured Outputs

Benchmark peer barsfor Coding

Benchmark scores(4)

Scores are benchmark-specific and are direction-aware: the same numeric gap can mean very different outcomes across suites. Use the leaderboard context and this model's provider route to decide whether the winning margin is meaningful for your workload.
BenchmarkScoreVersionSource
Google-Proof Q&A41.2diamondresearch
HellaSwag85.910-shotresearch
HumanEval59.7pass@1research
Massive Multitask Language Understanding68.35-shotresearch

Migration checks

No linked migration route is available for this model yet.