Phi 4 Mini Instruct
VerifiedCompact 3.8B open-weight model for efficient instruction following.
About Phi 4 Mini Instruct
Built with 3.8 billion parameters, the model uses a transformer architecture optimized for text-only inputs and outputs. Its 131k token context window enables processing of long documents or multi-turn conversations without truncation. As an open-weight release, it supports local deployment and fine-tuning by developers.
The design emphasizes resource efficiency while maintaining strong instruction adherence across varied prompts. This makes it suitable for edge devices, research experiments, and production systems that require low latency. Typical usage includes chat interfaces, summarization of lengthy texts, and lightweight reasoning workflows.
Capabilities
How Phi 4 Mini Instruct compares
Phi 4 Mini Instruct (striped bar) vs other language models on intelligence, speed and price.
Price
USD per 1M output tokens · Lower is better · Phi 4 Mini Instruct ranks #19 of 72
Sources: Artificial Analysis (intelligence, speed) · OpenRouter (price).
Best for
Code Generation and Debugging
Phi 4 Mini Instruct excels at writing, reviewing, and fixing code in multi-file projects by leveraging its dedicated code generation and debugging capabilities.
Long Document Analysis
The model handles extended inputs effectively for summarizing reports, extracting key points, and performing in-depth analysis across large texts.
Step-by-Step Reasoning Tasks
It supports logical and mathematical problem solving through clear instruction following in multi-turn educational or technical dialogues.
Strengths & limitations
Strengths
- +Strong performance for compact size
- +Efficient inference on limited hardware
- +Handles extended context windows effectively
- +Clear and structured responses
Limitations
- –Smaller knowledge cutoff than large models
- –Text-only modality
- –May struggle with highly nuanced or creative tasks
Cost calculator
Estimate what Phi 4 Mini Instruct would cost for your usage.
Based on Phi 4 Mini Instruct's $0.08/1M input · $0.35/1M output. Estimate only — actual cost varies by provider and caching.
Quick start
OpenRouter's API is OpenAI-compatible — most SDKs work by just swapping the base URL. Only the model slug changes between models.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://openrouter.ai/api/v1",
apiKey: process.env.OPENROUTER_API_KEY,
});
const completion = await client.chat.completions.create({
model: "microsoft/phi-4-mini-instruct",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(completion.choices[0].message.content);Model slug: microsoft/phi-4-mini-instruct
Editor's verdict
Phi 4 Mini Instruct is Microsoft's open-weight language models with a 131K-token context window.
At $0.35 per 1M output tokens, it is very cost-efficient for its class.
As an open-weight model you can self-host it or call it through a hosted API.
Best suited to strong performance for compact size and efficient inference on limited hardware.
Frequently asked questions
The model provides a context window of 131072 tokens.
User reviews
Real, verified reviews from the community shape this model's rating.
Loading reviews…