Offline AI NPC
Fully offline AI NPCs for Unity 6: speech in, a local language model, speech out. No internet, no cloud API, no per-call cost — nothing leaves the player's machine.
by Tim "merrymaker14" Musharapov
Price History +
Fully offline AI NPCs for Unity 6: speech in → local language model → speech out. No internet, no cloud API, no per-call cost. Nothing leaves the player's machine.
WHAT MAKES IT DIFFERENT
- Fully offline. No API keys, no accounts, no per-call billing, no telemetry of any kind.
- Multilingual dialogue and recognition across five languages, with the voice situation stated honestly below rather than rounded up.
- A shipped VR game runs on this stack. The demo and the sample scenes are the same code the game uses.
- First audio in about two seconds, because speech starts at the first finished sentence instead of at the end of the reply.
IS THIS FOR YOUR GAME?
Built for: a small cast of characters, conversation the player starts, desktop, offline, and a game that can absorb a second or two before a character answers.
Not built for: mobile or web, crowds of NPCs talking among themselves, real-time combat barks, or dialogue that must be word-for-word what a writer authored.
A buyer who reads that and walks away has saved us both a refund.
FEATURES
- Dialogue — a complete talking character: microphone in, local model, voice out, with streaming so speech begins at the first finished sentence.
- State — moods, needs and relationships as numbers, with traits that make two characters react differently to the same event, threshold events, and save/load.
- Perception — the character knows what is actually near her, and cannot name an object she was not told about.
- Actions — the model picks a verb and a target under a grammar, so the output is a decision your code can execute rather than prose you must parse.
- Hardware tiers — the plugin measures the machine, picks a model, and says what it did.
- Verification tooling — see the boundary below.
- A prompt debugger — everything the model is told for one turn, split into the part that stays and the part that changes, with token counts.
VERIFICATION, DESCRIBED EXACTLY
Voices verify without running the game: speak one line from the editor, per language, per voice. Dialogue verification runs in Play mode, because the language-model integration cannot start outside it.
That boundary is real and it is written this way on purpose. The speech half is where every failure in this project actually happened — a broken voice reference, a wrong-gender voice, an encoding bug that silently killed an entire language — and no competitor offers verification tooling at all.
WHAT THE NUMBERS ARE, AND WHERE THEY CAME FROM
Measured on an RTX 3060 Laptop (6 GB), Qwen3-4B Q4_K_M, all 36 layers on the GPU.
Time to first audio — streamed run of 21 warm turns on a cleared history, 2026-08-16:
- Median: 2019 ms
- p10–p90: 1545–2761 ms
- Range: 1232–3013 ms
- First turn of a session, cold: 2071 ms
About two seconds, not always two seconds: the spread is real and printed above.
Speech recognition is a second wait, and it is the larger one. Every figure above starts when text is submitted. If your player speaks, transcription happens first: Whisper-small took 7908 ms and 8004 ms on one short phrase while the language model held the same GPU (measured in the interview demo, 2026-08-16). Smaller Whisper models are several times faster and get more words wrong — the choice is yours, and it is a real trade, because the transcript is what the character answers.
Several characters generating at once serialise. They share one local model server. In a scene where background characters hold ambient conversations, a player's reply was measured at 12.7 s against 2.4 s with nothing else generating — both whole-reply figures from an earlier run, which is the only pair that holds the measurement mode constant. The mitigation is a few lines of your code: gate ambient dialogue while a player request is pending. Design a tavern of twenty talking NPCs around this and it will not work.
Switching language mid-session costs one cold prompt, because a new system prompt is a new prefix and the cache is invalidated. That cost is not quantified here; no measurement of it exists in this repository, so no figure is printed.
WHAT STATE DOES, STATED AS MEASURED
Deterministic, claimed without hedging: threshold events fire once on the crossing; traits are different numbers per character and produce different decay; state saves and loads exactly; the model is structurally unable to modify a need — it can only be told about one.
Probabilistic, claimed as measured: characters colour their replies with what they feel. Ask a tired character how she is and she mentions being tired in roughly 6 cases out of 10; with the state system switched off, 0 out of 10.
What is not claimed: that a character spontaneously behaves differently without the topic being raised. That was not demonstrated, so it is not sold.
Brief adherence: 320 turns across 20 sessions, on both the 1.7B and the 4B model, produced zero departures from the authored facts. The small model holds a brief as reliably as the large one; what it loses is manner, not memory.
WHY LOCAL, STRUCTURALLY
A cloud solution is a subscription to somebody else's service, with their rules, their latency and their lifetime. This is a library you own.
- No per-call cost. The industry pattern is well documented: teams build these features and cut them before release once cost at player scale is calculated.
- No vendor risk. A major character-AI vendor folded its game-facing product in 2025, and its stated reason was that customers wanted control and local execution.
- No caps. No limit on concurrent characters or conversation length. It scales with the player's machine, not with your bill.
- Privacy. Nothing leaves the machine — which matters for NDA work, children's games and European regulation.
- Determinism. A fixed seed reproduces a conversation. Impossible when the provider swaps the model underneath you.
- A swappable model. Any GGUF the buyer chooses.
LANGUAGES, PRECISELY
Dialogue and speech recognition are genuinely multilingual — the language model and Whisper handle all five. Bundled voices are not the same set, and this is where other listings round up:
- English: dialogue, recognition, and a bundled voice that is public domaiе — no attribution required.
- Spanish: dialogue and recognition. Bundled voice is male only.
- Russian: dialogue and recognition. Bundled voice is male only.
- Japanese: dialogue and recognition. No bundled voice.
- Chinese: dialogue and recognition. No bundled voice.
Where no voice with a clean, verifiable licence exists, the slot is empty and says why. Every voice that does ship has had its model card read and a dated copy kept in LICENSES/. Supplying your own engine is documented and proven by a worked example.
BEFORE YOU BUY
- Desktop only — Windows, macOS, Linux. Not mobile, not WebGL, not console.
- Unity 6.
- External dependencies you install yourself: LLM for Unity and whisper.unity. They are not bundled, deliberately — bundling them breaks the build of anyone who already has them.
- Model downloads. The plugin downloads multi-gigabyte models on first use. That is the only step that needs an internet connection, and the size is stated before the download starts.
- Hardware. The plugin measures the machine and picks a model for it. A machine that cannot run any of them gets a readable explanation, not a crash and not a hang.
- Third-party licences are listed in THIRD_PARTY_NOTICES.md, inside the package.
- No DRM, no licence check, no registration, no phone-home, no time limit, no watermark, no telemetry. None of it, anywhere.
ROADMAP
No dates. In the order buyers ask for it:
- Hardware detection and graceful fallback, deepened.
- Retrieval over a knowledge base.
- Voice activity detection, so push-to-talk becomes optional.
- Lipsync.
- A second speech engine, once one passes the provenance check.
- Wake-word addressing, which also loosens the shared-queue limit above.