AIBot is a Discord bot that uses an OpenAI API-compatible API to interact with LLMs from Discord.
This bot is designed to work with just about any model served by an OpenAI API-compatible API, but some features such as vision model support for interpreting images in messages were specifically designed for use with xAI Image Understanding.
Using the vision model support is entirely optional. Simply remove the vision_model
variable from your .env
file, and support for image understanding will be disabled.
- Clone the repository.
- Install the required Python packages.
pip install -r requirements.txt
- Rename the
.env.example
file to.env
and populate the following environment variables:discord_bot_token
: Your Discord bot token.openai_api_base
: Your OpenAI API base.openai_api_key
: Your OpenAI API key.model
: Your model.vision_model
: Your vision model for image understanding (optional).prompt
: Your prompt.
- Run the bot.
python3 aibot.py
- Create a
docker-compose.yml
file using the example below.
services:
ai-bot:
image: ghcr.io/runbgp/aibot:latest
restart: unless-stopped
container_name: aibot
volumes:
- .env:/.env
- Rename the
.env.example
file to.env
and populate the following environment variables:discord_bot_token
: Your Discord bot token.openai_api_base
: Your OpenAI API base.openai_api_key
: Your OpenAI API key.model
: Your model.vision_model
: Your vision model for image understanding (optional).prompt
: Your prompt.
- Pull the latest container.
docker pull ghcr.io/runbgp/aibot:latest
- Run the bot.
docker compose up -d
Contributions are always welcome. Please feel free to submit an issue or a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.