Skip to main content

discord-llms

A Discord bot that uses LLMs to help users with project documentation. Point it at llms.txt files and let users ask questions in Discord threads.

Features

  • Thread-based conversations: Each question starts a new thread for focused discussion
  • Smart document selection: LLM automatically selects relevant documentation for each question
  • Multi-doc support: Configure multiple documentation sources with summaries
  • OpenAI-compatible API support: Use any OpenAI-compatible provider (OpenRouter, OpenAI, Anthropic, local LLMs, etc.)
  • Tool calling: Uses LLM tool calling to intelligently select documentation

How it works

  1. User mentions the bot with a question: @docs-bot How do I use tool calling?
  2. Bot creates a new thread for the conversation
  3. LLM analyzes the question and selects relevant documentation using tool calling
  4. Bot fetches the selected llms.txt files
  5. LLM answers the question using the documentation context
  6. Follow-up questions in the thread continue the conversation

Installation

Install uv:

Linux/Mac:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Configuration

Configuration File

Download the example configuration file:

Linux/Mac:

curl -o config.yaml https://raw.githubusercontent.com/S1M0N38/discord-llms.txt/main/config/config.example.yaml

Windows (PowerShell):

Invoke-WebRequest -Uri https://raw.githubusercontent.com/S1M0N38/discord-llms.txt/main/config/config.example.yaml -OutFile config.yaml

Discord Bot Setup

  1. Go to Discord Developer Portal
  2. Create a new application
  3. Go to "Bot" section and create a bot
  4. Enable "Message Content Intent" under Privileged Gateway Intents
  5. Copy the bot token (you'll add it to the config file in the next step)
  6. Go to "OAuth2" > "URL Generator"
  7. Select scopes: bot
  8. Select permissions: Send Messages, Create Public Threads, Send Messages in Threads, Read Message History
  9. Use the generated URL to invite the bot to your server

LLM Provider Setup

The bot needs an LLM API to function. Get an API key from one of these providers:

Any OpenAI-compatible API works. You can also use local LLMs with tools like Ollama or LM Studio.

Edit Configuration

Now edit config.yaml with your credentials:

  1. Set bot.token to your Discord bot token (from Discord Bot Setup)
  2. Set model.api_key to your LLM provider API key (from LLM Provider Setup)
  3. Optionally customize model.base_url and model.name for your provider

See the comprehensive comments in config.yaml for all available options and examples.

Usage

uvx discord-llms --config config.yaml

Deploy (Docker)

Build and export an image with your config baked in:

make export CONFIG=path/to/config.yaml TAG=latest

You can also pass the config path positionally:

make export path/to/config.yaml TAG=latest

This creates discord-llms-<tag>.tar. Treat it as sensitive because it contains your secrets.

Load the image:

docker load -i discord-llms-latest.tar

Run it (logs persisted host):

docker run -d --name discord-llms \
  --restart unless-stopped \
  -v /volume1/docker/discord-llms/logs:/app/logs \
  discord-llms:latest

Metadata

Release files for discord-llms 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for discord-llms 0.1.0
File Size Uploaded Provenance
discord_llms-0.1.0.tar.gz 121.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for discord-llms 0.1.0
File Interpreter ABI Platform
discord_llms-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 138.0 kB

Release files / discord_llms-0.1.0.tar.gz

Download URL discord_llms-0.1.0.tar.gz
Size 121.9 kB
Tags Source
SHA-256 checksum
How to use checksums
28f6ce807598e8c5af5bdb253a3f8675626fa08e74db8ab35da5be1c8d31e9e4
BLAKE2b-256 checksum
How to use checksums
772f0bad821d824b91585b3ee0e3552d5a6f0ca523b714c923d620cb1f89b978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / discord_llms-0.1.0-py3-none-any.whl

Download URL discord_llms-0.1.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ebf36ecde252b42ed9bf10c1ca1ac02bada7829b13df8c7eb264c2d37a56fc6
BLAKE2b-256 checksum
How to use checksums
0ba98da5aa4993845054f45378e46a5f98eed004d829ac83179933d446601390
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for discord-llms 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page