π¦ SimpleOllamaUnity
November 2, 2025 Β· View on GitHub
π¦ SimpleOllamaUnity β Unity Extension
Listed in Ollama Community Integrations
Listed in ai-gamedev-tools
Β
Communicate with local LLMs in Unity using Ollama β in just two lines of code.
π Overview
SimpleOllamaUnity is an Unity extension that lets you communicate with Ollama in just two lines of code! It also works at runtime, so you can use it in your games!
You can easily configure the following for a quick start:
- π€ Model
- π System prompt
- π Ollama URI
- π Reasoning (optional β can be disabled)
π¦ Installation
- Download the latest .unitypackage file from the Releases page.
- Drag & drop it into your Unity project window.
- Unity will automatically compile the editor extension.
No additional setup required.
The Plugins folder includes several .dll files required for integration.
π» Usage
var ollama = new Ollama(new OllamaConfig(
modelName: "qwen2.5:3b",
systemPrompt: "Your answer mustn't be more than 10 words"
));
var response = await ollama.SendMessage(new OllamaRequest(
userPrompt: "When was GitHub created?"
));
Yes, thatβs it β only two lines of code! π
Β
To use a custom server URI:
var ollama = new Ollama(new OllamaConfig(
modelName: "qwen2.5:3b",
systemPrompt: "Your answer mustn't be more than 10 words",
uri: "http://my-custom-server.local:3000/api/process"
));
Β
You can also remove reasoning from models that can do it:
var response = await ollama.SendMessage(new OllamaRequest(
userPrompt: "When was GitHub created?",
clearThinking: true
));
This will remove all reasoning (from <think> to </think>).
Β Β
π§ͺ Full Example:
using UnityEngine;
using HardCodeDev.SimpleOllamaUnity;
public class Test : MonoBehaviour
{
private async void Start()
{
var ollama = new OllamaBase(new OllamaConfig(
modelName: "qwen2.5:3b",
systemPrompt: "Your answer mustn't be more than 10 words"
));
var response = await ollama.SendMessage(new OllamaRequest(
userPrompt: "When was GitHub created?"
));
Debug.Log(response); // Prints LLM response to the console
}
}
π License
This project is licensed under the MIT License.
See the LICENSE file for full terms.