Phi-2
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
Advancing the state-of-the-art in AI and computing.
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/$ A1 relevant benchmark in the decision map.
Classification
Q/$ A2 relevant benchmarks in the decision map.
JSON / Tool use
Included by capability and metadata signals in the decision map.
Provider price ladder
Compare all 5Compare API pricing across 4 providers for input and output tokens, batch, and cached reads when available.
| Provider | Input / 1M | Output / 1M | Route |
|---|---|---|---|
| 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)
Azure AI Foundry Model Router
RouterMicrosoft Azure AI Foundry's native model router that uses a trained ML model to route each prompt in real time to the optimal Azure-hosted model, with Balanced/Cost/Quality mode selection and automatic failover.
Helicone
GatewayObservability-first AI gateway with routing, caching, rate limiting, and request tracing; Apache 2.0 open-source core with a managed hosted tier for logging and analytics.
Kong AI Gateway
GatewayMulti-LLM AI gateway built on Kong Gateway 3.x, adding semantic routing, load balancing, guardrails, and MCP traffic analytics as plugins over Kong's existing API management platform.
LiteLLM
GatewayOpen-source Python SDK and proxy server that unifies 100+ LLM APIs behind a single OpenAI-compatible interface, with load balancing, cost tracking, and configurable failover.
OpenRouter
HybridUnified hybrid gateway to 400+ models from 60+ providers via a single OpenAI-compatible API, with optional auto-routing that selects the best model per prompt.
Portkey
GatewayProduction AI gateway routing to 1,600+ LLMs with failover, load balancing, semantic caching, and guardrails; Apache 2.0 core is fully self-hostable with the complete feature set.
Capabilities
Benchmark peer barsfor Coding
Benchmark scores(4)
| Benchmark | Score | Version | Source |
|---|---|---|---|
| Google-Proof Q&A | 41.2 | diamond | research |
| HellaSwag | 85.9 | 10-shot | research |
| HumanEval | 59.7 | pass@1 | research |
| Massive Multitask Language Understanding | 68.3 | 5-shot | research |
Migration checks
No linked migration route is available for this model yet.
Advancing the state-of-the-art in AI and computing.
Cheapest of 5 routes · Microsoft Foundry