H5N3RG 2b263e18a7 Update mod.conf
Signed-off-by: H5N3RG <janguenni13@web.de>
2025-09-18 12:24:29 +02:00
2025-09-18 12:23:12 +02:00
2025-09-11 11:34:45 +02:00
2025-09-18 12:24:29 +02:00
2025-09-18 12:23:54 +02:00
2025-09-11 22:08:22 +02:00
2025-09-11 11:34:45 +02:00

LLM Connect

A Minetest mod that connects the game to a Large Language Model (LLM) using an OpenAI-compatible API endpoint.

Purpose

This mod allows players to interact with an LLM directly within the Minetest chat.
It sends the player's chat message along with relevant in-game context—such as server info, installed mods, and available materials—to a remote API endpoint.
This enables the LLM to provide highly specific and helpful answers, e.g., on crafting items or locating resources in-game.

Features

  • In-game AI Chat: Send prompts to the LLM using a simple chat command.
  • Context-Aware: Automatically includes crucial server and material data in the prompts.
  • Configurable: API key, endpoint URL, and model can be set via chat commands or the in-game menu.
  • Conversation History: Maintains short-term conversation history for more relevant responses.
  • Robust Token Handling: Supports sending max_tokens as an integer to avoid floating-point issues; optionally configurable via settingtypes.txt or chat commands.

Implementation

  • Built with Minetest's HTTP API for sending requests to an external, OpenAI-compatible endpoint.
  • Structured to be understandable and extendable for new contributors.
  • Version: 0.7.7

Requirements

  • A running Minetest server.
  • An API key from a supported service.
  • Access to external AI services (online and/or offline).

Supported API Endpoints

Successfully tested with:

  • Open WebUI
  • LM Studio
  • Mistral AI
  • OpenAI API
  • Ollama and LocalAI (integer max_tokens ensures compatibility)

Commands

  • /llm_setkey <key> [url] [model] Sets the API key, endpoint URL, and model.
  • /llm_setmodel <model> Sets the LLM model to be used.
  • /llm_set_endpoint <url> Sets the API endpoint URL.
  • /llm_set_context <count> [player] Sets the maximum context length for a player or all players.
  • /llm_reset Resets the conversation history for the current player.
  • /llm <prompt> Sends a message to the LLM.
  • /llm_integer Forces max_tokens to be sent as an integer (default).
  • /llm_float Sends max_tokens as a float (optional, experimental).

Potential for Expansion

  • Add support for more API endpoints.
  • Integrate with additional in-game events or data sources (player inventory, world data).
  • Improve error handling and performance.
  • Create a graphical user interface (formspec) for configuration instead of relying solely on chat commands.

Contributing

This project is in an early stage and welcomes contributions:

  • Even small fixes help, especially with API integration, UI improvements, and performance tuning.
  • Contributions from experienced developers are highly welcome.
  • The goal is to build a robust, maintainable mod for the Minetest community.
Description
A mod collection for connecting the Luanti to various Ai services.
Readme 122 KiB
Languages
Lua 100%