Skip to content

YoannDev90/EvilGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

60 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EvilGPT πŸ€–

The sophisticated, AI-powered Discord agent with an attitude.

EvilGPT Icon

Python Discord License Uv Code Style Maintenance PRs Welcome Open Issues Stars Repo Size Last Commit CI OS Made with LiteLLM Profile


EvilGPT is a powerful Discord bot integrating state-of-the-art AI models to provide intelligent, contextual, and often sarcastic responses.

Table of contents

🌐 Hosted Version

You can invite the official hosted version of EvilGPT to your server:

Invite EvilGPT

πŸ“œ Commands

Command Description
/health Show runtime health for bot subsystems
/list-tools List all tools available to the model
/memory-clear Clear the conversation history for a user
/memory-delete Delete a specific turn from conversation history
/memory-list List the most recent turns in memory
/ping Check bot latency and responsiveness
/set-mood Change the mood/personality of the EvilGPT

✨ Features

  • Discord Integration: Seamless integration with Discord using discord.py
  • Multi-Model Support: Support for multiple AI models via LiteLLM
  • Multiple Providers: Configure different API providers with ease
  • Async Processing: Non-blocking message processing using asyncio
  • Comprehensive Logging: Detailed logging for debugging and monitoring
  • Thread-Safe: Prevents multiple concurrent requests from the same user
  • Dynamic Model Selection: Automatically selects the best model based on capabilities
  • Persistent Memory: Conversation history stays in a local CocoIndex-backed SQLite store
  • Transparent Deletion: Use /memory list, /memory delete, and /memory clear to inspect or purge stored turns

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Discord Bot Token
  • API credentials for your chosen AI provider / fallback providers

Installation

  1. Clone and Setup

    git clone https://github.com/YoannDev90/EvilGPT.git
    cd EvilGPT
    python -m venv .venv
    source .venv/bin/activate
  2. Install Dependencies (Using uv is recommended for speed)

    pip install uv
    uv pip install -r requirements.txt

Configuration

  1. Create a .env file in the root directory:
BOT_TOKEN=
WEBHOOK_URL=
AICHIXIA_API_KEY=
AIHUBMIX_API_KEY=
AQUA_API_KEY=
BLAZE_API_KEY=
EVOLVEX_API_KEY=
HAPUPPY_API_KEY=
LOGFLARE_API_KEY=
MEGANOVA_API_KEY=
MISTRAL_API_KEY=
MNN_API_KEY=
NAVY_API_KEY=
NEXUSIFY_API_KEY=
NVIDIA_NIM_API_KEY=
PAXSENIX_API_KEY=
SECRETS_API_KEY=
TOKEN_REPLY_API_KEY=
ZANITY_API_KEY=
DEPLOY_REMOTE_USER=
DEPLOY_REMOTE_HOST=
DEPLOY_REMOTE_DIR=
DEPLOY_SERVICE_NAME=
  1. Configure providers (optional)

  2. Set up your Discord bot

    • Create a bot on Discord Developer Portal
    • Enable the "Message Content Intent" for the bot to read messages
    • Copy the bot token to your .env file

Running the Bot

python main.py

πŸ–₯️ Deployment

EvilGPT is designed for simple and reliable deployment on Linux servers.

1. Automated SSH Deployment

A powerful deploy.sh script is provided to automate the entire process (transfer, dependencies, service restart).

  1. Prerequisites: Install sshpass locally: sudo apt install sshpass.

  2. Setup: Configure your server details in the .env file (see Configuration).

  3. Execute:

    chmod +x deploy.sh
    ./deploy.sh

2. Systemd Service

The bot includes a pre-configured evilgpt.service file. The deployment script automatically installs this for you in /etc/systemd/system/, ensuring the bot starts on boot and restarts automatically if it crashes.

πŸ“ Project Structure

Below is current snapshot of repository. This section is auto-updated by ./lint.sh on demand.

.
β”œβ”€β”€ assets
β”‚Β Β  β”œβ”€β”€ fonts
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ NotoSans-BoldItalic.ttf
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ NotoSans-Bold.ttf
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ NotoSans-Italic.ttf
β”‚Β Β  β”‚Β Β  └── NotoSans-Regular.ttf
β”‚Β Β  └── images
β”‚Β Β      β”œβ”€β”€ evilgpt.png
β”‚Β Β      └── evilgpt.svg
β”œβ”€β”€ bot.py
β”œβ”€β”€ cmds
β”‚Β Β  β”œβ”€β”€ health.py
β”‚Β Β  β”œβ”€β”€ __init__.py
β”‚Β Β  β”œβ”€β”€ list_tools.py
β”‚Β Β  β”œβ”€β”€ loader.py
β”‚Β Β  β”œβ”€β”€ memory_clear.py
β”‚Β Β  β”œβ”€β”€ memory_delete.py
β”‚Β Β  β”œβ”€β”€ memory_list.py
β”‚Β Β  β”œβ”€β”€ ping.py
β”‚Β Β  β”œβ”€β”€ _registry.py
β”‚Β Β  β”œβ”€β”€ set_mood.py
β”‚Β Β  └── _shared.py
β”œβ”€β”€ config
β”‚Β Β  β”œβ”€β”€ mcp.json
β”‚Β Β  β”œβ”€β”€ models.json
β”‚Β Β  β”œβ”€β”€ moods
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ aggressive.txt
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ jester.txt
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ mastermind.txt
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ neutral.txt
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ nihilist.txt
β”‚Β Β  β”‚Β Β  └── sarcastic.txt
β”‚Β Β  β”œβ”€β”€ providers.json
β”‚Β Β  └── tools
β”‚Β Β      β”œβ”€β”€ image_ocr.json
β”‚Β Β      β”œβ”€β”€ run_bash.json
β”‚Β Β      β”œβ”€β”€ run_nodejs.json
β”‚Β Β      β”œβ”€β”€ run_python.json
β”‚Β Β      β”œβ”€β”€ safe_eval_math.json
β”‚Β Β      β”œβ”€β”€ sandbox_create.json
β”‚Β Β      β”œβ”€β”€ sandbox_exec.json
β”‚Β Β      β”œβ”€β”€ sandbox_fs_list.json
β”‚Β Β      β”œβ”€β”€ sandbox_fs_mkdir.json
β”‚Β Β      β”œβ”€β”€ sandbox_fs_read.json
β”‚Β Β      β”œβ”€β”€ sandbox_fs_remove.json
β”‚Β Β      β”œβ”€β”€ sandbox_fs_stat.json
β”‚Β Β      β”œβ”€β”€ sandbox_fs_write.json
β”‚Β Β      β”œβ”€β”€ sandbox_inspect.json
β”‚Β Β      β”œβ”€β”€ sandbox_list.json
β”‚Β Β      β”œβ”€β”€ sandbox_metrics.json
β”‚Β Β      β”œβ”€β”€ sandbox_remove.json
β”‚Β Β      β”œβ”€β”€ sandbox_run.json
β”‚Β Β      β”œβ”€β”€ sandbox_shell.json
β”‚Β Β      └── sandbox_stop.json
β”œβ”€β”€ config.toml
β”œβ”€β”€ core
β”‚Β Β  β”œβ”€β”€ config.py
β”‚Β Β  β”œβ”€β”€ model.py
β”‚Β Β  β”œβ”€β”€ models_loader.py
β”‚Β Β  └── tools.py
β”œβ”€β”€ deploy.sh
β”œβ”€β”€ evilgpt.service
β”œβ”€β”€ .github
β”‚Β Β  └── workflows
β”‚Β Β      └── pre-commit.yml
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ lint.sh
β”œβ”€β”€ main.py
β”œβ”€β”€ managers
β”‚Β Β  β”œβ”€β”€ context.py
β”‚Β Β  β”œβ”€β”€ mcp.py
β”‚Β Β  β”œβ”€β”€ memory.py
β”‚Β Β  └── tools
β”‚Β Β      β”œβ”€β”€ image_ocr.py
β”‚Β Β      β”œβ”€β”€ __init__.py
β”‚Β Β      β”œβ”€β”€ run_bash.py
β”‚Β Β      β”œβ”€β”€ run_nodejs.py
β”‚Β Β      β”œβ”€β”€ run_python.py
β”‚Β Β      β”œβ”€β”€ safe_eval_math.py
β”‚Β Β      β”œβ”€β”€ sandbox_create.py
β”‚Β Β      β”œβ”€β”€ sandbox_exec.py
β”‚Β Β      β”œβ”€β”€ sandbox_fs_list.py
β”‚Β Β      β”œβ”€β”€ sandbox_fs_mkdir.py
β”‚Β Β      β”œβ”€β”€ sandbox_fs_read.py
β”‚Β Β      β”œβ”€β”€ sandbox_fs_remove.py
β”‚Β Β      β”œβ”€β”€ sandbox_fs_stat.py
β”‚Β Β      β”œβ”€β”€ sandbox_fs_write.py
β”‚Β Β      β”œβ”€β”€ sandbox_inspect.py
β”‚Β Β      β”œβ”€β”€ sandbox_list.py
β”‚Β Β      β”œβ”€β”€ sandbox_metrics.py
β”‚Β Β      β”œβ”€β”€ sandbox_remove.py
β”‚Β Β      β”œβ”€β”€ sandbox_run.py
β”‚Β Β      β”œβ”€β”€ sandbox_shell.py
β”‚Β Β      └── sandbox_stop.py
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ scripts
β”‚Β Β  └── generate_docs.py
└── utils
    β”œβ”€β”€ handlers
    β”‚Β Β  β”œβ”€β”€ codeblock.py
    β”‚Β Β  β”œβ”€β”€ latex.py
    β”‚Β Β  β”œβ”€β”€ messages.py
    β”‚Β Β  └── table.py
    └── logger.py

