SassyNPC (Unity × LLM)

The What
SassyNPC is an interactive, AI-powered NPC prototype built in Unity. This character simulates a bratty, rich-girl persona living in Cairo and responds dynamically to player input using a local language model served via Flask and powered by Ollama (running LLaMA 2).
The project explores character embodiment, UX writing, local LLM integration, and stylized UI/UX through TextMeshPro (TMP)

The Why
I was recently asked to prototype an LLM integration inside Unity—and while the technical challenge excited me, I also wanted to have fun with it. So I thought: “What if the NPC had attitude?”I wanted to explore building a character that wasn’t just technically responsive, but also culturally and emotionally flavorful. The result: a sassy Cairo-based NPC you can talk to about anything—from the weather to where she got her nails done.

The How
  • Ollama + Unity: Runs models locally and queries them from Unity via a small Flask server.
  • Built in Unity using TextMeshPro UI and basic scripting for user input/output.
  • Created a local Flask server to send player questions to Ollama, which runs the open-source LLaMA 2 model offline.
  • Designed the prompt to shape her voice: “You are a brat NPC in Cairo. Respond to the player's question with rich girl flair.
  • Added support for emoji & special characters using Noto Emoji and custom TMP font settings.