Skip to content

Phi-4

Hugging Face (open weights) Open weights

The catch: Short 16K-token context, and the card says it is trained primarily on English, so other languages perform worse.

AccessOpen weights
Free limitsFree to download and self-host; you pay only for your own compute. 14B dense; 16K-token context; runs on one consumer GPU. MIT licence, no caps. Reasoning variants: microsoft/Phi-4-reasoning and Phi-4-reasoning-plus (32K context).
Modalitytext, code
Credit cardNot required
Commercial useAllowed
Trains on your data–
Licence or termsMIT
Context window16,384 tokens
Model idmicrosoft/phi-4
Base URL–
Last checked8 Oct 2026

How to use Phi-4

Download the weights and serve them yourself; the quickstart below shows one way. Licence: MIT.

Quickstart
vllm serve microsoft/phi-4  # then: curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"microsoft/phi-4","messages":[{"role":"user","content":"Hello"}]}'
Paste into Claude Code
I want to run the open-weight model "Phi-4" (microsoft/phi-4) for my project.
Please:
1. Check the model card and tell me the hardware it needs and the simplest way to serve it (vLLM, SGLang, Ollama or a hosted endpoint).
2. Give me a minimal working setup and a test request.
3. Tell me the licence terms for commercial use.
4. If a cheaper or smaller variant would do the job, mention it.

Before you ship on it

  • Short 16K-token context, and the card says it is trained primarily on English, so other languages perform worse.
  • MIT (LICENSE in the HF repo): use, modify and sell freely; keep the copyright notice.
  • Free to run means you pay for the GPUs, the serving stack and the on-call.

Questions

Is Phi-4 free?

Yes. Open weights offers it as open weights, with these limits: Self-host free · MIT. No credit card is needed.

Can I use Phi-4 commercially?

Yes, under MIT. Check the current terms before you ship.

How do I start with Phi-4?

Download the weights and serve them yourself; the quickstart below shows one way. Licence: MIT.

Source: huggingface.co/microsoft/phi-4, checked 8 Oct 2026.