Phi 4
[Microsoft Research](/microsoft) Phi-4 is designed to perform well in complex reasoning tasks and can operate efficiently in situations with limited memory or where quick responses are needed. At 14 billion parameters, it was trained on a mix of high-quality synthetic datasets, data from curated websites, and academic materials. It has undergone careful improvement to follow instructions accurately and maintain strong safety standards. It works best with English language inputs. For more info
Context window
This model accepts 16K tokens in one request (~12K words of text).
What fits in one request
- FitsShort documentAbout 1,500 words of text
- Won't fitLong documentAbout 37K words of text
- Won't fitSmall codebaseAbout 150K words of text
- Won't fitFull novelAbout 375K words of text
Specifications
Context size, pricing, and release info in one place.
- Context window
- 16,384 tokens (16K)
- Max output tokens
- 16,384 tokens (16K)
- Speed tier
- balanced
- Provider
- Microsoft
- Release date
- Jan 2025
- Input cost
- $0.125/M / 1M tokens
- Output cost
- $0.500/M / 1M tokens
Capabilities
See which features this model supports, such as vision, tools, and streaming.
- Tool use
- Can call external tools and APIs
- Supported
- Function calling
- Structured function call interface
- Supported
- Streaming
- Returns tokens as they are generated
- Supported
- Vision
- Accepts image inputs alongside text
- Not supported
- Extended thinking
- Shows its chain-of-thought reasoning
- Not supported
- Web search
- Can browse the web during a request
- Not supported
- Batch API
- Process many requests asynchronously
- Not supported
- Prompt caching
- Reuse repeated prompt prefixes cheaply
- Not supported
Best for
Jump to a guide or ranking that matches each workload.
Compare Phi 4
Open a side-by-side comparison with one click.
- Phi 4 vs Amazon Titan Text Express
Amazon Titan Text Express has 156% larger context window
- Phi 4 vs Amazon Titan Text Lite
Amazon Titan Text Lite has 156% larger context window
- Phi 4 vs Amazon Titan Text Premier
Amazon Titan Text Premier has 156% larger context window
- Phi 4 vs Claude Instant
Claude Instant has 510% larger context window
- Phi 4 vs Anthropic Claude
Anthropic Claude has 510% larger context window
- Phi 4 vs Codellama 34b Instruct
Phi 4 has 300% larger context window
Frequently asked questions
Short answers about context size and how this model behaves.
More from Microsoft
Other models by Microsoft in our catalog.
Powered by Mem0
Use a smaller model.
Get better results.
Mem0 gives your AI long-term memory so you stop re-sending context on every call. That means you can use a smaller, faster, cheaper model — and still get better answers.
Example: a multi-turn chat session
80% less to send — works with any model