Phi 4
Phi 4 (Microsoft, 2025) is an chat model. [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...
by Microsoft · 16K token context window
Best for
- low-latency chat and routing
- request routing and triage
- text classification
Ways to use Phi 4 in osFoundry
Connect with your own key (BYOK)
Open the key dialog and paste your Microsoft API key. osFoundry discovers Phi 4 automatically — assign it to a Maestro role (router, direct, orchestrator, or fallback) in the Pipeline tab and it is live in every chat. Your key, your provider account — no token markup.
Use it in a Room App
Room Apps declare AI features in their manifest, then call them with invokeAI:
import { invokeAI } from '@osfoundry/app-sdk'
// 'summarize' is an AI feature declared in your app manifest.
const result = await invokeAI('summarize', userText)
Call it from your own apps
Once a model is wired into your workspace you can host it as an API and reach it from your own services, scripts, or CI — outside osFoundry.
Run Phi 4 yourself
Phi 4 is also available as open weights — self-host it for full data control and no per-token cost. See that page for GPU requirements and a cost comparison against API pricing.
Phi 4 vs similar models
| Model | Org | Params | Context | Input price | Self-host |
|---|
| Phi 4 | Microsoft | — | 16K | $ 0.065 /1M | API only |
| R1 | DeepSeek | — | 64K | $ 0.700 /1M | API only |
| Llama 3.1 70B Hanami x1 | Sao10K | — | 16K | $ 3.00 /1M | API only |
| Mistral Small 3 | Mistral | — | 33K | $ 0.050 /1M | API only |
Licence
Hosted — usage subject to provider terms — Hosted-only model — usage governed by the provider's API terms. Bring your own provider key.
No weights distributed; usage subject to provider terms.
Frequently asked about Phi 4
How much does Phi 4 cost?
Phi 4 is metered at $ 0.065 /1M for input, and $ 0.140 /1M for output. Bring your own Microsoft API key — osFoundry passes through provider pricing without markup.
Can I use Phi 4 commercially?
Commercial use is allowed with conditions. Hosted-only model — usage governed by the provider's API terms. Bring your own provider key. No weights distributed; usage subject to provider terms.
What is the context window of Phi 4?
Phi 4 supports a 16K token context window.
Can I run Phi 4 locally?
No — Phi 4 is hosted only and accessed via the Microsoft API. An open-weights equivalent is available to self-host — see the cross-link above.
What is Phi 4 best at?
Phi 4 is well-suited to low-latency chat and routing, request routing and triage, text classification.
How do I use Phi 4 in osFoundry?
Paste your Microsoft API key in the key dialog (or deploy the open weights for self-hostable models), assign Phi 4 to a Maestro role in the Pipeline tab, then use it in chat, Room Apps via invokeAI, or your own apps.
Published by Microsoft on January 10, 2025. Source: https://openrouter.ai/microsoft/phi-4