Repolode
maximhq

maximhq/bifrost

Open-source AI gateway giving one OpenAI-compatible API across 23+ LLM providers, with failover, load balancing, semantic caching and virtual keys.

Stars
8,932
Forks
1,424
Open issues
1,248
Last commit
22 hours ago

What is it?

Bifrost is an AI gateway that sits between your application and LLM providers such as OpenAI, Anthropic, AWS Bedrock, Google Vertex and Azure. Applications send requests to one OpenAI-compatible endpoint, and Bifrost routes them to the configured provider or model.

It handles reliability and cost concerns that usually live in application code: automatic fallbacks between providers and models, load balancing across multiple API keys, and semantic caching of similar responses. Governance features include virtual keys, rate limits, and hierarchical budgets for teams and customers, along with Prometheus metrics and request logging.

Bifrost can run via npx or Docker with a built-in web UI for configuration and monitoring, be embedded as a Go SDK, or be used as a drop-in replacement by changing the base URL in existing OpenAI, Anthropic or GenAI SDKs. It also acts as an MCP gateway for exposing external tools to models.

Key features

  • 01Single OpenAI-compatible API for many LLM providers and models
  • 02Automatic fallbacks and load balancing across providers and API keys
  • 03Semantic caching of similar responses to reduce cost and latency
  • 04Virtual keys, rate limits and hierarchical budgets for governance
  • 05Prometheus metrics, distributed tracing and request logging
  • 06MCP gateway support for giving models access to external tools

Use cases

  • Keeping an application running when one LLM provider has an outage
  • Tracking and capping LLM spend per team, customer or API key
  • Switching an existing OpenAI or Anthropic SDK app to other models with a base URL change
  • Centralizing model access and tool connections for coding agents and internal AI services

Quick start

  1. 1

    Start Bifrost Gateway locally with npx

    npx -y @maximhq/bifrost
  2. 2

    Or run it with Docker

    docker run -p 8080:8080 maximhq/bifrost
  3. 3

    Open the built-in web interface to configure it

    open http://localhost:8080
  4. 4

    Make your first API call through the gateway

    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!"}]}'

Things to know

  • Provider API keys are needed to actually reach upstream LLM providers.
  • Some enterprise features such as clustering, guardrails and adaptive load balancing are offered in a separate enterprise tier.

Topics

FAQ

What is bifrost?
Open-source AI gateway giving one OpenAI-compatible API across 23+ LLM providers, with failover, load balancing, semantic caching and virtual keys. Bifrost is an AI gateway that sits between your application and LLM providers such as OpenAI, Anthropic, AWS Bedrock, Google Vertex and Azure. Applications send requests to one OpenAI-compatible endpoint, and Bifrost routes them to the configured provider or model.
Is bifrost free to use? What license does it have?
bifrost is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is bifrost still maintained?
Actively maintained. The last commit to bifrost was on Oct 19, 2026.
What can I use bifrost for?
Keeping an application running when one LLM provider has an outage Tracking and capping LLM spend per team, customer or API key Switching an existing OpenAI or Anthropic SDK app to other models with a base URL change Centralizing model access and tool connections for coding agents and internal AI services
How do I install bifrost?
Start Bifrost Gateway locally with npx: npx -y @maximhq/bifrost Or run it with Docker: docker run -p 8080:8080 maximhq/bifrost Open the built-in web interface to configure it: open http://localhost:8080 Make your first API call through the gateway: 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!"}]}'
Where can I get bifrost?
The source code and installation instructions are on GitHub: https://github.com/maximhq/bifrost

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects