llmcord  by jakobdylanc

Discord bot for LLM access

created 2 years ago
630 stars

Top 53.5% on sourcepulse

GitHubView on GitHub
Project Summary

llmcord transforms Discord into a collaborative frontend for interacting with Large Language Models (LLMs). It allows users to chat with various LLMs, both locally hosted and remote, directly within Discord channels and direct messages, fostering shared AI experiences.

How It Works

The bot leverages Discord's reply-based messaging system to build conversational context. Users can initiate conversations by mentioning the bot or reply to any message to include it in a thread. This asynchronous, event-driven architecture efficiently manages conversations, supports branching, and automatically chains consecutive messages from the same user. It's designed for broad compatibility with any OpenAI-compatible API endpoint.

Quick Start & Requirements

  • Install: pip install -U -r requirements.txt then python llmcord.py or use docker compose up.
  • Prerequisites: Python 3.x, Discord bot token with MESSAGE CONTENT INTENT enabled.
  • Configuration: Requires a config.yaml file detailing Discord bot credentials and LLM provider settings (OpenAI, Ollama, LM Studio, vLLM, Groq, etc.).
  • Docs: https://github.com/jakobdylanc/llmcord

Highlighted Details

  • Supports any OpenAI-compatible API, including Ollama, LM Studio, vLLM, Groq, and Mistral.
  • Handles image and text file attachments for vision models and code/document processing.
  • Features streamed responses, customizable system prompts, and hot-reloading of configuration.
  • Caches message data efficiently in a size-managed, mutex-protected global dictionary.

Maintenance & Community

The project is actively maintained by jakobdylanc. Contributions via Pull Requests are welcome.

Licensing & Compatibility

The project appears to be licensed under the MIT License, permitting commercial use and integration with closed-source applications.

Limitations & Caveats

User identity awareness (setting message author names) is limited to OpenAI and xAI APIs due to their specific API parameter support. The max_text and max_messages configuration parameters may require tuning based on Discord's message limits and desired conversation history length.

Health Check
Last commit

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
6
Issues (30d)
1
Star History
96 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.