# Bifrost CLI — Run Claude Code with Any AI Model > Enterprise AI gateway that lets Claude Code use any LLM provider. Bifrost routes requests to OpenAI, Gemini, Bedrock, Groq, and 20+ providers with automatic failover. ## Install Copy the content below into your project: ## Quick Use ```bash # Install npx -y @maximhq/bifrost # Connect Claude Code claude mcp add --transport http bifrost http://localhost:8080/mcp ``` ```bash # Or Docker docker run -p 8080:8080 maximhq/bifrost ``` ## What is Bifrost CLI? Bifrost is an enterprise AI gateway that provides a unified OpenAI-compatible API across 20+ AI providers and 1000+ models. The CLI component lets developers run Claude Code, Codex CLI, Gemini CLI, and other coding agents with any model from any provider. Override each Claude Code model tier independently — run GPT-5 for Sonnet tier, Gemini 2.5 Pro for Opus tier, Groq for Haiku tier. **Answer-Ready**: Bifrost CLI is an AI gateway for running Claude Code with any LLM provider. Unified API across 20+ providers (OpenAI, Gemini, Bedrock, Groq, etc.), automatic failover, semantic caching, and per-tier model overrides. Sub-100 microsecond overhead. 3.6k+ GitHub stars. **Best for**: Teams wanting model flexibility and provider redundancy for AI coding agents. **Works with**: Claude Code, Codex CLI, Gemini CLI, Cursor, Roo Code. **Setup time**: Under 2 minutes. ## Core Features ### 1. Per-Tier Model Override ```yaml # Use different models for different Claude Code tiers tiers: opus: "google/gemini-2.5-pro" sonnet: "openai/gpt-5" haiku: "groq/llama-3.3-70b" ``` ### 2. 20+ Supported Providers | Provider | Models | |----------|--------| | OpenAI | GPT-5, GPT-4o | | Anthropic | Claude Opus, Sonnet | | Google | Gemini 2.5 Pro/Flash | | AWS Bedrock | All Bedrock models | | Azure OpenAI | Azure-hosted models | | Groq | Ultra-fast inference | | Cerebras | Fast inference | | Mistral | Mistral Large, Codestral | | Cohere | Command R+ | | xAI | Grok | | Ollama | Local models | ### 3. Automatic Failover ```yaml # If primary fails, automatically falls back routes: - provider: openai priority: 1 - provider: anthropic priority: 2 - provider: groq priority: 3 ``` ### 4. Real-Time Monitoring ```bash # Dashboard at localhost:8080/logs # Track: requests, latency, tokens, costs, errors ``` ### 5. Semantic Caching Cache similar requests to reduce costs and latency. Configurable similarity threshold. ### 6. Performance | Metric | Value | |--------|-------| | Overhead | <100 microseconds | | Throughput | 5,000 RPS | | Caching | Semantic similarity | ## Supported Agents | Agent | Integration | |-------|------------| | Claude Code | MCP or API proxy | | Codex CLI | API proxy | | Gemini CLI | API proxy | | Cursor | API proxy | | Roo Code | API proxy | | Qwen Code | API proxy | ## FAQ **Q: How does it compare to LiteLLM?** A: Bifrost claims 50x faster than LiteLLM with sub-100 microsecond overhead. Enterprise features include budget management and governance. **Q: Can I use it for cost optimization?** A: Yes, route simple tasks to cheap/fast providers (Groq, Cerebras) and complex tasks to premium models. Budget limits per project. **Q: Is it open source?** A: Yes, Apache 2.0. Maxim also offers a managed cloud version. ## Source & Thanks > Created by [Maxim](https://github.com/maximhq). Licensed under Apache 2.0. > > [maximhq/bifrost](https://github.com/maximhq/bifrost) — 3.6k+ stars ## 快速使用 ```bash npx -y @maximhq/bifrost claude mcp add --transport http bifrost http://localhost:8080/mcp ``` 让 Claude Code 使用任何 AI 模型供应商。 ## 什么是 Bifrost CLI? Bifrost 是企业级 AI 网关,统一 20+ 供应商的 API,让 Claude Code 按需切换模型。支持自动故障转移、语义缓存和按层级覆盖模型。 **一句话总结**:AI 网关,Claude Code 使用任何供应商(OpenAI/Gemini/Bedrock/Groq 等 20+),自动故障转移,语义缓存,亚 100 微秒开销,3.6k+ stars。 **适合人群**:需要模型灵活性和供应商冗余的团队。 ## 核心功能 ### 1. 按层级覆盖模型 Opus/Sonnet/Haiku 各用不同供应商的模型。 ### 2. 自动故障转移 主供应商失败自动切换备用。 ### 3. 实时监控 仪表盘追踪请求、延迟、成本。 ## 常见问题 **Q: 和 LiteLLM 比?** A: Bifrost 声称快 50x,亚 100 微秒开销。 ## 来源与致谢 > [maximhq/bifrost](https://github.com/maximhq/bifrost) — 3.6k+ stars, Apache 2.0 --- Source: https://tokrepo.com/en/workflows/7ce62a2f-42dd-477a-b23f-3d275f01aa6c Author: AI Open Source