← Blog

Best Open Source LLM Gateways Compared (2025)

2026-09-12 · 5 min read · SubToAPI Team

If you're searching for the best open source LLM gateway, you're probably trying to solve one of three problems: you want a single API surface across multiple model providers, you need request logging and rate limiting without building it yourself, or you're trying to avoid vendor lock-in on infrastructure you control. The good news is there are several mature open source projects that do this well. The trade-off you're accepting is operational: you run the servers, you patch the code, and you own the uptime.

This article covers the main open source options, what each is actually built for, and how to decide whether self-hosting is the right call versus using a managed gateway.

What an LLM gateway actually does

Before comparing tools, it helps to be precise about scope. An LLM gateway typically sits between your application and one or more model providers and handles:

Not every open source project does all of this equally well. Some are routing-first, some are observability-first, and some are closer to a full proxy with a UI.

Litellm

LiteLLM is probably the most widely deployed open source option. It's a Python library and proxy server that translates calls to a huge number of providers (OpenAI, Anthropic, Bedrock, Azure, local models via Ollama, and more) into a single OpenAI-compatible format.

Strengths:

Watch-outs:

If you're already OpenAI-SDK-shaped and need multi-provider routing, LiteLLM is a reasonable default.

Portkey (AI Gateway, open source core)

Portkey ships an open source gateway core with a hosted control plane on top. The self-hosted piece handles routing, caching, and fallbacks; the hosted piece adds a dashboard, guardrails, and analytics.

Strengths:

Watch-outs:

Bifrost

Bifrost is a newer entrant focused specifically on being a fast, minimal proxy layer, written in Go rather than Python. If your bottleneck is raw gateway latency at scale, this is worth benchmarking against LiteLLM's proxy.

Strengths:

Watch-outs:

Kong AI Gateway / Envoy AI Gateway

If you already run Kong or Envoy for general API traffic, both now ship AI-specific plugins/extensions for LLM routing, token-based rate limiting, and prompt guarding. This is the right choice if your team's expertise is already in API gateway operations and you want LLM traffic to go through the same infrastructure as everything else, rather than adopting a separate AI-specific tool.

How to choose between them

A quick framework:

  1. Already using OpenAI SDK conventions everywhere? Start with LiteLLM — migration cost is near zero.
  2. Need low-latency routing at meaningful scale? Benchmark Bifrost and Portkey's core against your actual traffic patterns; don't take marketing benchmarks at face value.
  3. Already running Kong or Envoy? Use their AI extensions instead of adding a new piece of infrastructure.
  4. Small team, no dedicated ops capacity? This is where self-hosting starts to cost more than it saves — see below.

When self-hosting isn't the right trade-off

Open source gateways are free to download but not free to run. You're responsible for:

For teams that just want application-level API keys, streaming, and usage metadata without operating another service, a managed layer can be the faster path. SubToAPI turns your existing Claude access into a clean HTTPS API: you get sub_live_... application keys, streaming responses, tool use, and per-key usage metadata in a dashboard, with team seats if you need to split access across a group. There's no proxy to deploy or database to maintain — you get a key from the dashboard and start making requests against /v1/messages.

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4",
    "max_tokens": 512,
    "messages": [{"role": "user", "content": "Summarize this ticket"}]
  }'

It's not a multi-provider gateway in the LiteLLM sense — it's focused specifically on giving you a production-grade API surface for Claude without the ops overhead. If your requirement is genuinely multi-provider routing across five different model vendors, an open source gateway is still the right architectural choice. If your requirement is "give my app a stable Claude API with keys, streaming, and usage tracking," it's worth comparing the total cost of running LiteLLM plus Postgres plus monitoring against a Solo plan before you commit engineering time to it.

questions

What's the most popular open source LLM gateway? LiteLLM has the widest adoption due to its broad provider support and OpenAI-compatible interface, which makes migrating existing applications straightforward.

Do open source LLM gateways cost anything to run? The software is free, but you pay in infrastructure (proxy servers, a database for config/usage) and ongoing maintenance — patching, scaling, and monitoring the gateway itself.

When should I use a managed API instead of self-hosting a gateway? When your need is a stable, authenticated API for a single provider like Claude rather than routing across many providers — a managed option like SubToAPI removes the operational overhead entirely.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →