Smart LLM Routing & Proxy Server (Powered by LiteLLM).
- Unified Interface: One API key for 100+ LLMs (OpenAI, Azure, Anthropic, etc.).
- Smart Routing: Load balance across multiple keys/deployments.
- User Management: Built-in Admin UI to create Users, Teams, and Budgets.
- Reliability: Automatic retries and fallbacks (e.g., switch to Azure if OpenAI is down).
- Docker & Docker Compose
- Linux VM with ports 4001, 5432, 6379 available (or configure custom ports)
-
Configure Secrets:
cp .env.example .env nano .env
Update these critical values:
LITELLM_MASTER_KEY- Generate a strong random keyPOSTGRES_PASSWORD- Use a secure password- Provider API keys (
GROQ_API_KEY,MISTRAL_API_KEY,GEMINI_API_KEY)
-
Start Services:
docker compose up -d
-
Access Admin UI:
- URL:
http://localhost:4001/ui(orhttp://your-vm-ip:4001/ui) - Admin Key: The value of
LITELLM_MASTER_KEYfrom your.envfile.
- URL:
All deployment parameters are configurable:
LITELLM_PORT- External port for LiteLLM (default: 4001)CONFIG_PATH- Path to config.yaml (default: ./config.yaml)POSTGRES_PORT- Database port (default: 5432)REDIS_PORT- Redis cache port (default: 6379)
Add models or change routing logic:
model_list:
- model_name: gpt-4
litellm_params:
model: openai/gpt-4
api_key: os.environ/OPENAI_API_KEY# Allow LiteLLM port
sudo ufw allow 4001/tcp
# Optional: If accessing DB externally
sudo ufw allow 5432/tcp- Change
LITELLM_MASTER_KEYto a strong random value
- Use a complex
POSTGRES_PASSWORD - Configure firewall rules
- Set up SSL/TLS reverse proxy (nginx/caddy) for HTTPS
- Enable Docker restart policies (already configured)
- Regular backups of
pg_datavolume
For centralized config management:
# In .env
CONFIG_PATH=/etc/modelpilot/config.yamlcurl -X POST 'http://localhost:4001/chat/completions' \
-H 'Authorization: Bearer sk-1234567890abcdef' \
-H 'Content-Type: application/json' \
-d '{
"model": "llama-3.3-70b-versatile",
"messages": [ { "content": "Hello, world!", "role": "user" } ]
}'docker compose logs -f litellmdocker compose restartIf default ports are in use:
# Edit .env
LITELLM_PORT=8080
POSTGRES_PORT=5433
REDIS_PORT=6380docker compose exec db psql -U postgres -d litellmSee CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.