Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

GodoLM

An asset by gyre
The page banner background of a mountain and forest
GodoLM hero image

Quick Information

0 ratings
GodoLM icon image
gyre
GodoLM

Provides tooling to generate godot resources at runtime using language models. Currently supports OpenRouter.

Supported Engine Version
4.4
Version String
0.1.0
License Version
MIT
Support Level
community
Modified Date
29 days ago
Git URL
Issue URL

GodoLM

A high-level interface for invoking language models in Godot games, using JSONSchema based constraints to parse responses into arbitrary resources.

Installation

  1. Download the GodoLM addon from the Godot Asset Library or from GitHub
  2. Place the addons/GodoLM folder in your project's addons directory
  3. Enable the plugin in Project Settings → Plugins

Usage

Basic Setup

  1. Add a LanguageModelConnection node to your scene
  2. Configure a provider (e.g., OpenRouterProvider) with your API key.
  3. Create requests - add context and a target resource type, and get a new resource back.

Code Example

GodoLM supports structured responses using JSON Schema:

Define a resource:

# Define a resource for structured data
class_name Sword
extends Resource

const PROPERTY_DESCRIPTIONS = {
    "sword_name": "The name of the sword",
    "blade_material": "Material the blade is made from (e.g. steel, iron, silver, ice)",
    "hilt_material": "Material the handle is made from (e.g. leather, wood, bone, carbon fibre)",
    "description": "A detailed description of the sword's appearance and history",
    "damage": "The base damage points this sword deals per hit",
    "speed": "Attack speed modifier (higher is faster)",
    "length": "The length of the sword in centimeters",
    "blade_color": "Color of the blade in hex format (e.g. #0080FF)",
    "accent_color": "Color of any decorative accents or trim in hex format (e.g. #FFD700)",
    "hilt_color": "Color of the sword's hilt in hex format (e.g. #8B4513)"
}

@export var sword_name: String
@export var blade_material: String
@export var hilt_material: String
@export var description: String
@export var damage: int
@export var speed: float
@export var length: float
@export var blade_color: Color
@export var accent_color: Color
@export var hilt_color: Color

Then use the LanguageModelRequest Node to create requests and parse responses:

# Send a request.
func send_sword_request():
    var request = $LanguageModelConnection.create_request()
    request.add_context("Something found at the bottom of a lake.")
    $LanguageModelConnection.send_request(request)

# Handle the completed request when $LanguageModelConnection completes the request.
func _on_request_completed(response, request_id):
    var sword = response as Sword
    if sword:
        print("Received sword: ", sword.sword_name)
        print("Description: ", sword.description)
        print("Materials: ", sword.blade_material, ", ", sword.hilt_material)        

Providers

GodoLM currently supports OpenRouter.

Provides tooling to generate godot resources at runtime using language models. Currently supports OpenRouter.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
GodoLM icon image
gyre
GodoLM

Provides tooling to generate godot resources at runtime using language models. Currently supports OpenRouter.

Supported Engine Version
4.4
Version String
0.1.0
License Version
MIT
Support Level
community
Modified Date
29 days ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers