Installation
Install LiteLLM with proxy dependencies:Basic Setup
1
Create Configuration File
Create a
config.yaml file with your model configurations:config.yaml
2
Set Environment Variables
Export your provider API keys:
3
Start the Proxy
Run the proxy server:The proxy will start on
http://0.0.0.0:4000 by default.4
Test the Proxy
Make a test request using curl:
Generate a Virtual Key
Create an API key for your application:Use the Virtual Key
Now use the generated key instead of the master key:Access the Admin UI
Open your browser tohttp://localhost:4000/ui to access the admin dashboard.
Login with your master key (sk-1234) to:
- View all virtual keys
- Create and manage keys
- Monitor usage and spending
- View request logs
- Manage teams and users
Load Balancing Example
Configure multiple deployments for automatic load balancing:config.yaml
gpt-4 will automatically load balance across all three deployments, with fallback to Claude if all GPT-4 deployments fail.
Database Setup (Optional)
For persistent storage of keys, users, and spend data:1
Set up PostgreSQL
2
Configure Database URL
3
Enable DB Storage
Update your
config.yaml:4
Start Proxy
The proxy will automatically run database migrations on startup:
Health Check
Verify the proxy is running:Next Steps
Docker Deployment
Deploy with Docker for production
Configuration Options
Explore all configuration settings
Virtual Keys
Advanced key management
Budget Alerts
Set up budget monitoring