Skip to content
Dmitry Dushkevich
Two painted fantasy figurines talk on top of a circuit board, a glowing orange speech bubble between them.

NPC Server

AI characters, now on Mac and Deck

Role
Solo engineer
Year
2026
Status
Mac done, Steam Deck in testing
Kind
Engineering

A native rebuild of an on-device AI character server for Unity games, so characters that think on the player's own machine run on Apple-silicon Macs, Linux PCs and the Steam Deck, not only Windows.

The idea

Some Unity games give their characters a language model that runs on the player's own computer. Characters hold real conversations, and nothing leaves the player's machine.

I wrote a new server from scratch so these games work on Apple-silicon Macs, Linux PCs and the Steam Deck, not only Windows.

How it works

The new server is a native C++20 program built on llama.cpp. It runs the model on the GPU through Metal on a Mac and Vulkan on Linux and the Deck. With no usable GPU, it falls back to the CPU instead of failing.

It is a drop-in replacement. The Unity client is unchanged, so a game developer keeps their characters, their dialogue graphs and their tools. One Unity package carries both the Mac and Linux servers, and each player build ships only the one it needs.

Characters tuned on Windows should behave the same everywhere. A parity test harness replays recorded sessions from the original server against mine and checks that the messages and the prompts match.

Milestone 1: text characters on Mac

Accepted on 29 October 2026, five days after I wrote the design. A reference Unity demo runs against the new server, both in the editor and as a standalone Mac app that bundles its server.

On an M5 Mac, characters start replying in about a fifth of a second.

Milestone 2: Linux and Steam Deck

The Linux server is built inside Valve's Steam Runtime SDK, so one build serves the Deck and ordinary Linux PCs. An automated portability check rejects any build that would not run on older systems.

GitHub Actions builds the Linux server and runs the full test suite on every change. If the GPU is lost mid-game, the server moves the work to the CPU and the game keeps running.

The packed Linux build of the demo passed that gate on 4 November 2026. Testing on real Steam Deck hardware is under way now.

How I worked

I designed and built the new server, and tested every step against the original before it shipped.

About 170 commits in two weeks.

Next project

A clear glass sphere full of glowing violet, teal and orange particles on a dark desk.

VibeScope

A live window into AI coding