A Discord bot powered by Llama 3.2 (1B) using Ollama, running in Docker Compose.
- Chat with Llama 3.2:1b model directly from Discord
- Containerized with Docker Compose
- Automatic model management with Ollama
- Docker and Docker Compose
- Discord Bot Token (Create one here)
-
Clone the repository (if not already done)
-
Configure Discord Token
cp .env.example .env # Edit .env and add your Discord bot token -
Start the services
docker-compose up -d
-
Pull the Llama model (first time only)
docker exec ollama ollama pull qwen3.5:0.8b -
Check logs
docker-compose logs -f bot
In Discord, use the following commands:
!chat <message>- Chat with the Llama model!info- Display bot information
Example:
!chat What is the meaning of life?
main.py- Discord bot implementationdocker-compose.yml- Multi-container setup (Ollama + Bot)Dockerfile- Bot container configurationpyproject.toml- Python dependencies
- ollama: Runs the Ollama service with the Llama model
- bot: Discord bot that connects to Ollama
To run locally without Docker:
-
Install dependencies:
uv sync
-
Ensure Ollama is running and has the model:
ollama pull qwen3.5:0.8b
-
Set environment variables:
export DISCORD_TOKEN=your_token_here export OLLAMA_HOST=http://localhost:11434
-
Run the bot:
python main.py
- Bot not responding: Check logs with
docker-compose logs bot - Model not found: Run
docker exec ollama ollama pull qwen3.5:0.8b - Connection issues: Ensure Ollama service is healthy with
docker-compose ps