Migrating from LiteLLM to Bifrost
Migration guide for moving LiteLLM-compatible traffic to Bifrost. Covers base URL changes, provider setup, virtual key migration, and benchmark context from the 500 RPS LiteLLM comparison.
Performance at a Glance
- Lower P99 Latency
- 54x Consistently fast response times
- Uptime SLA
- 99.999% Automatic failover & circuit breakers
- Providers
- 1000+ models supported natively
- Migration Time
- 15 min Drop-in OpenAI-compatible API
Why Migrate to Bifrost?
While LiteLLM works well for prototyping, teams scaling to production need infrastructure that doesn't become a bottleneck.
- Performance54x Faster Performance. Built in Go with just 1.68s overhead at 500 RPS compared to 90.72s for Python-based solutions (a ~54x lower P99 latency). Your gateway stops being the bottleneck.
- ReliabilityProduction-Ready Reliability. 99.999% uptime SLA with automatic failover, circuit breakers, and intelligent retry logic. No more multi-minute latency spikes at high load.
- Cost controlCost Optimization. Semantic caching reduces costs and latency on repeated queries. Adaptive load balancing ensures efficient resource utilization.
- SecurityEnterprise Security. Virtual keys with budgets, RBAC, audit logs, and in-VPC deployments. Full control over your AI infrastructure.
- ObservabilityNative Observability. Built-in Prometheus metrics, OpenTelemetry support, and integration with Maxim's evaluation platform. No sidecars needed.
- MigrationDrop-in Replacement. OpenAI-compatible API means zero code changes. Point your existing LiteLLM integration to Bifrost and you're done.
Performance Comparison
Tested on identical AWS t3.xlarge instances. Bifrost delivers consistent, predictable performance under load.
| Metric | Bifrost | Litellm |
|---|---|---|
| Overhead per Request (500 RPS) | 11µs | ~40ms |
| P99 Latency at 500 RPS | 1.68s | 90.72s |
| Maximum Sustained RPS | 5,000+ stable | Fails at high load |
Feature Comparison
| Title | Rows |
|---|---|
| Performance | Feature: Overhead at 500 RPS; Bifrost: 11µs (Go-native); Litellm: 40ms (Python GIL); Feature: Concurrent Request Handling; Bifrost: Native Go concurrency; Litellm: Async overhead |
| Reliability | Feature: Automatic Failover; Bifrost: Zero-config; Litellm: Manual config; Feature: Circuit Breakers; Bifrost: Available; Litellm: N/A; Feature: Health Monitoring; Bifrost: Real-time; Litellm: Basic |
| Governance & Security | Feature: Virtual Keys; Bifrost: With budgets & rate limits; Litellm: Available; Feature: RBAC; Bifrost: Fine-grained access management; Litellm: Available; Feature: Audit Logs; Bifrost: Available; Litellm: Available; Feature: Guardrails; Bifrost: Available; Litellm: Available; Feature: In-VPC Deployment; Bifrost: Available; Litellm: Available |
| Observability | Feature: Prometheus Metrics; Bifrost: Native, no sidecars; Litellm: Via callbacks; Feature: OpenTelemetry; Bifrost: OTel compatible; Litellm: OTel compatible; Feature: Request Logging; Bifrost: Multiple backends; Litellm: Multiple backends |
| Developer Experience | Feature: Setup Time; Bifrost: 30 seconds (NPX or Docker); Litellm: 5-10 minute setup; Feature: Web UI; Bifrost: Real-time config; Litellm: Admin panel available; Feature: Configuration; Bifrost: Web UI, API, or file-based; Litellm: Web UI, API, or file-based; Feature: MCP Support; Bifrost: Native gateway; Litellm: Beta integration; Feature: Deployment Asset; Bifrost: Single binary, Docker, K8s; Litellm: Python package, Docker; Feature: Docker Size; Bifrost: 80 MB; Litellm: > 700 MB |
| Architecture | Feature: Language; Bifrost: Go; Litellm: Python; Feature: Clustering; Bifrost: Available; Litellm: N/A; Feature: Adaptive load Balancing; Bifrost: Dynamic weight adjustment; Litellm: N/A; Feature: Usage-Based Routing Rules; Bifrost: Yes; Litellm: N/A; Feature: Plugin System; Bifrost: Go-based; Litellm: Python callbacks; Feature: License; Bifrost: Apache 2.0; Litellm: MIT |
Setup Steps
- Zero code changes. OpenAI-compatible API means your existing integrations work as-is.
- LiteLLM SDK compatible. You can even point the LiteLLM Python SDK at Bifrost as a proxy.
- Provider prefix routing. Use the openai/gpt-4o format for explicit provider control.
- 01Install Bifrost. Choose your preferred method. Bifrost starts immediately with zero configuration needed.
Install Bifrost # Option 1: NPX (fastest) npx -y @maximhq/bifrost # Option 2: Docker docker pull maximhq/bifrost docker run -p 8080:8080 maximhq/bifrost - 02Configure providers. Add your LLM provider API keys via the web UI at localhost:8080 or a configuration file.
Configure providers # navigate to http://localhost:8080 # click "Providers" in the sidebar # add API keys for OpenAI, Anthropic, etc. # configure models and fallback chains - 03Update base URL. Change one line in your application. Bifrost's OpenAI-compatible API means zero other code changes.
Update base URL # Before (LiteLLM) # base_url="http://localhost:4000" # After (Bifrost) base_url="http://localhost:8080"
One Line Change
import openai
client = openai.OpenAI(
api_key="your-litellm-key",
base_url="http://localhost:4000"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user",
"content": "Hello!"}]
)import openai
client = openai.OpenAI(
api_key="your-bifrost-key",
base_url="http://localhost:8080"
)
response = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user",
"content": "Hello!"}]
)Common Migration Scenarios
# LiteLLM virtual keys for team budgets map directly
# to Bifrost's equivalent functionality.
curl -X POST http://localhost:8080/api/keys \
-H "Content-Type: application/json" \
-d '{
"name": "team-engineering",
"budget": 1000,
"rate_limit": 100,
"models": ["openai/gpt-4o",
"anthropic/claude-sonnet-4-20250514"]
}'# Use the standard OpenAI SDK pointed at Bifrost.
import openai
client = openai.OpenAI(
base_url="http://localhost:8080",
api_key="your-key"
)# Use the LiteLLM Python SDK with Bifrost as the proxy backend.
import litellm
litellm.api_base = "http://localhost:8080/litellm"
response = litellm.completion(
model="openai/gpt-4o",
messages=[{"role": "user",
"content": "Hello!"}]
)You Should Migrate If
- Scaling beyond prototyping. Performance matters at production traffic levels.
- Building multi-step agent architectures. Overhead compounds with each LLM call.
- Need enterprise governance. Budget management, access control, and audit trails.
- Want integrated observability. Maxim platform provides unmatched visibility.
- Experiencing reliability issues. Timeout spikes, memory issues, or unpredictable latency.
- Need better cost control. Semantic caching and adaptive load balancing.
Open Source & Enterprise
OSS Features
- 01Model Catalog. Access 8+ providers and 1000+ AI models through a unified interface. Also supports custom deployed models.
- 02Budgeting. Set spending limits and track costs across teams, projects, and models.
- 03Provider Fallback. Automatic failover between providers ensures 99.99% uptime for your applications.
- 04MCP Gateway. Centralize all MCP tool connections, governance, security, and auth. Your AI can safely use MCP tools with centralized policy enforcement. [MCP Gateway resource]
- 05Virtual Key Management. Create different virtual keys for different use cases with independent budgets and access control.
- 06Unified Interface. One consistent API for all providers. Switch models without changing code.
- 07Drop-in Replacement. Replace your existing SDK with just one line change. Compatible with OpenAI, Anthropic, LiteLLM, Google GenAI, LangChain, and more. [Drop-in replacement docs]
- 08Built-in Observability. Out-of-the-box OpenTelemetry support. Built-in dashboard for quick visibility without complex setup.
- 09Community Support. Active Discord community with responsive support and regular updates.
Enterprise Features
- 01Governance. SAML support for SSO and role-based access control with policy enforcement for team collaboration. [Governance resource]
- 02Adaptive Load Balancing. Automatically optimizes traffic distribution across provider keys and models based on real-time performance metrics.
- 03Cluster Mode. High availability deployment with automatic failover and load balancing. Peer-to-peer clustering where every instance is equal.
- 04Alerts. Real-time notifications for budget limits, failures, and performance issues on Email, Slack, PagerDuty, Teams, Webhook, and more.
- 05Log Exports. Export and analyze request logs, traces, and telemetry data from Bifrost with enterprise-grade data export for compliance, monitoring, and analytics.
- 06Audit Logs. Comprehensive logging and audit trails for compliance and debugging.
- 07Vault Support. Secure API key management with HashiCorp Vault, AWS Secrets Manager, Google Secret Manager, and Azure Key Vault integration.
- 08VPC Deployment. Deploy Bifrost within your private cloud infrastructure with VPC isolation, custom networking, and enhanced security controls. [Enterprise deployment resource]
- 09Guardrails. Automatically detect and block unsafe model outputs with real-time policy enforcement and content moderation across all agents. [Guardrails resource]
FAQ
How long does it take to migrate from LiteLLM to Bifrost?
Most migrations take 15-30 minutes. Since Bifrost provides an OpenAI-compatible API, you typically only need to change the base URL in your application. Provider configuration can be done through the web UI without editing config files.
Will my existing LiteLLM virtual keys work with Bifrost?
LiteLLM virtual keys need to be recreated in Bifrost, but the concepts map directly. Bifrost virtual keys support the same functionality including team budgets, rate limits, and model restrictions. You can configure them via the web UI or API.
Can I use the LiteLLM Python SDK with Bifrost?
Yes. You can point the LiteLLM Python SDK at Bifrost by setting the api_base to your Bifrost URL. This allows a gradual migration where you swap the backend without changing application code.
What happens to my LiteLLM model routing configuration?
Bifrost uses a provider/model format (e.g., openai/gpt-4o) for explicit routing. You can configure fallback chains, load balancing weights, and routing rules through Bifrost's web UI or configuration files.
Is there any downtime during migration?
No. You can run Bifrost alongside LiteLLM during migration and switch traffic gradually. Both gateways can operate simultaneously, allowing you to validate Bifrost performance before fully cutting over.