Using Microsoft Phi in Unreal Engine
Microsoft's Phi models prove that small language models can deliver surprisingly capable results. Phi-3 Mini (3.8B parameters) and Phi-4 offer strong reasoning and instruction-following in a compact package — ideal for game developers who need AI that runs on consumer hardware without sacrificing quality.
Why Phi for Games?
- Tiny but capable. Phi-3 Mini fits in under 4GB of VRAM. It runs on integrated GPUs and even some gaming laptops without a dedicated GPU.
- Strong reasoning. Despite its size, Phi-3 outperforms many larger models on reasoning benchmarks. It handles structured game logic, puzzles, and rule-following well.
- Fast response times. Smaller models generate tokens faster, meaning less perceived latency for players waiting for NPC responses.
- MIT license. Commercial use is permitted without restrictions.
- Low hardware requirements. Ship your game with AI that works on the widest range of player hardware.
Best Phi Models for Unreal Engine
- Phi-3 Mini (3.8B) — The sweet spot for game AI. Fast, small, and surprisingly smart.
- Phi-3 Small (7B) — More capable, still runs on mid-range GPUs.
- Phi-3 Medium (14B) — Higher quality for complex interactions, needs a decent GPU.
- Phi-4 — Microsoft's latest, with improved reasoning and instruction-following.
Running Phi in Unreal Engine
Use GenAI Llama with Ollama to run Phi locally:
- Install Ollama
- Pull Phi:
ollama pull phi3:mini - Install GenAI Llama
- Start using Phi in your Blueprints — chat completions and streaming work out of the box
For hybrid setups (local Phi + cloud GPT-5/Claude), GenAI for Unreal supports Phi through its OpenAI Compatible Mode alongside all major cloud providers.