Phi-4
LLM Provider / Model ยท Extremely small self-hosted coding model, edge devices, resource-constrained environments
At a glance
| Input price | Free (self-hosted) |
| Output price | Free (self-hosted) |
| Price tier | Free |
| Context window | 16K |
| Max output | 4K |
| Context tier | <32K |
| Speed tier | Fast |
| Latency | local-bound |
| Knowledge cutoff | Jun 2024 |
| Modality | Text-only |
| Model ID | phi-4 |
| Provider | Microsoft |
| HumanEval | 82% |
| MMLU | 80% |
| SWE-Bench | 28% |
| Benchmark | small-model: strong |
| Released | Dec 2024 |
| Hosting | Open-weights |
| Capabilities | Tool use, Streaming, Structured output, Self-hostable, Small footprint |
What Phi-4 does
Tool use, Streaming, Structured output, Self-hostable, Small footprint
Best for
Extremely small self-hosted coding model, edge devices, resource-constrained environments
Works well with
Agent / Orchestration
Conflicts & caveats
- Trae's built-in model menu may not include Phi-4 โ Trae primarily ships with Claude/GPT/Gemini/DeepSeek.
- Google Antigravity is built around Gemini 3 Pro; Claude and recent GPT-5 models also work, but Phi-4 is not in the supported model list.
- Kiro's spec mode is tuned for Claude models โ Phi-4 may work but spec-driven flows are best with Claude.
- Cursor's built-in model menu may not include Phi-4 โ verify it's available in your Cursor model picker.
- OpenAI Codex (VS Code) is tied to OpenAI's GPT-5.1 Codex family โ Phi-4 is not selectable inside this integration.
- Gemini CLI is locked to Google Gemini models โ your LLM is Phi-4.
- Privacy conflict: Self-hosted Phi-4 sends code to cloud @codebase (Cursor). Use local context (Continue indexing, ChromaDB, LanceDB, pgvector, Vespa self-hosted) for true privacy.
- Claude Code only works with Claude models โ your LLM is Phi-4.
- Devin uses Cognition's proprietary model internally โ your selected Phi-4 will be ignored.
- OpenAI Codex (Cloud) runs GPT-5.1 Codex internally โ your selected Phi-4 will be ignored.
- Jules runs Gemini models internally โ your selected Phi-4 will be ignored.
- The Claude Code SDK is tuned for Claude models โ Phi-4 may work via the model adapter but loses Claude-specific features (thinking, prompt caching, sub-agents).
- Lovable uses a fixed internal model โ your selected Phi-4 will be ignored.
- Replit Agent 3 uses its own model selection internally โ your selected Phi-4 will be ignored.
Build a full stack around Phi-4 โ Flowpicker shows compatibility warnings before you commit.
Open the stack planner โ