LiteLLM Provider Integration
LiteLLM Provider Integration
Use GovernanceAI as a drop-in LiteLLM-compatible proxy to add AI governance to any application using LiteLLM.
Overview
GovernanceAI provides a LiteLLM-compatible API endpoint that:
- ✅ Accepts same requests as OpenAI/Claude/etc.
- ✅ Applies guardrails and policies
- ✅ Returns policy-compliant responses
- ✅ Logs all activity for audit
No code changes needed - Just point your LiteLLM client to GovernanceAI.
Setup
Step 1: Get Proxy Endpoint
- Integrations → LiteLLM
- Copy your endpoint:
https://litellm.governanceai.com/v1 - Generate API key (or use existing)
Step 2: Configure LiteLLM
Step 3: Supported Models
All models are supported by passing through to their provider:
Configuration
Model Routing
Route different models through different guardrails:
Rate Limiting
Configure per-model rate limits:
Usage Example
Python Application
LangChain Integration
LlamaIndex Integration
Monitoring & Metrics
View Usage
Per-Model Metrics
Error Handling
GovernanceAI returns standard OpenAI error codes:
Performance
Latency Impact
GovernanceAI adds minimal latency:
- Average overhead: 45-100ms
- P95: 150ms
- P99: 250ms
Varies based on:
- Policy complexity
- Model response size
- Network latency to provider
Caching
Enable response caching:
Best Practices
✅ Do:
- Use org_id and user_id in metadata
- Set appropriate rate limits
- Monitor usage regularly
- Test policies before production
- Use different keys per environment
❌ Don’t:
- Share API keys between environments
- Disable logging for audit trails
- Route sensitive data without PII guardrails
- Forget to set up alerts
Troubleshooting
- 401 Unauthorized - Check API key
- Rate limit exceeded - Check configured limits
- Slow responses - Check policy complexity
- Connection refused - Verify endpoint URL
Next Steps
- Setting Up Guardrails - Configure policies
- Quick Start - First API call
- API Reference - Full LiteLLM API docs