Skip to main content

LLM Sandbox For Unreal Engine

Project description

Unreal LLM Sandbox

Demo

This project has two components:

What is this?

An Unreal Engine plugin that exposes a Python execution server, enabling:

  • A web-based coding interface connected directly to Unreal
  • LLM-assisted code review with full context of your code and errors
  • Creation and deployment of agentic tools that operate inside the engine

Features

  • Code Execution - All Code is executed directly in Unreal Engine
  • LLM Execution - Ask an LLM for help, with your code/errors in context
  • Agentic Tool Use - LLM can use tools directly in Unreal Engine
  • User Tools - Build and register custom agentic tools instantly

Installation

Clone and Install

Create a new conda env, then:

git clone https://github.com/NeuralVFX/unreal-llm-sandbox 
cd unreal-llm-sandbox
pip install -e .

Set your OPENAI_API_KEY

In Windows, open Powershell and then:

setx OPENAI_API_KEY *Your_api_key*

In Linux, I bet you'll figure it out...

Unreal Server

Follow instructions at unreal-llm-sandbox-unreal to install Unreal side

Usage

Starting the Server

From the menu bar: LLM Sandbox → Start Server

  • The server runs at http://127.0.0.1:8765

Starting the Web Interface

  • Start unreal-llm-sandbox from command line ( outside of Unreal )
  • Open http://localhost:5001/notebook/notebook.ipynb ( or any ipynb name )
  • If the notebook doesn't exist, a blank one is created
  • Notebooks auto-save every 2 seconds
  • Standard .ipynb format, compatible with Jupyter

The web app provides:

  • Notebook Interface - Jupyter-style interface
  • Code Cells - Write and executing Python code in Unreal
  • Markdown Cells - Write notes in Markdown
  • LLM Prompt Cells - Chat with LLMs that have full context of your notebook + agentic control of Unreal

Registering Custom Agent Tools

Syntax to register a new agentic tool:

@register_tool
def spawn_cube(location_x: float, location_y: float, location_z: float):
    """Spawn a cube at the specified world location.
    
    Args:
        location_x: X coordinate
        location_y: Y coordinate  
        location_z: Z coordinate
    
    Returns:
        Name of the spawned actor
    """
    import unreal
    # Your Unreal Python code here
    ...

Either:

  • Run this in a Code Cell
  • Or create a new python file in your project's Content/Python/tools directory

Tool Discovery:

  • Tools registered in Code Cells are instantly availible to the LLM
  • Tools added to Content/Python/tools are discovered on project restart

To use:

  • Open a Prompt Cell, Click the 🛠️ icon to activate Unreal tools, and write a prompt!

Requirements

  • Unreal Engine 5.6
  • A conda env for the web-server
  • An Open AI API key

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unreal_llm_sandbox-0.0.2.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unreal_llm_sandbox-0.0.2-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file unreal_llm_sandbox-0.0.2.tar.gz.

File metadata

  • Download URL: unreal_llm_sandbox-0.0.2.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for unreal_llm_sandbox-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9720d213f7c285fa16ddcb6b665ce68f3e2951fbf2b12baa736ce89c6ff934f3
MD5 08cd8eba8ed9d5974a4421236791c3e1
BLAKE2b-256 6df99e41b14a19836649955361113c92a3fde46f60e158d743f5ab94b7cae228

See more details on using hashes here.

File details

Details for the file unreal_llm_sandbox-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for unreal_llm_sandbox-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 732632afcf3b8514d156caf8ae6084c2fd1b2078d7e56ae872026a347d944a10
MD5 15eaa04d93178b32083798f44136c884
BLAKE2b-256 68f0a3474cd73f49691f76cb05fae3dbff05618a53d95cb07af9e8d9dbc355d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page