Zero6992/chatGPT-discord-bot

Integrate ChatGPT into your own discord bot

What it solves

This project provides a self-hosted Discord bot that integrates multiple AI models into a single interface. It eliminates the need to switch between different AI platforms by allowing users to chat with various providers (OpenAI, Claude, Gemini, Grok, DeepSeek) or local models (Ollama, LM Studio, vLLM) directly within Discord channels.

How it works

The bot acts as a bridge between Discord and various AI backends. It uses a configuration file (config.toml) and environment variables (.env) to define model aliases and API keys. It supports three main backend modes:

  • Official APIs: Connects directly to provider endpoints.
  • Local Servers: Connects to compatible chat servers running on the user's machine.
  • CLI Accounts: Integrates with native CLI tools like Codex, Claude Code, or Grok Build through an isolated runtime.

Conversations are stored in a local SQLite database, allowing the bot to maintain separate histories for each user across different servers, channels, and threads, with options for private or public visibility.

Who it’s for

  • Discord server administrators who want to provide AI capabilities to their community.
  • Users who prefer a unified chat interface for multiple AI models.
  • Privacy-conscious users who want to run local LLMs via Ollama or vLLM within Discord.

Highlights

  • Multi-Provider Support: Compatible with OpenAI, Anthropic, Google Gemini, xAI Grok, and DeepSeek.
  • Local Model Integration: Easy connection to Ollama, LM Studio, and vLLM.
  • Persistent History: Context-aware conversations that persist across restarts and are scoped by user and channel.
  • Media Capabilities: Supports image generation, image editing, image search, and text-to-video generation depending on the backend.
  • Granular Access Control: Administrators can restrict bot usage to specific Discord user IDs and configure context size and retention.

Related

  • Project
  • Project
  • Project
  • Project