A Discord bot made to prevent scams on the Liquid AI Community Server
- Keyword moderation — automatically delete, kick, ban, or mute users based on configurable word lists
- AI scam detection — uses a local LLM to flag and delete likely scam messages above a character threshold
- Debug mode — when enabled, the bot processes all messages including those from admins and itself
- Python 3.9+
- llama-cpp-python installed with GPU support (recommended) or CPU
- A Discord bot token with the
Message Content Intentenabled
REM 1. Clone the repository
git clone <your-repo-url>
cd <repo-folder>
REM 2. Create and activate a virtual environment
python -m venv venv
venv\Scripts\activate
REM 3. Install llama-cpp-python (CPU only - for GPU support install CUDA and use cu124 wheel)
pip install llama-cpp-python
REM 4. Install Python dependencies
pip install discord.py python-dotenv tomli
REM 5. Download the model
REM Download LFM2.5-1.2B-Instruct-Q4_K_M.gguf from:
REM https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct-GGUF
REM Place it in a "models" folder in the project root# 1. Clone the repository
git clone <your-repo-url>
cd <repo-folder>
# 2. Install system dependencies
sudo apt update
sudo apt install -y build-essential cmake git libcurl4-openssl-dev python3-dev python3-venv
# 3. Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
# 4. Install llama-cpp-python
# For CUDA GPU support:
pip install llama-cpp-python --force-reinstall --no-cache-dir \
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124
# For CPU only (slower, no GPU):
# pip install llama-cpp-python
# 5. Install Python dependencies
pip install discord.py python-dotenv tomli
# 6. Create models directory and download the model
mkdir -p models
cd models# 1. Clone the repository
git clone <your-repo-url>
cd <repo-folder>
# 2. Install system dependencies (Linux only)
# For Ubuntu/Debian:
sudo apt update
sudo apt install -y build-essential cmake git libcurl4-openssl-dev python3-dev python3-venv
# 3. Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
# 4. Install llama-cpp-python (CPU only - for GPU see Ubuntu section)
pip install llama-cpp-python
# 5. Install Python dependencies
pip install discord.py python-dotenv tomliThe bot requires the LFM2.5-1.2B-Instruct-Q4_K_M.gguf model file. Download it from HuggingFace:
# Create models directory
mkdir -p models
# Download using huggingface-cli
pip install huggingface-hub
huggingface-cli download LiquidAI/LFM2.5-1.2B-Instruct-GGUF LFM2.5-1.2B-Instruct-Q4_K_M.gguf --local-dir modelsOr manually from: https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct-GGUF
However, if you want to use your own model, you can customize it inside the config.toml file.
-
Create a
.envfile in the project root:BOT_TOKEN=your_discord_bot_token_here -
Edit
config.tomlto configure moderation rules and AI settings:- Add words/phrases to the
delete,kick,ban, ormutelists under[moderation] - Adjust
time_to_mute(in minutes) for timed-out users - Set
min_charsunder[ai]to control the minimum message length the AI will check - Set
debug_mode = falseunder[debug]when deploying to production
- Add words/phrases to the
Make sure your GGUF model file is in place (see model_path in config.toml), then start the bot:
python main.py







