
LLM Toolkit for Godot
A downloadable tool
LLM Toolkit lets your Godot game talk to language models without freezing: local ones through LM Studio, Ollama or llama.cpp, or OpenAI, Claude and any OpenAI-style server. Innkeepers who answer what the player actually said, quests and items written as JSON your game can use, barks, hints, descriptions. Pure GDScript, no plugins or binaries.
Try it free: the free demo download below is LLM Toolkit Lite. It has the same API and talks to local models in plain text. Code you write with it runs unchanged here.
What it does
- One API, many models. LM Studio, Ollama, llama.cpp, vLLM, OpenAI, Claude, or any server with an OpenAI-style API. Switching doesn't change your game code.
- Streaming that never blocks. Replies arrive piece by piece, ready to type into a speech bubble. No threads: requests poll once per frame. Slow local models never hit a timeout; a server that goes silent does.
- JSON you can trust. Give it a JSON schema. The server is asked to follow it the strongest way it accepts. Whatever comes back is repaired (code fences, prose around it, comments, single quotes, trailing commas, Python's None, replies cut off part-way), adjusted to the schema ("12" read as a number, "Rare" matched to "rare", too many items trimmed) and validated, with errors that say exactly what's wrong:
$.abilities[2].power: 12 > maximum 10. If it still fails, the model is shown the problems and asked again. - Built for games. Retries with backoff for rate limits and busy servers, a queue so a local model handles one request at a time, cancelling, conversations that remember and save with your game, and thinking models' reasoning kept out of the reply.
- Testable without a model. A mock provider plays back scripted replies or errors, streamed like a real server.
Quick start
var llm := Llm.new(LlmProvider.lm_studio())
var task := llm.chat("You are the innkeeper. Greet a tired traveller.")
task.text_delta.connect(func(piece): $Speech.text += piece)
var result := await task.wait()
var potion := await llm.ask_json("A potion for the shop.", POTION_SCHEMA)
if potion.ok:
shop.add(potion.value.name, potion.value.price)
In the download
addons/llm_toolkit/: the addon. Copy it into your project; there's no plugin to enable.- A demo, the Rusty Flagon: talk to the innkeeper and forge quests as JSON, with every repair shown. It runs with no server at all (an offline mode with deliberately messy JSON), or with any of the servers above.
- 201 automated tests, run against a scripted HTTP server: streaming, split UTF-8, stalls, dropped connections, rate limits, JSON-mode refusals, and the JSON repair and schema rules.
- A full README with every class, setting and error.
Requirements
- Godot 4.7 (built and tested on 4.7.2). Pure GDScript.
- A model to talk to: LM Studio or Ollama on the player's machine, or a cloud API. Keep API keys out of your builds; the README explains how.
- Web exports haven't been tested yet.
License: use it in any number of your own projects, free or commercial, and ship it inside them. Please don't resell or redistribute the addon itself. Demo font: Nunito (SIL Open Font License). Demo portrait: KayKit Adventurers by Kay Lousberg (CC0).
Made by Sir Debugalot. More Godot add-ons: excalibug.com. Support: Ko-fi.
Purchase
In order to download this tool you must purchase it at or above the minimum price of $5 USD. You will get access to the following files:
Download demo
Development log
- LLM Toolkit 1.0 is out6 days ago





Leave a comment
Log in with itch.io to leave a comment.