Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be πŸ“–

Godot LLM Template

An asset by Adriankhl
The page banner background of a mountain and forest
Godot LLM Template hero image

Quick Information

0 ratings
Godot LLM Template icon image
Adriankhl
Godot LLM Template

Demonstrate how to use the "Godot LLM" plugin.# How to use1. Get `Godot LLM` directly from the godot asset library, or download the addon from [godot-llm](https://github.com/Adriankhl/godot-llm) and place it to the `addons` folder2. Download models * Text generation recommendation: Meta-Llama-3-8B-Instruct-Q5_K_M.gguf from https://huggingface.co/lmstudio-community/Meta-Llama-3-8B-Instruct-GGUF/tree/main or Phi-3-mini-4k-instruct-Q2_K.gguf from https://huggingface.co/bartowski/Phi-3-mini-4k-instruct-GGUF/tree/main for low-end devices such as Android phone * Similarity recommendation: mxbai-embed-large-v1.Q5_K_M.gguf from https://huggingface.co/ChristianAzinn/mxbai-embed-large-v1-gguf/tree/main * Image to text recommendation: llava-phi-3-mini-int4.gguf from https://huggingface.co/xtuner/llava-phi-3-mini-gguf/tree/main, also download the `llava-phi-3-mini-mmproj-f16.gguf` from the same page* Vector Database setting is similar to `Similarity`3. Open the application with GodotYou will see 4 modes: `Text Generation`, `Similarity`, `Image to Text`, and `Vector Database`In each mode, you need to clide `Model` to point to the correct model `gguf` file. Additionally, in `Image to Text` mode, you need to click `Mmproj` to point to your `*mmproj*gguf` file.# Text GenerationYou will see there are 3 generation mode: `Simple`, `Instruct`, and `Interactive`. ## `Simple` modeJust edit the prompt and click `Generate`. Click `Stop` to stop the generation.You choose `None` schema or `Person` schema, if you choose `None` schema, the model will generate the information of a character with Json format.## `Instruct` mode (currently disabled)Click `Start` first with empty prompt, then modify the prompt and click `Continue` when it is available to talk to the AI. This is an interactive mode. Whenever you see the `Continue` button is available, either input something in the prompt and click `Continue` to send the input, or simply click `Continue` to let the AI talk itself.## `Interactive` modeSimilar to the instruct mode, except that it relies on a good initial prompt and additoinal reverse prompt and input suffix settings to generate a smooth conversation. The preset prompt should work decently well, click the `Start` button with the preset prompt and start talkin to the AI.# SimilarityInput prompts to compute the `Embedding`, or input two prompts to calculate their `Similarity`# Image to TextSelect an `Image` from your device. Alternative, click `From View` to capture your game screen as the image. You can `Compute Base64` encoding for your image, or decode a base64 string back to `Compute Image`. Edit the prompt, and generate text from `Image`, `Base64`, or `View` (your game screen).# Vector DatabaseClick `Metadata: id, year` to define the metadata of the tables, then click `Create tables` to create a some tables for embedding storage and retrieval. Click `Store text` to split the document into chunks and store into the database, you may also click `Split text` to see the chunks. Click `Retrieve` to retrive three most similar text chunks with the upper left prompt, which satisfy the sql-where-clause in the middle right. You may also turn on "Verbose stdout", modify the upper prompt to a valid sql statement, and click execute to run the sql statement directly, you will see the result in godot log.

Supported Engine Version
4.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
10 months ago
Git URL
Issue URL

Godot LLM template

A template/demo to show how to use the godot-llm addon

Text generation

README

Similarity

README

Image to text

README

Vector database

README

How to use

You may simply download the Android apk in the release page to try it out for Android devices.

For Windows/Linux:

  1. Get the Godot LLM Template from the Godot asset library, or clone this project: git clone https://github.com/Adriankhl/godot-llm-template.git
  2. Get Godot LLM directly from the godot asset library, or download the addon from godot-llm and place it to the addons folder
  3. Download models
  4. Run the project with Godot or export an Android apk (requires the Manage External Storage permission)

Download models

Folder and file structure:

