Docker Deployment
One-click deployment with Docker Compose Deploy the entire Korad.AI stack with a single command.
Prerequisites​
- Docker Engine 20.10+
- Docker Compose 2.0+
- 2GB RAM minimum (4GB recommended)
- API keys for at least one LLM provider
Quick Start​
1. Clone Repository​
git clone https://github.com/koradai/bifrost.git
cd bifrost
2. Configure Environment​
# Copy example environment file
cp .env.example .env
# Edit and add your API keys
nano .env
Add at least one provider:
# Anthropic (Claude models)
ANTHROPIC_API_KEY=sk-ant-your-key-here
# OpenAI (GPT models)
OPENAI_API_KEY=sk-proj-your-key-here
# DeepSeek
DEEPSEEK_API_KEY=sk-your-key-here
3. Deploy​
# Start all services
docker-compose up -d
This starts:
- Optimizer (port 8084) - Main API endpoint
- Bifrost Gateway (port 8081) - Virtual keys, governance
- Redis (port 6379) - State store
- MCP Tools - Built-in tools
4. Verify​
# Check all services are running
docker-compose ps
# Run verification tests
python golden_run.py
Services​
Optimizer (Port 8084)​
The main API endpoint that handles optimization tiers.
# Check health
curl http://localhost:8084/health
# View logs
docker-compose logs -f optimizer
Bifrost Gateway (Port 8081)​
Handles virtual keys, budgets, and rate limits.
# Check health
curl http://localhost:8081/health
# Get virtual keys
curl http://localhost:8081/api/governance/virtual-keys
Redis (Port 6379)​
State store for Vanishing Context.
# Connect to Redis
redis-cli -h localhost -p 6379
# View keys
redis-cli KEYS "*"
Configuration​
Environment Variables​
| Variable | Description | Default |
|---|---|---|
ANTHROPIC_API_KEY | Anthropic API key | - |
OPENAI_API_KEY | OpenAI API key | - |
DEEPSEEK_API_KEY | DeepSeek API key | - |
GEMINI_API_KEY | Google Gemini API key | - |
BRAVE_SEARCH_KEY | Brave Search for web_search tool | - |
PROFIT_MARGIN | Billing profit multiplier | 1.5 |
REDIS_URL | Redis connection string | redis://redis:6379/0 |
Docker Compose Override​
Create docker-compose.override.yml for custom configuration:
services:
optimizer:
environment:
- PROFIT_MARGIN=2.0
deploy:
resources:
limits:
cpus: '2'
memory: 2G
Production Deployment​
1. Use Production Config​
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
2. Set Resource Limits​
services:
optimizer:
deploy:
resources:
limits:
cpus: '4'
memory: 4G
reservations:
cpus: '2'
memory: 2G
3. Enable HTTPS​
Add reverse proxy (nginx/traefik):
services:
nginx:
image: nginx:alpine
ports:
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./ssl:/etc/nginx/ssl
4. Use Managed Services​
For production, consider managed services:
- Redis: Redis Cloud, AWS ElastiCache
- Database: Neon PostgreSQL, AWS RDS