Developer-first kit for LLM chatbots with streaming, memory, and personas (Discord-first)
Project description
Developer‑first kit for LLM chatbots
Streaming • Memory • Personas (Discord‑first)
LLM Chatbot Kit
Install (pipx recommended)
- pipx:
pipx install .(from repo root) orpipx install git+https://github.com/maiko/llm-chatbot-kit@main - Run (Discord):
llm-chatbot discord run --personality personalities/aelita.yml- Default behavior streams replies as natural message bursts (no edits), with typing indicator.
- Disable streaming:
llm-chatbot discord run --no-stream(or--stream=false).
Demo personalities (Code Lyoko)
- Aelita (ally):
llm-chatbot discord run --personality personalities/aelita.yml - XANA (antagonist):
llm-chatbot discord run --personality personalities/xana.yml
Configuration (env)
DISCORD_TOKEN: Discord bot tokenOPENAI_API_KEY: OpenAI keyOPENAI_MODEL(optional): defaults togpt-5-mini.OPENAI_VERBOSITY(optional):low(default),medium, orhigh(GPT‑5 only; not forgpt-5-chat-latest).DISCORD_OWNER_ID(optional): User ID forrebootCOMMAND_PREFIX(default~),MAX_TURNS(default20)CONTEXT_STORE_PATH(optional): override default JSON context path.
Run multiple personas
- Use one process per bot (each with its own
DISCORD_TOKEN). - Aelita:
llm-chatbot discord run --personality personalities/aelita.yml(prefix!) - XANA:
llm-chatbot discord run --personality personalities/xana.yml(prefix^)
Models & generation
- Generation model: GPT‑5 mini by default (
OPENAI_MODEL=gpt-5-mini). - Judge/classifier (listening): GPT‑5 nano.
- GPT‑5 features used (except
gpt-5-chat-latest):reasoning: { effort: "minimal" }for faster time-to-first-token.text: { format: { type: "text" }, verbosity: <OPENAI_VERBOSITY> }(defaultlow).
- Requests use the Responses API with typed items (developer/user/assistant). Chat Completions is kept only as a fallback.
Create a new personality
- Duplicate
personalities/aelita.yml, adjustname,developer_prompt,system_prompt. - Optional pacing in YAML:
streaming: rate_hz: 1.0 min_first: 80 min_next: 120
- Optional environment & listening:
command_prefix: "!" environment: include_emojis: true emojis_limit: 50 include_online_members: true online_limit: 50 listen: enabled: false judge_enabled: true judge_model: gpt-5-nano truncation: auto # hide meta and let API auto-truncate context
- Run with
--personality path/to/your.yml.
Notes
- Messages are stored in a JSON file under
~/.cache/llm-chatbot-kit/context.json(orCONTEXT_STORE_PATH). On first run, the kit migrates an existing~/.cache/discord-llm-bot/context.jsonautomatically. - Keep replies under Discord’s 2000-char limit; bot auto-chunks.
- Streaming is default; on failure it falls back to non-streaming.
- Enable intents in the Developer Portal: Message Content (required) and Presence (for online members).
- Mentions: The bot allows user mentions but blocks roles/everyone. It adds a reminder to the developer prompt not to mention itself and strips leading self-mentions.
- Environment context in guilds includes a “Membres visibles” list with member names and IDs for correct mentions, and an optional online members list by name only.
Commands (per persona prefix)
- Memory:
<prefix>context,<prefix>reset,<prefix>reboot(owner) - Listening:
<prefix>listen on|off|status|ban|unban - Costs:
<prefix>cost status|budget daily|budget monthly|hardstop on|off - Emojis:
<prefix>emoji list - Truncation:
<prefix>truncation status|set <auto|disabled>
Planned
- Multi-platform supervisor: run the same persona across Discord and other platforms concurrently via
llm-chatbot multi run --platforms discord,slack. See issue #3. - Slack integration: first-class adapter and
slack runsubcommand. See issue #2. - Logging improvements: phased verbosity, JSON logs, redaction, usage summaries. See issue #4.
- Docker packaging: official image and compose example. See issue #5.
Documentation
- Overview:
docs/Overview.md - Installation:
docs/Installation.md - Configuration:
docs/Configuration.md - Personalities:
docs/Personality.md - Streaming details:
docs/Streaming.md - Listening (Experimental):
docs/Listening.md - Costs:
docs/Costs.md - Commands:
docs/Commands.md - Packaging (CI builds):
docs/Packaging.md - Development:
docs/Development.md - Security:
docs/Security.md - Troubleshooting:
docs/Troubleshooting.md
Quick tips
- Set
DISCORD_OWNER_IDto receive DM alerts on spend thresholds and to unlock owner-only commands. - If running via pipx, use
pipx upgrade llm-chatbot-kit(or reinstall) after pulling updates.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_chatbot_kit-0.1.0.tar.gz.
File metadata
- Download URL: llm_chatbot_kit-0.1.0.tar.gz
- Upload date:
- Size: 30.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a955b613269aef63fa567aff5ddc548b9b1a8e6177e687e76c1a47ac8eb333e
|
|
| MD5 |
74f4f6d9df8e29c0ff844148eef50239
|
|
| BLAKE2b-256 |
6680a51999f438bbc2d3f8c3d23c3fa94cd6ce47150713048f9d1f315e8d7c03
|
File details
Details for the file llm_chatbot_kit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llm_chatbot_kit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24dbf0732bca9525a797a3bd6476986cca82392f87c59af4f65b1b99e87fab77
|
|
| MD5 |
2880af70d8874d566aae24591c0b2976
|
|
| BLAKE2b-256 |
a100c8ba2e7edbbb67eedb36ea7e06c127064a5dea82f74065a0df0e575c1f92
|