β”œβ”€β”€ addons
β”‚   └── godot_llm
β”‚       β”œβ”€β”€ bin
β”‚       β”‚   β”œβ”€β”€ libgodot_llm.android.debug.aarch64.so
β”‚       β”‚   β”œβ”€β”€ libgodot_llm.android.release.aarch64.so
β”‚       β”‚   β”œβ”€β”€ libgodot_llm.linux.debug.x86_64.so
β”‚       β”‚   β”œβ”€β”€ libgodot_llm.linux.release.x86_64.so
β”‚       β”‚   β”œβ”€β”€ libgodot_llm.windows.debug.amd64.dll
β”‚       β”‚   └── libgodot_llm.windows.release.amd64.dll
β”‚       └── godot_llm.gdextension
β”œβ”€β”€ db.gd
β”œβ”€β”€ db.tscn
β”œβ”€β”€ icon.svg
β”œβ”€β”€ icon.svg.import
β”œβ”€β”€ image_to_text.gd
β”œβ”€β”€ image_to_text.tscn
β”œβ”€β”€ LICENSE
β”œβ”€β”€ main.gd
β”œβ”€β”€ main.tscn
β”œβ”€β”€ media
β”œβ”€β”€ project.godot
β”œβ”€β”€ README.md
β”œβ”€β”€ similarity.gd
β”œβ”€β”€ similarity.tscn
β”œβ”€β”€ text_generation.gd
└── text_generation.tscn

You can now open the application with Godot

The application

You will see 4 modes: Text Generation, Similarity, Image to Text, and Vector Database.

In each mode, you need to click Model to point to the correct model gguf file. Addition, in Image to Text mode, you need to click Mmproj to point to your *mmproj*gguf file.

Text Generation

You will see there are 3 generation mode: Simple, Instruct, and Interactive.

Simple mode

Just edit the prompt and click Generate. Click Stop to stop the generation.

You choose None schema or Person schema, if you choose None schema, the model will generate the information of a character with Json format.

Instruct mode (currently this is disabled)

Click Start first with empty prompt, then modify the prompt and click Continue when it is available to talk to the AI. This is an interactive mode. Whenever you see the Continue button is available, either input something in the prompt and click Continue to send the input, or simply click Continue to let the AI talk itself.

Interactive mode

Similar to the instruct mode, except that it relies on a good initial prompt and additoinal reverse prompt and input suffix settings to generate a smooth conversation. The preset prompt should work decently well, click the Start button with the preset prompt and start talkin to the AI.

Similarity

Input prompts to compute the Embedding, or input two prompts to calculate their Similarity

Image to Text

Select an Image from your device. Alternative, click From View to capture your game screen as the image. You can Compute Base64 encoding for your image, or decode a base64 string back to Compute Image. Edit the prompt, and generate text from Image, Base64, or View (your game screen).

Vector Database

Click Metadata: id, year to define the metadata of the tables, then click Create tables to create a some tables for embedding storage and retrieval. Click Store text to split the document into chunks and store into the database, you may also click Split text to see the chunks. Click Retrieve to retrive three most similar text chunks with the upper left prompt, which satisfy the sql-where-clause in the middle right. You may also turn on "Verbose stdout", modify the upper prompt to a valid sql statement, and click execute to run the sql statement directly, you will see the result in godot log.

Demonstrate how to use the "Godot LLM" plugin.

