Kav-K/GPTDiscord
A self-hosted Python bot for AI chat, search, and moderation inside Discord
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
GPTDiscord is a self-hosted Python application that uses Discord as its user interface and hosted APIs for model work. gpt3discord.py starts the bot, which is also packaged as the gpt3discord console command. The tree separates cogs/, services/, and models/; dependencies include py-cord and pycord-multicog for Discord integration, the OpenAI SDK for model calls, and sqlitedict for SQLite-backed storage.
Slash commands and Gateway events are the normal interaction paths. Startup syncs commands only in ALLOWED_GUILDS, leaving global registrations and other servers untouched. Core chat uses Chat Completions, while OpenAI-backed /web uses Responses with native web search. A compatible base URL can therefore work for chat without supporting synthesized web answers. Optional integrations are installed separately; durable recovery cursors live in DATA_DIR/conversation_recovery.sqlite.
Key Capabilities & Differentiators
/gpt ask and /gpt converse support vision and reasoning models, omitting incompatible sampling options for reasoning requests. /dalle draw retains its old command name but uses GPT Image and returns image bytes as Discord attachments. The bot also supports transcription, moderation, personal API keys, and owner-only TXT conversation exports. Access can be restricted by exact Discord role IDs, with per-feature role checks still in force.
/web can return up to five linked excerpts from Parallel Search MCP without an API key, or generate a cited answer through OpenAI with model and hosted-search charges. It does not fall back to the other provider on failure. Optional /internet chat is a separate conversational workflow and can use OpenAI search without Google credentials. Document Q&A, Qdrant or Pinecone memory, E2B code execution, and Replicate fallback vision are optional. Qdrant and Pinecone are mutually exclusive; with neither configured, the bot keeps local conversation summaries.
Trade-offs & Limitations
Compared with a browser-first chat UI, GPTDiscord puts access controls and shared workflows in the server where users already work, but ties the experience to Discord permissions, intents, and delivery. Compared with a managed bot, it gives operators direct control over configuration, credentials, and persisted state at the cost of maintaining the deployment and its integrations. Self-hosting the bot does not make inference offline or remove provider charges and data-transfer considerations.
For selected guilds with Gateway delivery gaps, opt-in REST recovery polls explicitly registered conversations at a nominal three-second interval and processes up to four sessions concurrently while preserving order within each session. It does not recover edits, free mentions, or general moderation events. SQLite cursors enforce at-most-once ingress: a failure after claiming a turn can leave it unanswered, and the mechanism does not guarantee exactly-once provider billing.
Hardware & Deployment Guide
Use Python 3.11–3.13 with pip install ., then run python gpt3discord.py or gpt3discord. Configure the Discord bot token, allowed guild IDs, a writable DATA_DIR, and an OpenAI key for the core OpenAI features. Enable the Server Members and Message Content intents and invite the bot with bot and applications.commands scopes. Source installs need system FFmpeg to transcribe downloaded media. Core inference runs remotely, so no GPU is required; size the host for concurrency, attachments, and local state.
Docker Compose builds the base image by default, includes FFmpeg, and mounts a named volume at /data. Set FULL=true at build time for optional integrations and ensure any bind mount is writable by UID/GID 10001. Back up existing state before upgrading and rebuild indexes when changing embedding models. The v13.2.4–v13.2.6 sequence removes retired API settings and obsolete image paths, then hides commands for services that are not loaded.
/web answers require Responses with native web search./help.10001, and persists /data in a named volume.Discord communities or internal teams that want shared AI conversations, search, and moderation in their existing channels and have an operator to manage roles, API keys, and persistent storage.
You need offline inference, cannot send content to external providers, do not want Discord as a dependency, or need durable delivery for every incoming turn.
Quick Start & Installation
cp sample.env .env # Edit .env, then: docker compose up --build -d docker compose logs -f
Comparison vs. Top Chat UI & AI Apps Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| GPTDiscord ★ | 1.9k | — | Python | MIT | A self-hosted Python bot for AI chat, search, and moderation inside Discord |
| unsloth | 80.7k | +380 | Python | Apache-2.0 | Local AI workspace for model chat, fine-tuning, and API serving |
| open-webui | 160.2k | +466 | Svelte | — | Self-hosted chat for Ollama and OpenAI-compatible model backends |
| DeepTutor | 65.5k | +1.6k | Python | Apache-2.0 | A self-hosted agent workspace for source-grounded tutoring, reading, and practic |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/Kav-K/GPTDiscord.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about GPTDiscord
Do I need the full install to use chat and web lookup?
/web. Install only the extras you need; for example, document Q&A requires .[index], ENABLE_INDEXING=true, and OpenAI access. v13.2.6 omits commands for unloaded services from Discord and /help, so a missing command can indicate that its integration is not loaded rather than a registration fault.Does the bot need a GPU, and what should I size on the host?
Can a company deploy or redistribute it, and does self-hosting keep data in-house?
When is this a better fit than a web chat UI or a managed Discord bot?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy