Run local ONNX models in Spigot.
A Spigot plugin that runs local ONNX LLM models, provides in-game chat via a trigger, and exposes a Bukkit service API for dependent plugins.
plugins/onnx-spigot/models/@llm <message>)onnxspigot.llm.useServicesManagerPlace your model files in:
plugins/onnx-spigot/models/<model-name>/
Required files:
*.onnx (for example model.onnx)tokenizer.json, orvocab.jsonOptional files:
merges.txt (used for better BPE merges when vocab.json is used)tokenizer_config.json (special token IDs)config.json (model metadata)Set <model-name> in plugins/onnx-spigot/config.yml under llm.model.
Download the model from: https://huggingface.co/onnx-community/Qwen3-0.6B-ONNX
Create a folder at plugins/onnx-spigot/models/Qwen3-0.6B-ONNX/.
Copy the model files into that folder:
*.onnx (for example model.onnx)tokenizer.json or vocab.jsonmerges.txt, tokenizer_config.json, config.jsonSet this in plugins/onnx-spigot/config.yml:
llm:
model: "Qwen3-0.6B-ONNX"
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import tr.alperendemir.onnxSpigot.api.OnnxChatApi;
RegisteredServiceProvider<OnnxChatApi> registration =
Bukkit.getServicesManager().getRegistration(OnnxChatApi.class);
if (registration != null) {
OnnxChatApi api = registration.getProvider();
api.generate("Explain redstone clocks in one paragraph.")
.thenAccept(response -> Bukkit.getLogger().info(response));
}
./gradlew.bat clean build