Godot LLM Framework

An asset by playajames
The page banner background of a mountain and forest
Godot LLM Framework thumbnail image
Godot LLM Framework thumbnail image
Godot LLM Framework thumbnail image
Godot LLM Framework thumbnail image
Godot LLM Framework hero image

Quick Information

0 ratings
Godot LLM Framework icon image
playajames
Godot LLM Framework

The Godot LLM Framework is a powerful addon for the Godot game engine that enables seamless integration of Large Language Models (LLMs) into your game development workflow. This framework provides a unified interface for working with different LLM providers, making it easy to incorporate advanced natural language processing, dialogue generation, and dynamic content creation directly within your Godot projects.Features- Support for multiple LLM providers (currently Anthropic's Claude, with OpenAI support in progress)- Easy-to-use API for generating responses from LLMs- Tool system for extending LLM capabilities with custom functions- Configurable settings for fine-tuning LLM behavior- Message history management for contextual conversations- Asynchronous operations for smooth integration with Godot's event loop

Supported Engine Version
4.0
Version String
1.1.4
License Version
MIT
Support Level
community
Modified Date
2 months ago
Git URL
Issue URL

Godot LLM Framework

Table of Contents

Introduction

The Godot LLM Framework is a powerful addon for the Godot game engine that enables seamless integration of Large Language Models (LLMs) into your game development workflow. This framework provides a unified interface for working with different LLM providers, making it easy to incorporate advanced natural language processing, dialogue generation, and dynamic content creation directly within your Godot projects.

Features

  • Support for multiple LLM providers (currently Anthropic's Claude, with OpenAI support in progress)
  • Easy-to-use API for generating responses from LLMs
  • Tool system for extending LLM capabilities with custom functions
  • Configurable settings for fine-tuning LLM behavior
  • Message history management for contextual conversations
  • Asynchronous operations for smooth integration with Godot's event loop

Installation

  1. Download the godot_llm_framework folder from this repository.
  2. Place the folder in your Godot project's addons/ directory.
  3. Enable the addon in your project settings:
    • Go to "Project" > "Project Settings" > "Plugins"
    • Find "Godot LLM Framework" and check the "Enable" box

Usage

Basic Setup

  1. Add an LLM node to your scene.
  2. Configure the LLM node in the Inspector:
    • Set the Provider (e.g., ANTHROPIC)
    • Enter your API key
    • Adjust other settings as needed (model, temperature, etc.)

Generating Responses

@onready var llm = $LLM

func _ready():
    var response = await llm.generate_response("Tell me a joke about game development.")
    print(response)

Using Tools

  1. Register tools with your LLM instance:
llm.add_tool(WeatherTool.new())
llm.add_tool(UserNameTool.new())
  1. Generate responses that may use tools:
var response = await llm.generate_response("What's the weather like in California, and can you call me by my name?")
print(response)

Creating Custom Tools

  1. Create a new script that extends BaseTool:
extends BaseTool

class_name MyCustomTool

func _init():
    super._init(
        "my_custom_tool",
        "Description of what my tool does",
        {
            "type": "object",
            "properties": {
                "input_param": {
                    "type": "string",
                    "description": "Description of the input parameter"
                }
            },
            "required": ["input_param"]
        }
    )

func execute(input: Dictionary) -> String:
    # Implement your tool's functionality here
    return "Result of my custom tool"
  1. Register your custom tool with the LLM:
llm.add_tool(MyCustomTool.new())

API Reference

For detailed API documentation, please refer to the inline comments in the source code, particularly in the following files:

  • llm.gd
  • llm_provider_api.gd
  • llm_config.gd
  • base_tool.gd

Configuration

The LLM's behavior can be configured through the LLMConfig resource. Key settings include:

  • provider: The LLM provider to use (e.g., ANTHROPIC)
  • api_key: Your API key for the chosen provider
  • model: The specific model to use (e.g., "claude-3-haiku-20240307")
  • temperature: Controls the randomness of the output (0.0 to 1.0)
  • max_message_history: The maximum number of messages to keep in the conversation history

Examples

Check out the example.gd and example.tscn files in the addon folder for a working example of how to use the Godot LLM Framework.

Contributing

Contributions to the Godot LLM Framework are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature or bug fix
  3. Commit your changes with clear, descriptive commit messages
  4. Push your branch and submit a pull request

Please ensure your code follows the existing style and includes appropriate documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

The Godot LLM Framework is a powerful addon for the Godot game engine that enables seamless integration of Large Language Models (LLMs) into your game development workflow. This framework provides a unified interface for working with different LLM providers, making it easy to incorporate advanced natural language processing, dialogue generation, and dynamic content creation directly within your Godot projects.

Features
- Support for multiple LLM providers (currently Anthropic's Claude, with OpenAI support in progress)
- Easy-to-use API for generating responses from LLMs
- Tool system for extending LLM capabilities with custom functions
- Configurable settings for fine-tuning LLM behavior
- Message history management for contextual conversations
- Asynchronous operations for smooth integration with Godot's event loop

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
Godot LLM Framework icon image
playajames
Godot LLM Framework

The Godot LLM Framework is a powerful addon for the Godot game engine that enables seamless integration of Large Language Models (LLMs) into your game development workflow. This framework provides a unified interface for working with different LLM providers, making it easy to incorporate advanced natural language processing, dialogue generation, and dynamic content creation directly within your Godot projects.Features- Support for multiple LLM providers (currently Anthropic's Claude, with OpenAI support in progress)- Easy-to-use API for generating responses from LLMs- Tool system for extending LLM capabilities with custom functions- Configurable settings for fine-tuning LLM behavior- Message history management for contextual conversations- Asynchronous operations for smooth integration with Godot's event loop

Supported Engine Version
4.0
Version String
1.1.4
License Version
MIT
Support Level
community
Modified Date
2 months 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