Description
ShameGPT for Minetest
ShameGPT is a local AI chatbot integration for Minetest. It allows players to interact with an AI model running on their own machine via Ollama. By default, it is optimized for lightweight models like Gemma 3 (270m) to ensure a smooth gaming experience even on modest hardware.
🚀 Features
-
Local & Private: No API keys required. Your data never leaves your computer.
-
Asynchronous Processing: The game won't freeze while the AI is thinking; responses appear in chat once ready.
-
Highly Configurable: Choose any model you have installed in Ollama via the Minetest settings menu.
-
Sanitized Output: Automatically cleans ANSI escape codes and formatting artifacts from AI responses.
🛠 Prerequisites
Before installing this mod, you must have the following:
- Ollama installed and running: Download it from ollama.com.
- Minetest 5.0 or later.
- An AI Model: By default, this mod looks for
gemma3:270m. You can pull it using:
📥 Installation
- Clone or download this repository into your Minetest
mods folder.
- Rename the folder to
shamegpt.
- Critical Security Step: Because this mod executes system commands to talk to Ollama, you must grant it trusted status. Add the following line to your
minetest.conf file:
secure.trusted_mods = shamegpt
⚙️ Configuration
You can change the AI model used by the mod in the Settings tab of the Minetest main menu:
🎮 Usage
Once in-game, any player with the interact privilege can use the following command:
/shamegpt <your message here>
Example:
/shamegpt Why is there a creeper in my house? (Wait... wrong game!)
Security Note
The mod includes a safety filter that blocks symbols like ; & | [cite_start]$ to prevent command injection, ensuring that players can only send text prompts to the AI.
📝 License
This project is licensed under the same terms as Minetest (LGPL-2.1).
Releases
2026-02-25 20:13 UTC
Windows Implementation (Experimental)
A command was added that allows receiving responses from ollama via the Windows console. However, this recent implementation is experimental and therefore does not have the same optimizations used in Linux.
2026-02-21 19:19 UTC
Error Handling
Current Features and Changes
-
Robust Configuration Validation: The mod checks if model_name is empty or consists only of whitespace, automatically defaulting to gemma3:270m in those cases.
-
Asynchronous Processing: It uses a globalstep monitor and system-level background execution (&) to prevent the Minetest server from freezing while the AI generates a response.
-
ANSI Escape Sequence Cleaning: A clean_ai_text function is implemented to strip terminal formatting codes, carriage returns, and leading/trailing whitespace from the AI's output.
-
Security Prompt Filtering: The is_safe_prompt function uses pattern matching to block dangerous characters (like ;, &, |, and $) that could be used for command injection.
-
Binary Presence Check: The mod utilizes the command_exists function to verify if the ollama executable is available on the system before attempting a request.
-
Request Concurrency Management: An active_requests table tracks ongoing queries per player to prevent users from spamming the AI service.
-
Automated Cleanup: Once a response is read, the mod automatically deletes the temporary result and "done" signal files from the system.
System Limitations
[!IMPORTANT]
Linux Only: The current implementation relies on Unix-specific commands and shell operators such as which, touch, 2>/dev/null, and the background operator &. Consequently, it only works on Linux.
Language: All user-facing messages, command descriptions, and error notifications are currently written only in English.
2026-02-17 23:28 UTC
No More Slow Chunks
🛠 Improvements & Bug Fixes
-
Asynchronous AI Processing: Fixed the critical issue where the game world (chunks) would stop loading and the chat would freeze while waiting for a response from the AI.
-
Non-Blocking Requests: The mod now utilizes a background process to run Ollama queries, allowing players to continue building and exploring while the chatbot processes their request.
-
Timer-Based Polling: Integrated a global step timer that checks for AI completion every 0.5 seconds, preventing CPU spikes and ensuring smooth frame rates.
-
Enhanced Security: Added a prompt validation layer to block forbidden characters (like ;, &, or $) to ensure safe command execution.
All releases
Threads
New thread
Information
Provides
shamegpt
Dependencies
- Required
-
No required dependencies
Information
- Type
- Mod
- Technical Name
- shamegpt
- Languages
-
English
- License
-
LGPL-2.1-only
- Maintenance State
- Beta
- Added
- 2026-02-17 23:05 UTC
- Maintainers
-
LichenCrown