Phi-3 Medium 4K
Phi-3 Medium 4K 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 4k context window
- Buyers comparing 3 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 3 routes · DeepInfra
About
The Phi-3 Medium 4K, developed by Microsoft, is a state-of-the-art large language model with 14 billion parameters. It is engineered for efficiency across various tasks, particularly excelling in reasoning capabilities. This model is designed to handle 4,096 token context lengths, allowing for the processing of longer input sequences. Leveraging a dense, decoder-only Transformer architecture, it incorporates techniques like supervised fine-tuning and direct preference optimization to align with human preferences and safety standards. The model supports multilingual data, although it is primarily trained in English. Its lightweight nature allows for deployment on diverse hardware platforms, making it accessible and versatile for both commercial and research purposes. Safety measures are embedded, although further precautions are advised for applications with higher risks.
Phi-3 Medium 4K is an open-source model in the Phi-3 family. The structured metadata tracks a 4k-token context window and structured outputs. This page tracks provider routes through Microsoft Foundry, NVIDIA NIM, and DeepInfra, with the cheapest tracked route listed at $0.14 input and $0.41 output per 1M tokens. Headline tracked benchmarks include HumanEval 52.7 and Massive Multitask Language Understanding 68.9.
Top use-case fit: coding, agents, and build tasks
Coding
Q/$ C1 relevant benchmark in the decision map.
Classification
Q/$ C1 relevant benchmark in the decision map.
JSON / Tool use
Included by capability and metadata signals in the decision map.
Provider price ladder
Compare all 3Compare API pricing across 3 providers for input and output tokens, batch, and cached reads when available.
| Provider | Input / 1M | Output / 1M | Route |
|---|---|---|---|
| DeepInfra | $0.140 | $0.410 | Serverless |
| Microsoft Foundry | $0.450 | $1.35 | ServerlessProvisioned |
| NVIDIA NIM | - | - | ProvisionedPartial |
Available via routers & gateways(6)
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.
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.
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.
NVIDIA LLM Router Blueprint
RouterNVIDIA's open-source AI blueprint for LLM routing that selects the optimal model per prompt via intent classification or neural auto-routing; being deprecated 2026-06-20.
Capabilities
Benchmark peer barsfor Coding
Benchmark scores(2)
| Benchmark | Score | Version | Source |
|---|---|---|---|
| HumanEval | 52.7 | pass@1 | https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard |
| Massive Multitask Language Understanding | 68.9 | 5-shot | https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard |
Migration checks
No linked migration route is available for this model yet.
Frequently asked questions
What is the context window of Phi-3 Medium 4K?
Phi-3 Medium 4K has a context window of 4k tokens.
How much does Phi-3 Medium 4K cost?
Phi-3 Medium 4K pricing ranges from $0.14/1M to $0.45/1M input tokens depending on the provider.
When was Phi-3 Medium 4K released?
Phi-3 Medium 4K was released on 2024-05-21.
Which providers offer Phi-3 Medium 4K?
Phi-3 Medium 4K is available from 3 providers: Microsoft Foundry, NVIDIA NIM, DeepInfra.
What benchmarks has Phi-3 Medium 4K been tested on?
Phi-3 Medium 4K has been evaluated on 2 benchmarks, including HumanEval, Massive Multitask Language Understanding.
Advancing the state-of-the-art in AI and computing.
Cheapest of 3 routes · DeepInfra