A Dynamic Discord Chat Agent
Sable is a for-fun Discord chat agent powered by a locally hosted, quantized LLM.
It’s designed for experimentation, learning, and personal server use.
- Python: 3.12.*
- Database: Async SQLite (aiosqlite)
- Discord API: Pycord
- LLM: Local Quantized Mistral (mistral-7b-instruct-v0.1.Q4_K_M.gguf)
- Inference: llama-cpp-python
- Go to Discord Developers: https://discord.com/developers/applications
- Create a New Application or select an existing one.
- Under OAuth2, copy the Client ID (optional).
- Under Bot, copy the Bot Token (use Reset Token if hidden).
⚠️ Do not share your bot token. Save it securely (e.g., in a .txt file).
- Under Installation, copy the provided Install Link.
- Open the link and select your server.
- Approve permission requests.
- Bot appears in the server with an
APPindicator and matching role.
Initial status: Offline ⚫
- Create a .env file in the project root:
MASTER_ID=Your_Discord_ID
BOT_ID=Your_Client_ID
DISCORD_BOT_TOKEN=Your_Bot_Token
- IDs can be copied using Developer Mode: ⚙ (User Settings) → ⋯ Advanced.
- DISCORD_BOT_TOKEN comes from Step 1.
- Install Python 3.12.* from https://www.python.org/downloads/release/python-31210/\
- Install dependencies:
pip install -r requirements.txt
- Download Mistral 7B Instruct (GGUF, Q4_K_M):
Source: https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/blob/main/mistral-7b-instruct-v0.1.Q4_K_M.gguf\ Direct: Click here to download - Move file to model/ (directory tracked with .gitkeep).
Run: python Client.py
Creates: data/database.db (deleting resets DB).
Run: python Client.py
Performs:
- Load .env
- Connect to SQLite
- Initialize DB schema if needed
- Load Mistral LLM and tokenizer
- Start thread pool executor
- Connect to Discord
Bot status: Online 🟢
- Press
Ctrl + Cor close terminal.
- For personal, educational, or experimental use only.
- Not intended for commercial use.
- Fork or attribute clearly if redistributed.
- Active development; use at your own risk.
- Comply with Discord's Terms of Service and community guidelines.
- May include third-party libraries; review licenses.