Archived project (2023). This was one of my first big bot projects and is no longer maintained. It targets the LLM tooling landscape as it existed in mid-2023 — pinned dependency versions and the LangChain APIs used here have since moved on. Left up as a snapshot for reference and for anyone who wants to fork it.
A Discord bot that uses local LLMs and character cards (Pygmalion / TavernAI style) for casual roleplay chat. Supports both KoboldAI and Oobabooga's text-generation-webui as backends, and can auto-update the bot's avatar and display name to match the selected character.
- Character cards — drop a Tavern-style PNG into
Cards/or a JSON intoCharacters/and pick it at startup - Two LLM backends — KoboldAI or Oobabooga (
text-generation-webuiwith--api) - Per-channel memory — sliding-window conversation history scoped to each channel
- Image captions — pasted images are run through BLIP and described back to the LLM
- Stop sequences — configurable per-bot stop tokens to cut off run-on generations
- Listen-only mode — bot reads but stays silent; toggle per channel via
/listen - Ping mode — when on, the bot replies to every message; when off, only when addressed (
/pingmode)
- Clone this repo.
- Copy
sample.envto.envand fill in the values (see below). - Run
setup.bat(Windows) orsetup.sh(Linux/macOS) to create a virtualenv and install dependencies. - Run
run.bat/run.sh. - Pick a character at the prompt.
Discord only allows bots to be renamed twice per hour, so the auto-rename can fail silently on rapid restarts.
| Variable | What it does |
|---|---|
DISCORD_BOT_TOKEN |
Bot token from the Discord Developer Portal. |
ENDPOINT |
URL of your local LLM API. For Oobabooga running locally with --api, that's http://127.0.0.1:5000/. |
CHANNEL_ID |
Comma-separated list of channel IDs the bot is allowed to talk in. |
CHAT_HISTORY_LINE_LIMIT |
How many recent lines to keep in per-channel memory. |
STOP_SEQUENCES |
Comma-separated stop tokens. Use \n\n for blank-line stops. |
MAX_NEW_TOKENS |
Generation cap. KoboldAI maxes out at 512. |
ALWAYS_REPLY |
T = reply to every message; anything else = only when addressed. |
Oobabooga's text-generation-webui with --api enabled.
If commands don't appear after startup, run /sync once to force a refresh.
| Command | What it does |
|---|---|
/sync |
Force-refresh the slash command tree. |
/reload <cog> |
Reload a single cog without restarting the bot. |
/test |
No-op sanity check. |
/listen |
Toggle listen-only mode for the current channel. |
/pingmode |
Toggle whether the bot replies to every message or only when addressed. |
Enable file-name extensions so you can rename sample.env.txt → .env:
Windows 11
Windows 10
MIT — see LICENSE.




