默认监听 8080 端口,启动后需打开 http://localhost:8080 在 Web UI 里配置提供商;需自行准备各提供商的 API Key;Docker 部署若要持久化数据需挂载 /app/data 卷。
bifrost
maximhqApache-2.0活跃维护高性能 AI 网关,用一套 OpenAI 兼容 API 统一接入上万模型,内置故障转移、负载均衡、语义缓存、虚拟密钥与预算管控,额外延迟低于 200µs。
Open-source, high-performance AI gateway that works as your LLM gateway, MCP gateway and agent gateway. One OpenAI-compatible API for 10,000+ models, with failover, load balancing, semantic caching, virtual keys, budgets and MCP Code Mode. Works with any SDK or agent and adds under 200µs of overhead at 5k RPS.
npx -y @maximhq/bifrost
docker run -p 8080:8080 maximhq/bifrostREADME 未说明显存或 GPU 要求;提供 Docker 镜像和 npx 启动方式,属于网关服务,无需本地 GPU。
统一 23+ 家模型提供商的 OpenAI 兼容 AI 网关,自带故障转移和负载均衡
高性能 AI 网关,用一套 OpenAI 兼容 API 统一接入上万模型,内置故障转移、负载均衡、语义缓存、虚拟密钥与预算管控,额外延迟低于 200µs。
核心能力
- 用单一 OpenAI 兼容 API 接入 23+ 家模型提供商
- 在提供商与模型间自动故障转移,避免服务中断
- 按多个 API Key 和提供商做智能请求分发
- 基于语义相似度缓存响应,降低成本和延迟
- 通过虚拟密钥做用量追踪、限流和预算控制
容易踩的坑
- transports/v2.5.0Bifrost HTTP v2.5.0最新正式版2026-11-06 · 2026-11-06 18:34 UTC
Bifrost HTTP Transport Release v2.5.0
✨ Features
- MCP Per-User Tool Discovery - Per-user OAuth and per-user headers clients can set
per_user_discovery, so each caller sees the tools, prompts and resources their own credential unlocks on the MCP gateway. Discovery is stored at sign-in, shared across callers with identical results, and removed with the credential. A per-caller connect tool, caller counts in the sessions table and registry, and a Refresh tools action on the sessions page come with it. Turning it off sends a per-user OAuth server back to pending verification - MCP Apps on the Gateway -
/mcp/<slug>serves MCP Apps tools andui://resources as the server sent them, to callers that declared MCP Apps. Aggregate/mcpnever lists app-only tools and namespacesui://URIs per client. App-only tools never reach models, tools are accepted by the names their own server gave them, and MCP logs record Apps use - MCP Multi Round-Trip - Bifrost passes an upstream server's
input_requiredresult through to a gateway caller that can answer it, and forwards callers' declared capabilities upstream. MCP logs record each round and link a call's rounds byround_trip_id - Faster Boot with MCP Clients - MCP clients from config.json connect in the background, so an unreachable client no longer delays the HTTP listener
- Serve Under a Base Path -
server.base_path(or-base-path/BIFROST_BASE_PATH) serves the API and UI under a URL prefix. Redirects, OAuth bootstrap URLs, webhookresult_url, MCP discovery and every copyable URL in the UI carry the prefix. Helm getsbasePath - SOCKS5 and TLS-Inspecting Global Proxies - The global proxy accepts
socks5, takes aca_cert_pemto trust a TLS-inspecting proxy, and always verifies targets through the proxy. The Inference and API toggles now take effect - Anthropic Workload Identity Federation - Anthropic keys (and custom providers with an Anthropic base) can carry
anthropic_key_config.workload_identityinstead of a static key. Bifrost exchanges the workload's OIDC token for a short-lived access token and refreshes it before expiry. The key form gets an API Key / Workload Identity tab - Caller Identity on Logs - LLM, MCP and relay logs record the caller's user email and, with
logs_store.capture_client_ipon, their client IP. Both show on log pages and in CSV exports, and export to object storage - Relay Logs Match LLM Logs - The relay log store, API and UI reach parity with LLM logs: session and correlation ids, large payload previews, filters and capture behaviour. The relay detail header is redesigned and OpenAPI import moves to a side sheet
- Multi-Value Metadata Filters - Log metadata filters accept several values per key
- Gemini Interactions Billing - On
/genai_passthrough, the Interactions agent is recorded as the model, poll records name it, and each run is billed and counted as one request - Container and Image Tool Billing - Containers started through OpenAI and Azure code interpreter and hosted shell, and Anthropic code execution, are counted on
usage.tool_usage.container_sessionsand billed at thecontainerrate, including underprevious_response_idandconversation. OpenAI image generation tool tokens are billed at the image model's rates and show asimage_cost - OpenAI 12h Prompt Cache - Prompt cache breakpoints accept a TTL, and 12h cache writes are priced from new datasheet columns
- Complexity Router Confidence Thresholds - Decision model routers take confidence thresholds before they act on a classification
- Optional Routing Rule IDs - config.json routing rules no longer need an
id. A rule without one matches the stored rule by name and scope, and a priority collision with an undeclared stored rule logs a warning instead of stopping startup - Dashboard Languages - The dashboard is fully translated with i18next across 11 locales. Numbers and dates follow the selecte
- MCP Per-User Tool Discovery - Per-user OAuth and per-user headers clients can set
- plugins/telemetry/v1.9.6Plugin telemetry v1.9.62026-11-06 · 2026-11-06 17:59 UTC
查看更新说明
Plugin Release: telemetry v1.9.6
- fix: requests dropped before enqueue no longer count as upstream traffic
- fix: relay metrics match passthrough for headers and streams
- chore: upgraded core to v1.15.0 and framework to v1.12.0
Installation
# Update your go.mod to use the new plugin version go get github.com/maximhq/bifrost/plugins/[email protected]
This release was automatically created from version file:
plugins/telemetry/version - plugins/semanticcache/v1.7.6Plugin semanticcache v1.7.62026-11-06 · 2026-11-06 17:59 UTC
查看更新说明
Plugin Release: semanticcache v1.7.6
- fix: preserve explicitly reported zero token usage
- chore: upgraded core to v1.15.0 and framework to v1.12.0
Installation
# Update your go.mod to use the new plugin version go get github.com/maximhq/bifrost/plugins/[email protected]
This release was automatically created from version file:
plugins/semanticcache/version - plugins/telemetry/v1.9.5Plugin telemetry v1.9.52026-11-06 · 2026-11-06 15:47 UTC
查看更新说明
Plugin Release: telemetry v1.9.5
- fix: requests dropped before enqueue no longer count as upstream traffic
- fix: relay metrics match passthrough for headers and streams
- chore: upgraded core to v1.15.0 and framework to v1.12.0
Installation
# Update your go.mod to use the new plugin version go get github.com/maximhq/bifrost/plugins/[email protected]
This release was automatically created from version file:
plugins/telemetry/version - plugins/semanticcache/v1.7.5Plugin semanticcache v1.7.52026-11-06 · 2026-11-06 15:47 UTC
查看更新说明
Plugin Release: semanticcache v1.7.5
- fix: preserve explicitly reported zero token usage
- chore: upgraded core to v1.15.0 and framework to v1.12.0
Installation
# Update your go.mod to use the new plugin version go get github.com/maximhq/bifrost/plugins/[email protected]
This release was automatically created from version file:
plugins/semanticcache/version
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Bifrost AI Gateway
The fastest way to build AI applications that never go down
Bifrost is a high-performance AI gateway that unifies access to 23+ providers (OpenAI, Anthropic, AWS Bedrock, Google Vertex, and more) through a single OpenAI-compatible API. Deploy in seconds with zero configuration and get automatic failover, load balancing, semantic caching, and enterprise-grade features.
Quick Start

