LLMUnity: local llama.cpp characters in Unity through two components and one Chat call
Create characters in Unity with LLMs!
At a glance
- What is it?
- LLM for Unity, published as LLMUnity, wraps the llama.cpp-based LlamaLib so a Unity game can run language models on the player's machine and talk to them through an LLMAgent component. Its last push was in April 2026 and the latest release is v3.0.3.
- Who is it for?
- Pick LLMUnity if you build a Unity game and want conversational characters that run a local gguf model without a server round trip. Skip it if your minimum Unity version is below 2022.3 or you need a project with recent commits, because the last push was on 2026-04-29.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Activity is slowing. The repository last received commits 6 months ago.
- What is it written in?
- Mainly C#, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- undreamai/LLMUnity1,739 ★ · +32
| Repository | 2026-09-10 | 2026-11-15 |
|---|---|---|
| undreamai/LLMUnity | 1.7k | 1.7k |
32 Stars in the last 66 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
A character is two components: LLM for the model, LLMAgent for the personality
The package splits the work between two scripts that you attach to empty GameObjects. The first holds the model. In the GameObject Inspector you click Add Component and select the LLM script. The second is the character. On a separate empty GameObject you add the LLMAgent script and write the character's role into its System Prompt field.
The split has a practical effect. One LLM object can serve several characters, because LLMAgent has an optional LLM field that you fill in only when the scene contains more than one LLM GameObject. The package ships a MultipleCharacters sample for exactly this case, described as a simple interaction using multiple AI characters. A single model in memory with many personalities on top is a cheaper arrangement than loading a model per character, and the component layout makes it the default path. The system prompt is the only place the quick start shows for defining behavior.
Two ways to install, and only one of them follows the repository
There are two installation routes. The first goes through the Unity Asset Store: open the LLM for Unity asset page, click Add to My Assets, open Window > Package Manager, choose Packages: My Assets from the drop-down, select the LLM for Unity package, and click Download then Import. The second uses the repository directly: in Package Manager click the plus button, choose Add package from git URL, enter https://github.com/undreamai/LLMUnity.git and click Add.
The git route tracks the repository, which makes it the way to pick up changes between tagged releases. The Asset Store route follows whatever version is published there. The package identifier in package.json is ai.undream.llm, the display name is LLM for Unity, and the version field currently reads 3.0.3. Because both routes land in the same Package Manager window, you can switch later, but do not leave both copies in one project, since two copies of the same scripts will conflict.
Chat takes a streaming callback or returns the whole reply from await
Talking to a character is one method on the agent. The quick start shows two call styles in a single class:
using LLMUnity;
public class MyScript {
public LLMAgent llmAgent;
void HandleReply(string replySoFar){
// do something with the reply from the model as it is being produced
Debug.Log(replySoFar);
}
void Game(){
// handle the response as it is being produced
...
_ = llmAgent.Chat("Hello bot!", HandleReply);
...
}
async void GameAsync(){
// or handle the entire response in one go
...
string reply = await llmAgent.Chat("Hello bot!");
Debug.Log(reply);
...
}
}The callback form receives the reply so far while the model is still generating, which suits a dialogue box that fills in word by word. The awaited form hands back the complete string once, which suits logic that needs the whole answer, such as parsing a decision. The README also mentions a way to specify a function called when the reply has completed; check the documentation at undream.ai/LLMUnity for its exact signature.
The default models are gigabytes, and a gguf file is the other option
Setting up the LLM script involves a choice. The Download Model button fetches one of the default models, and the README marks the size as about gigabytes. The alternative is the Load model button, which takes your own .gguf file. The README points to its LLM model management section for the details of that route.
Size is the cost that matters most for shipping. A model measured in gigabytes either goes into your build or gets downloaded by the player, and the package has a sample for the second case: MobileDemo is described as an example mobile app for Android and iOS with an initial screen that displays model download progress. The consequence is that LLMUnity does not remove the distribution problem, it hands you a choice between a large install and a first-run download. The README states that the package runs locally without internet access, so the player needs the model files on the device before the first conversation, not a live connection afterwards.
LlamaLib on llama.cpp does the inference, so the hardware list is the README's claim
The backend is LlamaLib, a standalone C++ and C# library built on top of llama.cpp. LLMUnity is the Unity-facing layer over it. The README says inference is fast on CPU and GPU, naming Nvidia, AMD and Apple Metal, and that the package runs on PC, mobile or VR. It also says a remote server setup is supported, so the model can live on another machine and the game can talk to it instead of loading the model on the player's device.
These are statements from the project, not measurements. The README gives no frame times, tokens per second or minimum memory, so you cannot read from it whether a particular phone or headset will hold a conversation at a playable pace. Run a candidate model on your lowest target device before committing a design to it. The remote option matters for the same reason: it is the fallback when the target hardware is too weak, at the price of needing a server and a connection.
Samples cover function calling, RAG and a knowledge base game
package.json registers samples that Unity lists in Package Manager. SimpleInteraction is a simple conversation with one AI character. MultipleCharacters uses several. FunctionCalling is a sample with structured output from the LLM. RAG covers semantic search using a Retrieval Augmented Generation system, and includes an example that uses RAG to feed information to a LLM. MobileDemo is the Android and iOS app with a download progress screen. ChatBot gives a player and an AI a UI like a messaging app. KnowledgeBaseGame is also listed, though its purpose is best checked in the package itself.
The RAG system is advertised as an ANN search, and the README says it can enhance a character's knowledge with your own data. In practice that means a character can answer from game lore you provide rather than only from what the model memorized. The FunctionCalling sample is the one to read if you want the model's output to drive game actions, since structured output is what makes a reply parseable by code. The README lists more than twenty games and projects using the package, from Steam and itch.io titles to a Meta Quest experience.
Unity 2022.3 is the declared floor, and the last push was on 2026-04-29
Version information is not entirely consistent. package.json declares unity 2022.3 with unityRelease 16f1, while the README says the package was tested on Unity 2021 LTS, 2022 LTS, 2023 and Unity 6. If you are on 2021 LTS, expect Package Manager to treat the declared minimum as 2022.3, and verify the install on a throwaway project first.
On maintenance, the latest releases are v3.0.1 on 2026-01-28, v3.0.2 on 2026-02-27 and v3.0.3 on 2026-03-08, and the repository was last pushed on 2026-04-29. The repository is not archived, but that last push is more than six months old, so do not assume fixes for new Unity versions will arrive quickly. The repository includes Migration.md and CHANGELOG.md, which are the files to read when moving between major versions. The license is Apache-2.0, and the README says the package is free to use for personal and commercial purposes. The README links an Upcoming Releases board, which is the place to check for planned work.
Editorial conclusion
Pick LLMUnity if you build a Unity game and want conversational characters that run a local gguf model without a server round trip. Skip it if your minimum Unity version is below 2022.3 or you need a project with recent commits, because the last push was on 2026-04-29.
Frequently asked questions
How do I install LLMUnity in a Unity project?
Either add LLM for Unity from the Asset Store through Package Manager, or choose Add package from git URL and use https://github.com/undreamai/LLMUnity.git.
Which Unity versions does LLMUnity support?
The README says it was tested on Unity 2021 LTS, 2022 LTS, 2023 and Unity 6, while package.json declares unity 2022.3 as the minimum.
Is LLMUnity free for commercial games?
The README says it is free to use for both personal and commercial purposes, and the repository license is Apache-2.0.
Can LLMUnity use my own model files?
Yes. The LLM script has a Load model button that accepts your own .gguf model, as an alternative to the Download Model button for the default models.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/undreamai-llmunity)Star history chart for your README
[](https://hysenlabs.com/projects/undreamai-llmunity)Was this useful?