The project is in 6000.0.29f1 but should work under any recent Unity version.
git clone --recursive https://github.com/andyroiiid/UnityLLMDemo.git
Or if you've already cloned without --recursive
:
git submodule update --init
- ONNX Runtime - MIT License
- Assets/Microsoft.ML.OnnxRuntimeGenAI/onnxruntime.dll
- Assets/Microsoft.ML.OnnxRuntimeGenAI/onnxruntime_providers_shared.dll
- ONNX Runtime generate() API - MIT License
- Assets/Microsoft.ML.OnnxRuntimeGenAI/*.cs
- Assets/Microsoft.ML.OnnxRuntimeGenAI/onnxruntime-genai.dll
- Llama 3.2 ONNX models - LLAMA 3.2 Community License
- Assets/StreamingAssets/Llama-3.2-1B-Instruct-ONNX/*
The model interface and chat history implementation.
You can remove _history
-related code if you just need an one-off completion.
Check https://github.com/microsoft/onnxruntime-genai/tree/main/examples for more examples.
A (very) basic UI controller.
Just one StringBuilder
helper function.
Here's a reminder that this repository is GPL-licensed.
The code is super simple, and you can write your own in less than an hour - just don't copy paste directly from this repo.