Unity framework for safely integrating local LLMs like llama.cpp.
C#
5
317 commits
updated Sep 22, 2026
Unity × Local LLM Safe Framework
A setup & execution framework for safely integrating local LLMs into Unity.
🎥 Introduction Video
🇯🇵 日本語READMEはこちら

AIDrivenFramework connects Unity games with Local LLM environments through a flexible Executor architecture.
Unity interacts only with a minimal, clean API.
OpenUPM is the recommended installation path:
openupm add com.hatomaru.ai.framework
Alternatively, add the package through Unity Package Manager using the Git URL:
https://github.com/hatomaru/AIDrivenFramework.git?path=src/AIDrivenFramework
[!IMPORTANT] When installing from the Git URL, make sure the required dependencies listed below are available in the project first. They are not bundled in this repository.
Download separately:
llama.cpp.gguf model file(Not included in this repository)
[!TIP] Use pre-built llama.cpp binaries from https://github.com/ggerganov/llama.cpp/releases
Recommended starting model: Llama-3-ELYZA-JP-8B-GGUF
If the environment is not set up:
[!TIP]
IsPrepared()accepts an optionalGenAIinstance.Passing an existing instance prevents the LLM process from shutting down after a health check,
avoids reloading the model twice, and improves startup performance.
using AIDrivenFW.API;
var genAI = new GenAI();
var result = await genAI.Generate("Hello AI");
Debug.Log(result);
You're all set 🎉
The optional AISetup package provides a setup wizard for beginners.
[!TIP] Installation of the optional sample scenes
Manual launch from the menu:
Tools > AIDrivenFW > Optional Packages
It can be installed from the setup window (optional dependency).
This greatly simplifies the initial setup, especially recommended for beginners.
Two sample games are currently included in the optional Example package.
To install them, open Tools > AIDrivenFW > Optional Packages, select both Example Scene and AISetup, and click Install Selected. The current samples reference components from AISetup and will not compile if Example Scene is installed by itself.
| Sample | Name | Overview | Executor used by the sample |
|---|---|---|---|
| 1 | AI NPC Roleplay Chat | Freely talk with an AI NPC while maintaining its personality and conversation history | OllamaHTTPExecutor |
| 2 | Guess the Topic | Ask questions and guess the hidden topic selected by the game | LlamaHTTPExecutor |
Planned, not currently included: Dialogue Battle and AI Story Generator.
using AIDrivenFW.API;
using AIDrivenFW.Config;
using UnityEngine;
public sealed class AIExample : MonoBehaviour
{
private async void Start()
{
var genAI = new GenAI();
var config = ScriptableObject.CreateInstance<GenAIConfig>();
config.sysPrompt = "You are a helpful NPC.";
var isPrepared = await AIDrivenInitializer.Initialize(defaultGenAI: genAI);
if (!isPrepared) return;
var result = await genAI.Generate("Hello AI", config);
Debug.Log(result);
}
}
These are the recommended entry points. Advanced Executor implementations are also public and may evolve as the framework develops.
Unlike simple wrappers, this framework:
Designed for long-term Unity × AI architecture, not just quick calls.
You can replace the execution layer:
var genAI = new GenAI();
genAI.SetExecutor(customExecutor);
Default implementation:
LlamaCliExecutor
This allows HTTP executors or custom process handlers.
The following packages are required:
Earlier Unity versions have not been validated against the current package manifest.
Questions? Experiments? Unity × Local LLM discussion?
👉 Join CommunityGuild
https://discord.gg/dfzwqCHSW2
AIDrivenFramework was created to provide
a safe entry point for local LLM integration in Unity.
Issues, PRs, and feedback are welcome.
Unity framework for safely integrating local LLMs like llama.cpp.
C#
5
317 commits
updated Sep 22, 2026
Unity × Local LLM Safe Framework
A setup & execution framework for safely integrating local LLMs into Unity.
🎥 Introduction Video
🇯🇵 日本語READMEはこちら

AIDrivenFramework connects Unity games with Local LLM environments through a flexible Executor architecture.
Unity interacts only with a minimal, clean API.
OpenUPM is the recommended installation path:
openupm add com.hatomaru.ai.framework
Alternatively, add the package through Unity Package Manager using the Git URL:
https://github.com/hatomaru/AIDrivenFramework.git?path=src/AIDrivenFramework
[!IMPORTANT] When installing from the Git URL, make sure the required dependencies listed below are available in the project first. They are not bundled in this repository.
Download separately:
llama.cpp.gguf model file(Not included in this repository)
[!TIP] Use pre-built llama.cpp binaries from https://github.com/ggerganov/llama.cpp/releases
Recommended starting model: Llama-3-ELYZA-JP-8B-GGUF
If the environment is not set up:
[!TIP]
IsPrepared()accepts an optionalGenAIinstance.Passing an existing instance prevents the LLM process from shutting down after a health check,
avoids reloading the model twice, and improves startup performance.
using AIDrivenFW.API;
var genAI = new GenAI();
var result = await genAI.Generate("Hello AI");
Debug.Log(result);
You're all set 🎉
The optional AISetup package provides a setup wizard for beginners.
[!TIP] Installation of the optional sample scenes
Manual launch from the menu:
Tools > AIDrivenFW > Optional Packages
It can be installed from the setup window (optional dependency).
This greatly simplifies the initial setup, especially recommended for beginners.
Two sample games are currently included in the optional Example package.
To install them, open Tools > AIDrivenFW > Optional Packages, select both Example Scene and AISetup, and click Install Selected. The current samples reference components from AISetup and will not compile if Example Scene is installed by itself.
| Sample | Name | Overview | Executor used by the sample |
|---|---|---|---|
| 1 | AI NPC Roleplay Chat | Freely talk with an AI NPC while maintaining its personality and conversation history | OllamaHTTPExecutor |
| 2 | Guess the Topic | Ask questions and guess the hidden topic selected by the game | LlamaHTTPExecutor |
Planned, not currently included: Dialogue Battle and AI Story Generator.
using AIDrivenFW.API;
using AIDrivenFW.Config;
using UnityEngine;
public sealed class AIExample : MonoBehaviour
{
private async void Start()
{
var genAI = new GenAI();
var config = ScriptableObject.CreateInstance<GenAIConfig>();
config.sysPrompt = "You are a helpful NPC.";
var isPrepared = await AIDrivenInitializer.Initialize(defaultGenAI: genAI);
if (!isPrepared) return;
var result = await genAI.Generate("Hello AI", config);
Debug.Log(result);
}
}
These are the recommended entry points. Advanced Executor implementations are also public and may evolve as the framework develops.
Unlike simple wrappers, this framework:
Designed for long-term Unity × AI architecture, not just quick calls.
You can replace the execution layer:
var genAI = new GenAI();
genAI.SetExecutor(customExecutor);
Default implementation:
LlamaCliExecutor
This allows HTTP executors or custom process handlers.
The following packages are required:
Earlier Unity versions have not been validated against the current package manifest.
Questions? Experiments? Unity × Local LLM discussion?
👉 Join CommunityGuild
https://discord.gg/dfzwqCHSW2
AIDrivenFramework was created to provide
a safe entry point for local LLM integration in Unity.
Issues, PRs, and feedback are welcome.