# How to use
1. Get `Godot LLM` directly from the godot asset library, or download the addon from [godot-llm](https://github.com/Adriankhl/godot-llm) and place it to the `addons` folder

2. Download models
* Text generation recommendation: Meta-Llama-3-8B-Instruct-Q5_K_M.gguf from https://huggingface.co/lmstudio-community/Meta-Llama-3-8B-Instruct-GGUF/tree/main or Phi-3-mini-4k-instruct-Q2_K.gguf from https://huggingface.co/bartowski/Phi-3-mini-4k-instruct-GGUF/tree/main for low-end devices such as Android phone
* Similarity recommendation: mxbai-embed-large-v1.Q5_K_M.gguf from https://huggingface.co/ChristianAzinn/mxbai-embed-large-v1-gguf/tree/main
* Image to text recommendation: llava-phi-3-mini-int4.gguf from https://huggingface.co/xtuner/llava-phi-3-mini-gguf/tree/main, also download the `llava-phi-3-mini-mmproj-f16.gguf` from the same page
* Vector Database setting is similar to `Similarity`

3. Open the application with Godot

You will see 4 modes: `Text Generation`, `Similarity`, `Image to Text`, and `Vector Database`

In each mode, you need to clide `Model` to point to the correct model `gguf` file. Additionally, in `Image to Text` mode, you need to click `Mmproj` to point to your `*mmproj*gguf` file.

# Text Generation

You will see there are 3 generation mode: `Simple`, `Instruct`, and `Interactive`.

## `Simple` mode
Just edit the prompt and click `Generate`. Click `Stop` to stop the generation.

You choose `None` schema or `Person` schema, if you choose `None` schema, the model will generate the information of a character with Json format.

## `Instruct` mode (currently disabled)
Click `Start` first with empty prompt, then modify the prompt and click `Continue` when it is available to talk to the AI. This is an interactive mode. Whenever you see the `Continue` button is available, either input something in the prompt and click `Continue` to send the input, or simply click `Continue` to let the AI talk itself.

## `Interactive` mode
Similar to the instruct mode, except that it relies on a good initial prompt and additoinal reverse prompt and input suffix settings to generate a smooth conversation. The preset prompt should work decently well, click the `Start` button with the preset prompt and start talkin to the AI.

# Similarity
Input prompts to compute the `Embedding`, or input two prompts to calculate their `Similarity`

# Image to Text
Select an `Image` from your device. Alternative, click `From View` to capture your game screen as the image. You can `Compute Base64` encoding for your image, or decode a base64 string back to `Compute Image`. Edit the prompt, and generate text from `Image`, `Base64`, or `View` (your game screen).

# Vector Database
Click `Metadata: id, year` to define the metadata of the tables, then click `Create tables` to create a some tables for embedding storage and retrieval. Click `Store text` to split the document into chunks and store into the database, you may also click `Split text` to see the chunks. Click `Retrieve` to retrive three most similar text chunks with the upper left prompt, which satisfy the sql-where-clause in the middle right. You may also turn on "Verbose stdout", modify the upper prompt to a valid sql statement, and click execute to run the sql statement directly, you will see the result in godot log.

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 Template icon image
Adriankhl
Godot LLM Template

Demonstrate how to use the "Godot LLM" plugin.# How to use1. Get `Godot LLM` directly from the godot asset library, or download the addon from [godot-llm](https://github.com/Adriankhl/godot-llm) and place it to the `addons` folder2. Download models * Text generation recommendation: Meta-Llama-3-8B-Instruct-Q5_K_M.gguf from https://huggingface.co/lmstudio-community/Meta-Llama-3-8B-Instruct-GGUF/tree/main or Phi-3-mini-4k-instruct-Q2_K.gguf from https://huggingface.co/bartowski/Phi-3-mini-4k-instruct-GGUF/tree/main for low-end devices such as Android phone * Similarity recommendation: mxbai-embed-large-v1.Q5_K_M.gguf from https://huggingface.co/ChristianAzinn/mxbai-embed-large-v1-gguf/tree/main * Image to text recommendation: llava-phi-3-mini-int4.gguf from https://huggingface.co/xtuner/llava-phi-3-mini-gguf/tree/main, also download the `llava-phi-3-mini-mmproj-f16.gguf` from the same page* Vector Database setting is similar to `Similarity`3. Open the application with GodotYou will see 4 modes: `Text Generation`, `Similarity`, `Image to Text`, and `Vector Database`In each mode, you need to clide `Model` to point to the correct model `gguf` file. Additionally, in `Image to Text` mode, you need to click `Mmproj` to point to your `*mmproj*gguf` file.# Text GenerationYou will see there are 3 generation mode: `Simple`, `Instruct`, and `Interactive`. ## `Simple` modeJust edit the prompt and click `Generate`. Click `Stop` to stop the generation.You choose `None` schema or `Person` schema, if you choose `None` schema, the model will generate the information of a character with Json format.## `Instruct` mode (currently disabled)Click `Start` first with empty prompt, then modify the prompt and click `Continue` when it is available to talk to the AI. This is an interactive mode. Whenever you see the `Continue` button is available, either input something in the prompt and click `Continue` to send the input, or simply click `Continue` to let the AI talk itself.## `Interactive` modeSimilar to the instruct mode, except that it relies on a good initial prompt and additoinal reverse prompt and input suffix settings to generate a smooth conversation. The preset prompt should work decently well, click the `Start` button with the preset prompt and start talkin to the AI.# SimilarityInput prompts to compute the `Embedding`, or input two prompts to calculate their `Similarity`# Image to TextSelect an `Image` from your device. Alternative, click `From View` to capture your game screen as the image. You can `Compute Base64` encoding for your image, or decode a base64 string back to `Compute Image`. Edit the prompt, and generate text from `Image`, `Base64`, or `View` (your game screen).# Vector DatabaseClick `Metadata: id, year` to define the metadata of the tables, then click `Create tables` to create a some tables for embedding storage and retrieval. Click `Store text` to split the document into chunks and store into the database, you may also click `Split text` to see the chunks. Click `Retrieve` to retrive three most similar text chunks with the upper left prompt, which satisfy the sql-where-clause in the middle right. You may also turn on "Verbose stdout", modify the upper prompt to a valid sql statement, and click execute to run the sql statement directly, you will see the result in godot log.

Supported Engine Version
4.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
10 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