Go from zero to production-ready AI gateway in under a minute.
Step 1: Start Bifrost Gateway
# Install and run locally
npx -y @maximhq/bifrost
# Or use Docker
docker run -p 8080:8080 maximhq/bifrost
Step 2: Configure via Web UI
# Open the built-in web interface
open http://localhost:8080
Step 3: Make your first API call
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello, Bifrost!"}]
}'
That's it! Your AI gateway is running with a web interface for visual configuration, real-time monitoring, and analytics.
Complete Setup Guides:
- Gateway Setup - HTTP API deployment
- Go SDK Setup - Direct integration
Enterprise Deployments
Bifrost supports enterprise-grade, private deployments for teams running production AI systems at scale. In addition to private networking, custom security controls, and governance, enterprise deployments unlock advanced capabilities including adaptive load balancing, clustering, guardrails, MCP gateway, and other features designed for enterprise-grade scale and reliability.
Key Features
Core Infrastructure
- Unified Interface - Single OpenAI-compatible API for all providers
- Multi-Provider Support - OpenAI, Anthropic, AWS Bedrock, Google Vertex, Azure, Cerebras, Cohere, Mistral, Ollama, Groq, and more
- Automatic Fallbacks - Seamless failover between providers and models with zero downtime
- Load Balancing - Intelligent request distribution across multiple API keys and providers
Advanced Features
- Model Context Protocol (MCP) - Enable AI models to use external tools (filesystem, web search, databases)
- Semantic Caching - Intelligent response caching based on semantic similarity to reduce costs and latency
- Multimodal Support - Support for text, images, audio, and streaming, all behind a common interface.
- Custom Plugins - Extensible middleware architecture for analytics, monitoring, and custom logic
- Governance - Usage tracking, rate limiting, and fine-grained access control
Enterprise & Security
- Budget Management - Hierarchical cost control with virtual keys, teams, and customer budgets
- User Provisioning (OIDC) - OAuth 2.0 / OIDC login with background directory sync for teams, roles, and business units
- Observability - Native Prometheus metrics, distributed tracing, and comprehensive logging
- Secrets Management - Secure API key management with environment variables and deployment secrets
Developer Experience
- Zero-Config Startup - Start immediately with dynamic provider configuration
- Drop-in Replacement - Replace OpenAI/Anthropic/GenAI APIs with one line of code
- SDK Integrations - Native support for popular AI SDKs with zero code changes
- Configuration Flexibility - Web UI, API-driven, or file-based configuration options
Repository Structure
Bifrost uses a modular architecture for maximum flexibility:
bifrost/
├── npx/ # NPX script for easy installation
├── core/ # Core functionality and shared components
│ ├── providers/ # Provider-specific implementations (OpenAI, Anthropic, etc.)
│ ├── schemas/ # Interfaces and structs used throughout Bifrost
│ └── bifrost.go # Main Bifrost implementation
├── framework/ # Framework components for data persistence
│ ├── configstore/ # Configuration storage backends
│ ├── logstore/ # Request logging storage backends
│ └── vectorstore/ # Vector storages
├── transports/ # HTTP gateway and other interface layers
│ └── bifrost-http/ # HTTP transport implementation
├── ui/ # Web interface for HTTP gateway
├── plugins/ # Extensible plugin system
│ ├── governance/ # Budget management and access control
│ ├── jsonparser/ # JSON parsing and manipulation utilities
│ ├── logging/ # Request logging and analytics
│ ├── maxim/ # Maxim's observability integration
│ ├── mocker/ # Mock responses for testing and development
│ ├── semanticcache/ # Intelligent response caching
│ └── telemetry/ # Monitoring and observability
├── docs/ # Documentation and guides
└── tests/ # Comprehensive test suites
Getting Started Options
Choose the deployment method that fits your needs:
1. Gateway (HTTP API)
Best for: Language-agnostic integration, microservices, and production deployments
# NPX - Get started in 30 seconds
npx -y @maximhq/bifrost
# Docker - Production ready
docker run -p 8080:8080 -v $(pwd)/data:/app/data maximhq/bifrost
Features: Web UI, real-time monitoring, multi-provider management, zero-config startup
Learn More: Gateway Setup Guide
2. Go SDK
Best for: Direct Go integration with maximum performance and control
go get github.com/maximhq/bifrost/core
Features: Native Go APIs, embedded deployment, custom middleware integration
Learn More: Go SDK Guide
3. Drop-in Replacement
Best for: Migrating existing applications with zero code changes
# OpenAI SDK
- base_url = "https://api.openai.com"
+ base_url = "http://localhost:8080/openai"
# Anthropic SDK
- base_url = "https://api.anthropic.com"
+ base_url = "http://localhost:8080/anthropic"
# Google GenAI SDK
- api_endpoint = "https://generativelanguage.googleapis.com"
+ api_endpoint = "http://localhost:8080/genai"
Learn More: Integration Guides
Performance
Bifrost adds virtually zero overhead to your AI requests. In sustained 5,000 RPS benchmarks, the gateway added only 11 µs of overhead per request.
| Metric | t3.medium | t3.xlarge | Improvement |
|---|---|---|---|
| Added latency (Bifrost overhead) | 59 µs | 11 µs | -81% |
| Success rate @ 5k RPS | 100% | 100% | No failed requests |
| Avg. queue wait time | 47 µs | 1.67 µs | -96% |
| Avg. request latency (incl. provider) | 2.12 s | 1.61 s | -24% |
Key Performance Highlights:
- Perfect Success Rate - 100% request success rate even at 5k RPS
- Minimal Overhead - Less than 15 µs additional latency per request
- Efficient Queuing - Sub-microsecond average wait times
- Fast Key Selection - ~10 ns to pick weighted API keys
Complete Benchmarks: Performance Analysis
Documentation
Complete Documentation: https://docs.getbifrost.ai
Quick Start
- Gateway Setup - HTTP API deployment in 30 seconds
- Go SDK Setup - Direct Go integration
- Provider Configuration - Multi-provider setup
Features
- Multi-Provider Support - Single API for all providers
- MCP Integration - External tool calling
- Semantic Caching - Intelligent response caching
- Fallbacks & Load Balancing - Reliability features
- Budget Management - Cost control and governance
Integrations
- OpenAI SDK - Drop-in OpenAI replacement
- Anthropic SDK - Drop-in Anthropic replacement
- AWS Bedrock SDK - AWS Bedrock integration
- Google GenAI SDK - Drop-in GenAI replacement
- LiteLLM SDK - LiteLLM integration
- LangChain SDK - LangChain integration
Enterprise
- Custom Plugins - Extend functionality
- Clustering - Multi-node deployment
- Secrets Management - Secure key management
- Production Deployment - Scaling and monitoring
Need Help?
Join our Discord for community support and discussions.
Get help with:
- Quick setup assistance and troubleshooting
- Best practices and configuration tips
- Community discussions and support
- Real-time help with integrations
Contributing
We welcome contributions of all kinds! See our Contributing Guide for:
- Setting up the development environment
- Code conventions and best practices
- How to submit pull requests
- Building and testing locally
For development requirements and build instructions, see our Development Setup Guide.
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Built with ❤️ by Maxim