Docs/Bring Your Own Model in Unity

Bring Your Own Model in Unity

Run your characters on a local model your game ships, in any supported model family.

A local project can run its characters on a model file your game ships instead of a MistScale model. You pick the model's family in the dashboard and point the SDK at the file. MistScale writes every prompt in that family's format, so memory, knowledge, behaviour rules and relationships work the same way.

Supported families

A family is a chat template. Any GGUF model that uses one of these templates works, including your own fine-tunes, as long as the file keeps the template.

Qwen 3 (ChatML)
Qwen 3 and Qwen 3.5. Qwen 2.5 is not supported: the prompt turns Qwen 3 reasoning off with a block Qwen 2.5 does not know.
Llama 3
Models with the Llama 3 template, for example Llama 3.1, 3.2 and 3.3.
Mistral
Models with the Mistral template that has a system prompt, for example Ministral 3 and Mistral Small 3.
Gemma 4
Models with the Gemma 4 template. Gemma 3 uses a different template and is not supported.
Phi-4
Models with the Phi-4 template, for example Phi-4-mini.

1. Choose your own model in the dashboard

On the project Overview, select Change next to the model. Choose Local, then Your own model, then the family your file belongs to. Every character in the project uses it.

2. Point the SDK at the file

Call MistscaleLocal.UseOwnModel with the file's path before any local character registers. The SDK loads that file and downloads nothing.

OwnModelSetup.cs
using System.IO;
using Mistscale.SDK;
using UnityEngine;

public class OwnModelSetup : MonoBehaviour
{
    void Awake()
    {
        // The GGUF your game ships. It must be a real file on disk.
        string path = Path.Combine(Application.persistentDataPath, "models", "my-model.gguf");
        MistscaleLocal.UseOwnModel(path);
    }
}
Android
Files under StreamingAssets live inside the APK on Android, so they are not files on disk. Copy the model to Application.persistentDataPath first, then pass that path.
The model and its licence are yours
You choose the model, get it from its publisher and follow its licence, including any attribution it asks for. MistScale never hosts, downloads or distributes your model file.
SDK version and model changes
Your own model needs an SDK version that has MistscaleLocal.UseOwnModel; older versions cannot run its prompts. The game loads one model per session, so after you change the project's model in the dashboard, restart the game.

Troubleshooting

No file found
The Console says no file was found at the path. Call UseOwnModel before characters register, with a path that exists. Until then the local model does not start and characters cannot answer locally.
FAMILY_MISMATCH
The file's chat template is not the family the project is set to, so replies come out broken. Change the family in the dashboard to match the file, or ship a file of that family.
UNSUPPORTED_FAMILY
The project's family is not one MistScale supports. Choose a family from the list above.
MESSAGE_TOO_LONG
The player's message and the character's rules together do not fit the local model's context. Shorter messages fit.
No chat template
The file has no chat template, so the SDK cannot check its family. It still runs; make sure the family in the dashboard is right.