microsoft
Microsoft: Phi 4
microsoft/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...
- Type
- text
- Provider
- microsoft
- Model ID
- microsoft/phi-4
- Context window
- 16K tokens
- Self-hostable
- Yes — runs on your own GPU
- Input price
- $0.077 / 1M tokens
- Output price
- $0.15 / 1M tokens
Cloud price is billed from prepaid credits when a request fails over to the cloud. Open-weight models run free on GPUs you own — the gateway routes to your nodes first.
What it costs to run
cloud · 1M in + 1M out
$0.23
$0.077 for a million input tokens plus $0.15 for a million output tokens, billed from credits only when a request fails over to the cloud.
your hardware
$0 / token
Served from a workstation or on-prem server you own, there is no per-token fee — the marginal cost is power.
Run it on your own hardware
Estimated GPU memory for Microsoft: Phi 4 (15B parameters), including the KV cache for a 8,192-token context.
- Q4_K_M
- ~10.6 GBfits a 12 GB card
- Q8_0
- ~16.8 GBfits a 24 GB card
- FP16 / BF16
- ~29.6 GBfits a 32 GB card
Install the agent on the machine and it dials out to the gateway over a single WebSocket — no port forwarding or inbound firewall rules. Requests for this model go to your node first and fail over to the cloud only when it can't serve.
/// initialize
Call Microsoft: Phi 4 through one OpenAI-compatible endpoint.
Serve it from hardware you own, with cloud failover when your nodes are busy or offline.
no credit card · 2 nodes free · openai-compatible
Frequently asked questions
- What is the context window of Microsoft: Phi 4?
- Microsoft: Phi 4 accepts up to 16,384 tokens (16K) of context per request.
- How much does Microsoft: Phi 4 cost per million tokens?
- Through Wide Area Intelligence, Microsoft: Phi 4 costs $0.077 per 1M input tokens and $0.15 per 1M output tokens when served from the cloud, billed from prepaid credits. A workload of 1M input plus 1M output tokens costs $0.23.
- Can I run Microsoft: Phi 4 on my own hardware?
- Yes — Microsoft: Phi 4 is an open-weight model you can run on a workstation or on-prem server you own. At Q4_K_M it needs roughly 10.6 GB of GPU memory with an 8,192-token context — it fits a single 12 GB card. Wide Area Intelligence routes requests to your own nodes first and fails over to the cloud only when they can't serve.