A complete Docker stack for running the Cerberus Aegis LLM infrastructure, including Ollama for model serving, a FastAPI gateway for API access, and an optional OpenWebUI for user interaction.
- Ollama: Serves LLM models locally with an API
- FastAPI Gateway: Routes requests to Ollama and provides additional API endpoints
- OpenWebUI (optional): Web interface for interacting with LLM models
- Docker and Docker Compose installed
- At least 8GB RAM recommended (16GB+ for larger models)
- 20GB+ free disk space
-
Clone or extract this directory
-
Create your environment file
cp .env.example .env
Edit the
.envfile to customize your setup if needed. -
Build and start the stack
docker compose build docker compose up -d
To include OpenWebUI, use:
docker compose --profile webui up -d
-
Check service health
docker compose ps
You can also check individual service logs:
docker compose logs ollama docker compose logs fastapi-gateway docker compose logs openwebui
The FastAPI Gateway exposes the following endpoints:
- Health Check:
GET http://localhost:8000/health - List Models:
GET http://localhost:8000/models - Text Completion:
POST http://localhost:8000/v1/completions - Chat Completion:
POST http://localhost:8000/v1/chat/completions - Proxy to Ollama:
POST http://localhost:8000/proxy/{path}
Chat Completion Request:
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"model": "llama3"
}'If you enabled OpenWebUI, access it at: http://localhost:3000
Default credentials (if authentication is enabled):
- Create your account on first login
Stop all services:
docker compose downRestart a specific service:
docker compose restart fastapi-gatewayView logs:
docker compose logs -fAdd new models:
docker exec -it cerberus_ollama ollama pull <model_name>All data is stored in Docker volumes:
cerberus_ollama_data: Stores downloaded models and Ollama configurationcerberus_webui_data: Stores OpenWebUI data and settings
- The default setup exposes API ports to the host machine
- For production use, consider adding authentication to the FastAPI gateway
- Review the
.envfile and adjust settings as needed
Services not starting:
- Check logs with
docker compose logs <service_name> - Ensure you have enough disk space and memory
- Verify that required ports are not in use by other applications
Models not loading:
- Check Ollama logs:
docker compose logs ollama - Try manually pulling the model:
docker exec -it cerberus_ollama ollama pull llama3
API connection issues:
- Verify the services are running:
docker compose ps - Check the FastAPI gateway logs:
docker compose logs fastapi-gateway - Ensure the OLLAMA_HOST environment variable is set correctly