Phi-4-mini

MicrosoftMCP Tool Call
microsoft/phi-4-miniOpen Weights

Compact Microsoft instruction model tuned for efficient coding assistance, reasoning, and low-latency agent tasks

Benchmark Pricing$0.17 / 1M in$0.68 / 1M out$0.09 cache read
Context: 128,000 tokens•Max Output: 4,096 tokens•Knowledge: 2024-06•Released: 2025-02-26

TECHNICAL SPECIFICATIONS

Context Window128,000128K tokens
Max Output4,0964.1K tokens
LicenseOpen SourceSelf-hostable
Input Modalities
Text
Function / Tool CallingSupported (MCP Ready)
Structured OutputsGuaranteed Schema

MODEL CONTEXT PROTOCOL (MCP) READINESS

✓ Phi-4-mini natively supports OpenAI / Anthropic format tool calling and is fully compatible with MCP servers and agent loops.

MCP Context Window Recommendations

With a context capacity of 128,000 tokens, this model can handle moderately large MCP tool definitions and multi-turn conversation logs comfortably.

STANDARDIZED BENCHMARKS & EVALS

MMLUaccuracy
67.3

API CALL INVOCATION EXAMPLE

// Example: Calling Phi-4-mini via OpenAI SDK
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.MICROSOFT_API_KEY,
});

const response = await client.chat.completions.create({
  model: "microsoft/phi-4-mini",
  messages: [{ role: "user", content: "Hello! Can you inspect MCP tools?" }],
});

console.log(response.choices[0].message.content);

PRICING BY PROVIDER

3 providers
NanoGPTphi-4-mini-instruct
$0.17 / $0.68$0.09 cache
Azure Cognitive Servicesphi-4-mini
$0.07 / $0.30
Azurephi-4-mini
$0.07 / $0.30

Rates in USD per 1M tokens. Rates synchronized from models.dev public catalog.

Prompt Caching Active

This model supports prompt caching at $0.09 / 1M tokens, saving up to 50% on repetitive MCP tool definitions and system instructions.