Skip to content
 
 

Repository files navigation

Key Improvements Made:

  1. Image Provider Switching

    Added /image_providers command to switch between different image generation endpoints Created autocomplete functionality for image providers Added current_image_provider global variable to track the active provider

  2. Image Queue System

    Implemented an asynchronous queue (image_queue) for processing image generation requests Added worker task (image_generation_worker) that processes queue items one by one Added timeout handling (20 minutes per request) Results are stored in image_results dictionary using request IDs

  3. Image Storage System

    Created generated_images folder automatically if it doesn't exist Images are saved as temporary files with UUID filenames Files are automatically deleted after being sent to Discord Added proper error handling for file operations

  4. Message Modification Instead of New Messages

    The existing streaming response system already modifies messages instead of creating new ones Added proper timing controls with EDIT_DELAY_SECONDS Messages are edited in real-time during generation and finalized when complete

  5. Additional Features

    Enhanced /image_advanced command with more parameters (steps, cfg_scale, dimensions) Better error handling and logging throughout the image generation pipeline Automatic cleanup of temporary files Proper timeout handling for long-running image generations

Talk to LLMs with your friends!

llmcord transforms Discord into a collaborative LLM frontend. It works with practically any LLM, remote or locally hosted.

Features

Reply-based chat system:

Just @ the bot to start a conversation and reply to continue. Build conversations with reply chains!

You can:

  • Branch conversations endlessly
  • Continue other people's conversations
  • @ the bot while replying to ANY message to include it in the conversation

Additionally:

  • When DMing the bot, conversations continue automatically (no reply required). To start a fresh conversation, just @ the bot. You can still reply to continue from anywhere.
  • You can branch conversations into threads. Just create a thread from any message and @ the bot inside to continue.
  • Back-to-back messages from the same user are automatically chained together. Just reply to the latest one and the bot will see all of them.

Not tested in this version.

llmcord supports remote models from:

should Work

Or run local models with:


And more:

  • Supports image attachments when using a vision model (like gpt-5, grok-4, claude-4, etc.)
  • Supports text file attachments (.txt, .py, .c, etc.)
  • Customizable personality (aka system prompt)
  • User identity aware (OpenAI API and xAI API only)
  • Streamed responses (turns green when complete, automatically splits into separate messages when too long)
  • Hot reloading config (you can change settings without restarting the bot)
  • Displays helpful warnings when appropriate (like "⚠️ Only using last 25 messages" when the customizable message limit is exceeded)
  • Caches message data in a size-managed (no memory leaks) and mutex-protected (no race conditions) global dictionary to maximize efficiency and minimize Discord API calls
  • Fully asynchronous

Instructions

  1. Clone the repo:

    git clone https://github.com/jakobdylanc/llmcord
  2. Create a copy of "config-example.yaml" named "config.yaml" and set it up:

  3. Run the bot:

    No Docker:

    python -m pip install -U -r requirements.txt
    python llmcord.py

    With Docker:

    docker compose up

Notes

  • If you're having issues, try my suggestions here

  • Only models from OpenAI API and xAI API are "user identity aware" because only they support the "name" parameter in the message object. Hopefully more providers support this in the future.

  • PRs are welcome :)

About

Make Discord your LLM frontend - Supports any OpenAI compatible API (Ollama, xAI, Gemini, OpenRouter and more)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages