DEV Community

Cover image for Top 5 Open Source LLM Gateways
Hadil Ben Abdallah
Hadil Ben Abdallah

Posted on

Top 5 Open Source LLM Gateways

Weighing self-hosted operational costs

When an application uses AI models from multiple providers, having a good open source LLM gateway can make a huge difference in how applications perform.

An LLM gateway gives applications a central way to manage model requests, handle provider-specific integrations, and apply routing and usage policies without spreading that logic across the codebase.

For engineering teams, open source offers greater control over the infrastructure handling AI traffic. Teams can inspect the code, configure the gateway to meet their application requirements, and integrate it with their existing systems.

This, however, leads to another problem: self-hosted solutions involve some operational issues as well, including updates, monitoring, availability, and security.

In this article, we will compare five LLM gateways worth considering: Bifrost, LiteLLM, Kong, Apache APISIX, and Agent Router.


TL;DR

The best open source LLM gateway depends on how much control your team needs over model routing, infrastructure, and production AI traffic.

  • Bifrost: An open source AI gateway built for production workloads, with a focus on low-overhead request handling, model routing, reliability, observability, and centralized governance.
  • LiteLLM: A Python-based open source gateway with broad model-provider support and an OpenAI-compatible interface, making it useful for applications that need flexible integrations.
  • Kong: An API management platform with AI gateway capabilities, suited to organizations that want to manage AI traffic alongside their broader API infrastructure. Open source availability depends on the specific Kong components and features being evaluated.
  • Apache APISIX: An Apache 2.0-licensed open source API gateway with AI gateway plugins for proxying LLM requests, balancing traffic across providers, and applying token-based rate limits.
  • Agent Router: An open source AI gateway built on Envoy that provides a unified API for hosted models, self-hosted inference, and MCP servers, with centralized routing, credentials, quotas, and failover.

A useful starting point is to compare each gateway's license, deployment model, provider compatibility, routing capabilities, and operational requirements. Those details can tell you more about its fit for production.


What Is an LLM Gateway, and Why Does It Matter in Production?

An LLM gateway is a layer between your application and the large language models (LLMs) it uses. It provides a common entry point for sending requests to AI providers and managing how those requests are processed.

Without a gateway, an application might need separate integrations for OpenAI, Anthropic, Google, AWS Bedrock, and self-hosted models. Each integration can introduce its own authentication, request formats, error handling, and usage-tracking logic. As the number of providers grows, maintaining those differences becomes an ongoing engineering task.

Depending on the platform and configuration, an LLM gateway can provide:

  • Unified APIs: Connect to multiple model providers through a consistent interface.
  • Model routing: Direct requests to different models based on application requirements or configured rules.
  • Retries and failover: Handle certain provider errors and redirect requests when a configured fallback is available.
  • Observability: Track request volume, latency, errors, token usage, and other operational metrics.
  • Cost management: Monitor spending and apply budgets or rate limits where supported.
  • Security and access control: Manage provider credentials, application access, and policies around AI traffic.
  • Deployment flexibility: Run the gateway in your own infrastructure or use a managed offering, depending on the platform.

An open source LLM gateway gives engineering teams an additional advantage: the ability to inspect and customize the available code, subject to its license. Self-hosting can also help organizations control where gateway processing takes place, although the actual data path depends on which model providers they use.

Open source does not automatically mean that every enterprise feature is free or that the gateway requires no maintenance. Licensing, commercial editions, deployment requirements, and the work involved in operating the service all deserve attention before choosing a platform.


How We Evaluated These LLM Gateways

This comparison looks at how each gateway fits into a real development environment, with attention to both its technical capabilities and its open source model.

The main evaluation criteria are:

  • Open source status and licensing: Which components are available under an open source license, and which capabilities may require a commercial edition?
  • Provider compatibility: How easily can developers connect hosted APIs and self-hosted models?
  • Routing and reliability: What options are available for retries, fallback behavior, and distributing requests?
  • Observability and governance: How can teams monitor AI usage and control access or spending?
  • Deployment and integration: How well does the gateway fit existing application stacks and infrastructure?

Quick Comparison: Top 5 Open Source LLM Gateways

The table below summarizes the five gateways and highlights the differences developers should investigate before adopting one.

LLM Gateway Core Technology / Approach Open Source Scope Key Strength Best For
Bifrost Go-based gateway Apache 2.0 core Performance and centralized AI traffic control Production AI infrastructure
LiteLLM Python SDK and proxy MIT-licensed open source core Broad provider compatibility Multi-provider applications
Kong Kong Gateway and AI plugins Open source gateway; AI features vary by edition API management and AI traffic policies Teams using Kong infrastructure
Apache APISIX Extensible API gateway with AI plugins Apache 2.0 LLM proxying, provider load balancing, and token-based rate limiting Teams wanting open source API and AI traffic management
Agent Router Envoy-based gateway Apache 2.0 Cloud-native AI traffic management Kubernetes and platform engineering teams

Licensing note: “Open source” can refer to a gateway core, selected plugins, or a specific repository, not necessarily every feature offered by the company.


1. Bifrost (by Maxim AI)

Screenshot of the Bifrost homepage hero section

Bifrost is an open source LLM gateway designed for engineering teams building production AI applications. Written in Go, it provides a unified API for routing requests across model providers while helping teams manage performance, reliability, observability, and access to AI services from a central layer.

Bifrost's OpenAI-compatible API lets developers connect existing applications through familiar client libraries, with less provider-specific integration work. It also supports governance for MCP tool calls and agent-related traffic, extending its role beyond conventional model requests.

Performance, Routing, and Reliability

Bifrost provides configurable routing policies for distributing requests and handling provider failures in production environments. According to its official documentation, Bifrost adds 11 µs of overhead per request at 5,000 requests per second (RPS) in sustained benchmarks. This gives engineering teams a documented performance reference when evaluating gateway overhead for high-throughput AI applications.

Observability, Cost, and Governance

Bifrost includes built-in observability and OpenTelemetry-compatible metrics and tracing. Its virtual keys let teams apply budgets and rate limits, helping them manage usage across applications and consumers. Semantic caching can also reduce repeated model calls when requests are suitable for reuse.

Additional capabilities include:

  • Usage attribution: Associate AI consumption with the relevant keys or consumers.
  • Monitoring integrations: Export telemetry for analysis alongside existing observability systems.
  • Request efficiency: Apply semantic caching where repeated requests are suitable for reuse.

Bifrost also provides capabilities for managing MCP tool access and agent-related traffic. Its Enterprise features include guardrails, role-based access control (RBAC), identity-provider integrations such as single sign-on (SSO), and audit logs. These capabilities are part of the Enterprise offering, while the open source core includes features such as virtual keys, budgets, rate limits, routing, and observability.

Deployment and Open Source Flexibility

Bifrost's open source core is licensed under Apache 2.0 and can be self-hosted using options such as Docker, Kubernetes, or its Go binary. This gives engineering teams flexibility to integrate the gateway into their existing infrastructure and deployment workflows.

Self-hosting gives teams control over the gateway's configuration and operating environment. However, requests sent to external model providers remain subject to those providers' data-handling practices.

Bifrost Enterprise supports deployment options for organizations with stricter infrastructure requirements, including in-VPC, on-premises, and air-gapped environments. These deployment options are part of the Enterprise offering.

Pricing

Bifrost offers a free, self-hosted open source version. Teams can deploy it using supported installation methods without paying for the core gateway itself.

The enterprise offering has custom pricing and adds capabilities for organizations with more advanced security, governance, and deployment requirements. Teams should confirm which features are included in each tier before making a decision.

Best for

Bifrost is best for engineering and platform teams running production AI workloads that need low gateway overhead, centralized request management, and visibility into AI usage. Its support for model requests, MCP tools, and agent traffic also makes it relevant to teams building more complex AI systems.

Teams with strict security and infrastructure requirements can evaluate the enterprise offering for advanced governance and deployment options. For smaller applications with limited routing or operational needs, a simpler gateway may be sufficient.

Explore Bifrost


2. LiteLLM

Screenshot of the LiteLLM homepage hero section

LiteLLM is an open source LLM gateway and Python SDK that gives developers a consistent way to work with different language model providers. Its gateway exposes an OpenAI-compatible API, helping applications connect to models from providers such as OpenAI, Anthropic, and AWS Bedrock without maintaining a separate request integration for each one.

LiteLLM is useful for teams that expect their model choices to change over time or need to support several providers across different applications. Its open source gateway includes features such as routing, retries, fallbacks, usage tracking, and virtual keys, while the Python SDK lets developers call supported models through a common interface.

The project is MIT-licensed, and the gateway can be self-hosted. Teams can also evaluate its commercial offering when they need additional enterprise governance, security features, or support.

Pricing

LiteLLM's open source gateway is free to self-host, with infrastructure and model-provider charges remaining the team's responsibility. Its Enterprise offering uses annual pricing based on factors such as request capacity, deployment architecture, and support requirements.

Best for

LiteLLM is best for developers and platform teams that need broad model-provider compatibility through an open source LLM gateway. Its unified API, Python SDK, and usage-management features make it a practical option for applications that need flexibility across providers without duplicating integration code.

Explore LiteLLM


3. Kong

Screenshot of the Kong AI Gateway homepage hero section

Kong brings AI traffic management into Kong's broader API connectivity platform. It helps organizations manage requests to language models alongside existing APIs, with capabilities for routing, access control, observability, and AI-specific policies.

For engineering teams already using Kong, this approach can reduce the need to introduce a completely separate system for AI traffic. The platform supports LLM requests and also includes capabilities for MCP and agent-to-agent (A2A) traffic, helping teams manage interactions across AI applications and their supporting services.

One important distinction is its licensing and deployment model. Kong offers an open source gateway, but not every AI Gateway feature is necessarily available under the same open source terms. Some capabilities are tied to Kong Konnect or commercial offerings, while fully self-hosted AI gateway deployments may require an enterprise offering. Teams should confirm the specific components and policies they intend to use before selecting Kong as an open source solution.

Pricing

Kong's pricing depends on the selected platform, deployment model, and feature set. Its Konnect AI Management Plus plan is listed from $25 per month plus usage, while enterprise plans use custom pricing. Additional AI gateway capabilities and fully self-hosted enterprise deployments may have separate costs.

Best for

Kong is best for organizations that want to integrate AI traffic management with an established API gateway platform. It is worth considering when API policies, identity, traffic governance, and existing Kong infrastructure are central to the team's architecture. However, teams specifically seeking a fully open source LLM gateway should carefully verify which AI features can be used under their chosen license and deployment model.

Explore Kong


4. Apache APISIX

Screenshot of the Apache APISIX AI Gateway homepage

Apache APISIX is an open source API gateway licensed under Apache 2.0 and maintained by the Apache Software Foundation. Its AI gateway capabilities are provided through open source plugins that let teams route requests to supported LLM providers and OpenAI-compatible endpoints. This makes APISIX relevant to teams that want to manage API and AI traffic through the same gateway.

The ai-proxy plugin forwards requests to supported model providers, including OpenAI, Anthropic, Gemini, Amazon Bedrock, and other compatible endpoints. For applications that need to distribute requests across model instances, ai-proxy-multi adds load balancing, retries, fallbacks, and health checks. The ai-rate-limiting plugin can enforce usage limits based on token consumption.

APISIX also offers AI-focused capabilities such as prompt templates, prompt decoration, prompt guard, retrieval-augmented generation (RAG), and request logging through its plugin ecosystem. Teams should review each plugin's documentation to confirm supported providers, configuration requirements, and limitations for their intended workload.

Pricing

Apache APISIX is available under the Apache 2.0 open source license, with no software license fee for the open source project itself. Teams running a self-hosted deployment are responsible for infrastructure, operations, and any costs charged by the model providers or external services they use.

Best for

Apache APISIX is best for platform and infrastructure teams that want to manage AI requests alongside their existing API traffic. Its open source AI plugins make it worth considering for teams that need LLM proxying, provider load balancing, retries, fallbacks, and token-based rate limits without relying on a separate commercial AI gateway edition.

Explore Apache APISIX


5. Agent Router

Screenshot of the Agent Router homepage hero section

Agent Router is an open source gateway for managing AI and agent traffic, built on Envoy and Envoy Gateway. Formerly known as Envoy AI Gateway, the project provides a consistent, OpenAI-compatible API for connecting applications to hosted model providers, self-hosted inference services, and MCP servers. It is now an Agentic AI Foundation project and retains its Apache 2.0 license.

Agent Router is designed with cloud-native infrastructure in mind. It gives platform teams a central place to manage credentials, routing, quotas, and failover, while Envoy handles the underlying traffic flow. Its support for Kubernetes-based deployments and multiple AI providers makes it an option for organizations that want AI gateway capabilities integrated with their existing networking and infrastructure practices.

Pricing

Agent Router is an open source project available under the Apache 2.0 license, so there is no software license fee for using the project itself. Teams deploying it in their own infrastructure still need to account for hosting, maintenance, and any fees charged by the model providers they connect.

Best for

Agent Router is best for platform engineering teams building cloud-native AI infrastructure, especially those already using Envoy or Kubernetes. Its architecture is a good fit for teams that want centralized access control and routing across hosted models, self-hosted inference, and AI tools.

Explore Agent Router


How to Choose the Right LLM Gateway

Choosing an LLM gateway comes down to how your application uses AI today and what your team expects to manage as it grows. A gateway with extensive features may be unnecessary for a small application, while a basic proxy can become limiting when several services, providers, and engineering teams depend on it.

Here are the main factors to consider before choosing an open source LLM gateway.

  • Which model providers do I need to support?

Check whether the gateway supports the providers and models your application uses, including any self-hosted inference services. An OpenAI-compatible API can simplify integration, but compatibility does not guarantee that every provider-specific feature behaves identically.

  • How important are performance and reliability?

For applications serving real users, gateway overhead, provider latency, and failure handling can all affect the experience. Look at how the gateway handles retries, fallback models, load balancing, and high availability. Test realistic traffic patterns before relying on published performance figures to estimate your own results.

  • Do I need an open source gateway or a commercial platform?

Open source software gives your team the opportunity to inspect the code, customize supported behavior, and manage its deployment. However, review the exact license and confirm which features are included in the open source release. Some platforms reserve advanced governance, support, or deployment capabilities for paid plans.

  • How will I monitor usage and control costs?

As more applications start using LLMs, tracking requests and spending becomes harder without a central view. Look for usage reporting, request tracing, budgets, rate limits, and cost information that helps you understand which applications or teams consume the most resources.

  • Where does the gateway need to run?

Consider whether your application requires a managed service, a self-hosted deployment, Kubernetes integration, private networking, or an isolated environment. Self-hosting gives your team more control over the gateway's deployment, but it also means taking responsibility for upgrades, security, monitoring, and availability.

The right choice depends on how these requirements fit together. Compare the gateway's licensing, operational workload, provider compatibility, and production capabilities before committing to one.


Frequently Asked Questions

What is an open source LLM gateway?

→ An open source LLM gateway is software that sits between an application and the language models it uses. It provides a central interface for sending model requests and can handle tasks such as provider routing, authentication, retries, monitoring, and usage limits.

How does an LLM gateway work?

→ An LLM gateway receives a request from an application, determines which configured model or provider should handle it, and forwards the request with the required authentication and parameters. It then returns the provider's response to the application.

Is an open source LLM gateway free to use?

→ An open source LLM gateway can be free to download and use under its license, but running it still has costs. Teams may need to pay for servers, databases, monitoring infrastructure, maintenance, and the models they call.

Can an LLM gateway connect to multiple AI providers?

→ Yes. Supporting multiple providers is one of the main reasons developers use an LLM gateway. A unified interface can reduce the need to maintain separate integrations for each provider and make it easier to change models as application requirements evolve. However, API compatibility does not guarantee identical behavior across models.

Does an LLM gateway improve AI application security?

→ An LLM gateway can strengthen security by centralizing provider credentials, controlling access, applying rate limits, and recording requests for monitoring and auditing. Depending on the implementation, it may also support budgets, guardrails, and policies that restrict how applications use AI services.


Final Thoughts

Open source LLM gateways give developers a practical way to manage model integrations, routing, and operational controls as AI applications grow.

The right choice depends on the providers you use, the infrastructure you operate, and the level of control your team needs over production AI traffic.

Among the five options covered here, Bifrost is a strong candidate for teams prioritizing production performance, centralized routing, and control over AI infrastructure.

LiteLLM is worth evaluating when broad provider compatibility and its Python SDK are important.

Kong makes sense for organizations already invested in its API management ecosystem, while Apache APISIX offers open source AI plugins for LLM proxying, provider load balancing, and token-based rate limiting. Agent Router is worth considering for teams building AI infrastructure around Envoy and cloud-native networking.

Before making a decision, verify each project's current license, inspect which features are available in its open source version, and consider the operational work required to run it reliably. Provider coverage and feature lists matter, but so do maintainability, security updates, and how well the gateway fits your existing architecture.

Teams evaluating LLM gateways can request a Bifrost demo or review the open source repository.


Thanks for reading! 🙏🏻
I hope you found this useful ✅
Please react and follow for more 😍
Made with 💙 by Hadil Ben Abdallah
LinkedIn GitHub Twitter

Top comments (2)

Collapse
 
aidasaid profile image
Aida Said •

LLM gateways are important. Some people think that adding a second AI provider means rewriting half of their codebase, which is not right.

Collapse
 
hadil profile image
Hadil Ben Abdallah •

Exactly! A second provider doesn’t have to mean a major rewrite, but without a good abstraction layer, things can get messy quickly. That’s one of the reasons I think LLM gateways are worth looking into early.