Phi-4 is Microsoft's language model with a 16K context window and up to 16K output tokens, available from 3 providers, starting at $0.07 / 1M input and $0.14 / 1M output. A small language model from Microsoft trained on high-quality synthetic and curated datasets, excelling at reasoning and STEM tasks despite its compact size.
Specifications
Canonical IDmicrosoft-phi-4
TypeLanguage
StatusActive
CreatorMicrosoftMicrosoft
Providers
Context Window16K tokens
Max Output16K tokens
Input ModalitiesText
Output ModalitiesText
Parameters14.7B
HuggingFace Likes2,248
HuggingFace Downloads (30d)874,552
HuggingFace Downloads (all-time)11,669,853
Release Date · 2 years ago
Knowledge Cutoff · 2 years ago
Benchmarks
Intelligence Index
4.9
#410
Math Index
18.0
#207
MMLU-Pro
0.7
#194
GPQA
0.6
#293
HLE
0.0
#398
LiveCodeBench
0.2
#244
AIME
0.1
#101
IFBench
0.2
#380
Time to First Token
2.14s
#440
SciCode
0.3
#305
MATH-500
0.8
#94
AIME 2025
0.2
#207
LCR
0.0
#399
TerminalBench Hard
0.0
#283
TAU2
0.0
#392
Output TPS
28.9
#251

Capabilities

Input1/5
Text
Image·
Audio·
Video·
PDF·
Output1/5
Text
Image·
Audio·
Video·
Embedding·
Capabilities3/13
Reasoning·
Adaptive Reasoning·
Function Calling
Parallel Function Calling·
Structured Outputs
Native JSON Schema
Web Search·
URL Context·
Computer Use·
Code Execution·
File Search·
Prompt Caching·
Assistant Prefill·

Pricing by Provider

US Dollar ($)
Per 1M tokens
ProviderStandard
Input
$ / 1M
Output
$ / 1M
Azure AI Foundry logo
Azure AI Foundry
microsoft:phi4
$0.125$0.5
DeepInfra logo
DeepInfra
deepinfra/microsoft/phi-4
$0.07$0.14
OpenRouter logo
OpenRouter
microsoft/phi-4
$0.07$0.14

Cost Calculator

US Dollar ($)
Preset:

Cheapest Instances to Run It

Cloud GPU instances that can host Phi-4, ranked by cheapest on-demand price. The model needs about 35 GB of GPU memory at FP16 precision (estimated from its parameter count), so treat the fit as guidance rather than a guarantee.

All clouds
FP16 (full precision)
US Dollar ($)
Instance
Cloud
GPU
VRAM
Price
Cheapest region
Standard_NP10sAzureAMD Alveo U250 FPGA (64GB)64 GB$1.65/hrwestus2
g6e.xlargeAWSL40S45 GB$1.86/hrus-east-1
Standard_NV32as_v4AzureAMD Radeon Instinct MI2564 GB$1.86/hrwestus2
7 more instances can run Phi-4
Unlock the full ranked list and FP8 / INT4 quantization with a CloudPrice subscription.

Versions

VersionReleasedContextInput / 1MOutput / 1MStatus
Phi-4 Mini Instruct131K$0.075$0.300Available
Phi-416K$0.070$0.140Current
Phi-4 MiniAvailable
Phi-4 MultimodalAvailable
Phi-4 EagleAvailable
Phi-4 Mini MMAvailable
Phi-4 Mini Reasoning131K$0.080$0.320Available
Phi-4 Multimodal Instruct131K$0.080$0.320Available
Phi-4 Reasoning33K$0.125$0.500Available
Phi-4 Reasoning PlusAvailable
Phi-3 MiniAvailable

Model IDs

azure_ai/Phi-4
deepinfra/microsoft/phi-4
microsoft-phi-4
microsoft/phi-4
phi-4
phi-4-mini
phi-4-multimodal
publishers/microsoft/models/phi4