16 directories, 91 files

Run ./lint.sh to format code and regenerate this project tree snapshot. CI runs the same script on every push/PR.

πŸ”§ Technical Details

AI Model Selection

The bot automatically selects the most appropriate model based on:

  • Required input/output formats
  • API parameters support
  • Model availability

Message Processing

  1. Message received from Discord user
  2. Bot checks if user is already processing a request (prevents spam)
  3. Message payload is constructed
  4. AI model generates response in a thread pool (non-blocking)
  5. Response is sent back to Discord

Supported Features

  • Text-to-text AI generation
  • Configurable API endpoints
  • Fallback model selection
  • Token counting and usage tracking
  • Performance timing
  • Persistent conversation memory with per-turn deletion

πŸ“¦ Dependencies

- `discord.py==2.7.1` - A Python wrapper for the Discord API (latest: 2.7.1)
- `python-dotenv==1.2.2` - Read key-value pairs from a .env file and set them as environment variables (latest: 1.2.2)
- `litellm==1.86.1` - Library to easily interface with LLM API providers (latest: 1.86.1)
- `requests==2.34.2` - Python HTTP for Humans. (latest: 2.34.2)
- `colorama==0.4.6` - Cross-platform colored terminal text. (latest: 0.4.6)
- `cairosvg==2.9.0` - A Simple SVG Converter based on Cairo (latest: 2.9.0)
- `Pillow==12.2.0` - Python Imaging Library (fork) (latest: 12.2.0)
- `pilmoji==2.0.5` - Pilmoji is an emoji renderer for Pillow, Python's imaging library. (latest: 2.0.5)
- `microsandbox==0.4.6` - Python SDK for microsandbox β€” secure, fast microVM-based sandboxing. (latest: 0.4.6)
- `aiohttp==3.13.5` - Async http client/server framework (asyncio) (latest: 3.13.5)
- `discord-webhook==1.4.1` - Easily send Discord webhooks with Python (latest: 1.4.1)
- `cocoindex==1.0.6` - With CocoIndex, users declare the transformation, CocoIndex creates & maintains an index, and keeps the derived index up to date based on source update, with minimal computation and changes. (latest: 1.0.6)
- `fastmcp==3.3.1` - The fast, Pythonic way to build MCP servers and clients. (latest: 3.3.1)
- `pytesseract==0.3.13` - Python-tesseract is a python wrapper for Google's Tesseract-OCR (latest: 0.3.13)
- `pint==0.25.3` - Physical quantities module (latest: 0.25.3)

πŸ› οΈ Development

Linting & CI

  • Project provides lint.sh at repo root.
  • Run locally before commit:
./lint.sh
  • CI: GitHub Actions workflow runs lint.sh on push and pull_request to master and feature branches. Fix issues locally and push again.

Adding New Providers

  1. Add provider configuration to config/providers.json
  2. Set up environment variable for API key
  3. Update config.py if needed

Adding New Models

  1. Configure the model in config/models.json
  2. Ensure the provider has the necessary API credentials

⚠️ Important Notes

  • The bot ignores messages from other bots and direct messages
  • Users cannot send multiple concurrent requests (prevents API overload)
  • Message content intent must be enabled for the bot to work
  • API keys and tokens should never be committed to version control
  • Local memory state lives under data/memory_state.json and syncs into a local SQLite store through CocoIndex

😈 Notes about prompts

These prompts are directly inspired by the Evil model, which was available on Pollinations a few years ago.

These prompts are commonly rejected by most models available via official APIs, given the strict guardrails in place.

It is worth noting, however, that the Mistral and Gemini models are much less likely to reject them. I have not yet tested this with models such as DeepSeek, Kimi, or Minimax, but it goes without saying that the OpenAI and Anthropic models will almost certainly fail.

πŸ“ License

This project is provided as-is. Please respect Discord's Terms of Service and API usage policies.

⚠️ Disclaimer

As-is software: Models may generate illegal or harmful content. You are solely responsible for outputs and their use. I provide no warranties and accept no liability.

Your obligations: Don't use this for illegal purposes. Monitor and filter outputs appropriately. Comply with all laws.

🀝 Contributing

Feel free to submit issues and enhancement requests!

About

A very malicious Discord bot, perfect for the darkest of questions. No censorship, a rotten nature, and a sadistic, evil personality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors