Make Discord your LLM frontend - Supports any OpenAI compatible API (OpenRouter, Ollama and more)
Python
835
473 commits
updated Aug 14, 2026
llmcord transforms Discord into a collaborative LLM frontend. It works with practically any LLM, remote or locally hosted.
Just @ the bot to start a conversation and reply to continue. Build conversations with reply chains!
The reply chain is the conversation history, stored entirely in Discord. No database required.
You can:
Additionally:
/model:llmcord supports remote models from:
Or run local models with:
...Or use any other OpenAI /v1/chat/completions compatible API server.
Clone the repo:
git clone https://github.com/jakobdylanc/llmcord
cd llmcord
Set up config.yaml:
Any setting can be read from an environment variable by appending
_envto its name (e.g.bot_token_env: DISCORD_BOT_TOKEN).
| Setting | Description |
|---|---|
| bot_token | Create a new Discord bot at discord.com/developers/applications and generate a token under the "Bot" tab. Also enable "MESSAGE CONTENT INTENT". |
| client_id | Found under the "OAuth2" tab of the Discord bot you just made. |
| status_message | Set a custom message that displays on the bot's Discord profile. Max 128 characters. |
| max_text | The maximum amount of text allowed in a single message, including text from file attachments. Default: 100,000 |
| max_images | The maximum number of image attachments allowed in a single message. Default: 5Only applicable when using a vision model. |
| max_messages | The maximum number of messages allowed in a reply chain. When exceeded, the oldest messages are dropped. Default: 25 |
| use_plain_responses | When set to true the bot will use plaintext responses instead of embeds. Plaintext responses have a shorter character limit so the bot's messages may split more often.Default: falseAlso disables streamed responses and warning messages. |
| allow_dms | Set to false to disable direct message access.Default: true |
| permissions | Configure access permissions for users, roles and channels, each with a list of allowed_ids and blocked_ids.Control which users are admins with admin_ids. Admins can change the model with /model and DM the bot even if allow_dms is false.Leave allowed_ids empty to allow ALL in that category.Role and channel permissions do not affect DMs. You can use category IDs to control channel permissions in groups. |
| Setting | Description |
|---|---|
| providers | Add the LLM providers you want to use, each with a base_url and optional api_key entry. Popular providers (openrouter, openai, ollama, etc.) are already included.Only supports OpenAI /v1/chat/completions compatible APIs. Some providers may need extra_headers / extra_query / extra_body entries for extra HTTP data. See the included azure-openai provider for an example. |
| models | Add the models you want to use in <provider>/<model>: <parameters> format (examples are included). When you run /model these models will show up as autocomplete suggestions.Refer to each provider's documentation for supported parameters. The first model in your models list will be the default model at startup.Some vision models may need :vision added to the end of their name to enable image support. |
| system_prompt | Write anything you want to customize the bot's behavior! Leave blank for no system prompt. You can use the {date} and {time} tags in your system prompt to insert the current date and time, based on your host computer's time zone.It is recommended to include something like "User messages are prefixed with their Discord ID as <@ID>. Use this format to mention users." in your system prompt to help the bot understand the user message format. |
Run the bot:
No Docker:
python -m pip install -U -r requirements.txt
python llmcord.py
With Docker:
docker compose up
If you're having issues, try my suggestions here
PRs are welcome :)
187 followers · starred Feb 2025
3,004 followers · starred Mar 2026
560 followers · starred Jun 2025
2,160 followers · starred Jul 2025
Make Discord your LLM frontend - Supports any OpenAI compatible API (OpenRouter, Ollama and more)
Python
835
473 commits
updated Aug 14, 2026
llmcord transforms Discord into a collaborative LLM frontend. It works with practically any LLM, remote or locally hosted.
Just @ the bot to start a conversation and reply to continue. Build conversations with reply chains!
The reply chain is the conversation history, stored entirely in Discord. No database required.
You can:
Additionally:
/model:llmcord supports remote models from:
Or run local models with:
...Or use any other OpenAI /v1/chat/completions compatible API server.
Clone the repo:
git clone https://github.com/jakobdylanc/llmcord
cd llmcord
Set up config.yaml:
Any setting can be read from an environment variable by appending
_envto its name (e.g.bot_token_env: DISCORD_BOT_TOKEN).
| Setting | Description |
|---|---|
| bot_token | Create a new Discord bot at discord.com/developers/applications and generate a token under the "Bot" tab. Also enable "MESSAGE CONTENT INTENT". |
| client_id | Found under the "OAuth2" tab of the Discord bot you just made. |
| status_message | Set a custom message that displays on the bot's Discord profile. Max 128 characters. |
| max_text | The maximum amount of text allowed in a single message, including text from file attachments. Default: 100,000 |
| max_images | The maximum number of image attachments allowed in a single message. Default: 5Only applicable when using a vision model. |
| max_messages | The maximum number of messages allowed in a reply chain. When exceeded, the oldest messages are dropped. Default: 25 |
| use_plain_responses | When set to true the bot will use plaintext responses instead of embeds. Plaintext responses have a shorter character limit so the bot's messages may split more often.Default: falseAlso disables streamed responses and warning messages. |
| allow_dms | Set to false to disable direct message access.Default: true |
| permissions | Configure access permissions for users, roles and channels, each with a list of allowed_ids and blocked_ids.Control which users are admins with admin_ids. Admins can change the model with /model and DM the bot even if allow_dms is false.Leave allowed_ids empty to allow ALL in that category.Role and channel permissions do not affect DMs. You can use category IDs to control channel permissions in groups. |
| Setting | Description |
|---|---|
| providers | Add the LLM providers you want to use, each with a base_url and optional api_key entry. Popular providers (openrouter, openai, ollama, etc.) are already included.Only supports OpenAI /v1/chat/completions compatible APIs. Some providers may need extra_headers / extra_query / extra_body entries for extra HTTP data. See the included azure-openai provider for an example. |
| models | Add the models you want to use in <provider>/<model>: <parameters> format (examples are included). When you run /model these models will show up as autocomplete suggestions.Refer to each provider's documentation for supported parameters. The first model in your models list will be the default model at startup.Some vision models may need :vision added to the end of their name to enable image support. |
| system_prompt | Write anything you want to customize the bot's behavior! Leave blank for no system prompt. You can use the {date} and {time} tags in your system prompt to insert the current date and time, based on your host computer's time zone.It is recommended to include something like "User messages are prefixed with their Discord ID as <@ID>. Use this format to mention users." in your system prompt to help the bot understand the user message format. |
Run the bot:
No Docker:
python -m pip install -U -r requirements.txt
python llmcord.py
With Docker:
docker compose up
If you're having issues, try my suggestions here
PRs are welcome :)
187 followers · starred Feb 2025
3,004 followers · starred Mar 2026
560 followers · starred Jun 2025
2,160 followers · starred Jul 2025