Overview
LiteLLM Proxy provides comprehensive budget tracking and alerting capabilities:- Budget Enforcement: Hard limits to prevent overspending
- Soft Budgets: Warnings before hitting limits
- Webhook Alerts: Real-time notifications
- Slack Integration: Team notifications
- Spend Tracking: Monitor usage across keys, users, and teams
Budget Types
Global Budget
Set a budget for the entire proxy:config.yaml
Key Budget
Set budgets per virtual key:Team Budget
Set budgets for teams:User Budget
Set budgets per user:Soft Budgets (Alerts)
Soft budgets trigger alerts without blocking requests:Slack Alerts
Configure Slack notifications for budget alerts:Setup
Create Slack Webhook
- Go to https://api.slack.com/apps
- Create a new app
- Enable Incoming Webhooks
- Create a webhook URL
Alert Example
When a budget threshold is reached, Slack receives:Webhook Alerts
Send budget alerts to custom webhooks:config.yaml
Email Alerts
Configure email notifications:config.yaml
Budget Reset Schedule
Budgets automatically reset based on the configured duration:Manual Budget Reset
Reset a key’s budget manually:Spend Tracking
View Key Spend
View All Keys Spend
View Team Spend
View User Spend
Projected Spend Alerts
Alert based on projected monthly spend:config.yaml
Advanced Alerting
Multi-Channel Alerts
Send to multiple channels:config.yaml
Team-Specific Alerts
Configure different alert settings per team:config.yaml
Custom Alert Thresholds
config.yaml
Monitoring Dashboard
Admin UI
Access the admin dashboard athttp://localhost:4000/ui:
- Overview: Total spend across all keys
- Keys: Individual key spend and budgets
- Teams: Team-level spend tracking
- Users: Per-user spend analysis
- Charts: Spend trends over time
Prometheus Metrics
Export budget metrics to Prometheus:config.yaml
litellm_spend_total- Total spendlitellm_key_spend- Per-key spendlitellm_team_spend- Per-team spendlitellm_budget_remaining- Remaining budget
Best Practices
1. Set Conservative Budgets
Start with lower budgets and increase as needed:2. Use Soft Budgets
Always set soft budgets for early warnings:3. Monitor Regularly
Check spend daily or weekly:4. Team Budgets
Use team budgets for organizational cost allocation:5. Metadata for Cost Tracking
Use metadata to track costs by project:Troubleshooting
Alerts Not Firing
Check configuration:Incorrect Spend Tracking
Verify database is configured:config.yaml
Budget Not Resetting
Check budget reset schedule:Next Steps
Virtual Keys
Learn about key management
Configuration
Advanced configuration options
Docker Deployment
Deploy in production
Quick Start
Get started guide