Best Self-Hosted AI Gateway in 2026 (LiteLLM vs Bifrost vs Portkey vs Kong)

Last updated 2026-07-07 · Part of Awesome AI Gateway. ⭐ Star it.

📊 Key numbers · Self-hosting adds $0 per-token markup — but the model still dominates the bill: a 100K-token report ranges $0.03–$3.01 (a ~106× spread, computed, 2026-06). And star count ≠ safety — LiteLLM (⭐ 54.9k) shipped 2026 CVEs, so weigh patch discipline, not just popularity. Self-hosting the gateway doesn't exempt you from provider outages: peer-reviewed measurements show the OpenAI/Anthropic APIs fail ~every 2 days with ~1h median recovery (ICPE 2025) — cross-provider fallback in your gateway config is the fix.

If you want one OpenAI-compatible endpoint for every model — but on your own infrastructure, with $0 markup — you're choosing a self-hosted AI gateway. Here are the four that matter in 2026, and how to pick.

Quick comparison

GatewayLanguageBest atOverhead (measured¹)LicenseStars
LiteLLMPythonBreadth (100+ providers), features5.41 msMIT⭐ 54.9k
BifrostGoRaw throughput0.56 msApache-2.0⭐ 6.8k
Portkey GatewayTypeScriptGuardrails + governance built in2.69 msApache-2.0⭐ 12.6k
Kong AI GatewayLua/GoEnterprise K8s + mature pluginslowApache-2.0⭐ 43.9k

¹ Independently measured mean added latency per request (llm-gateway-bench data, self-hosted defaults). The vendor-marketed figures — Bifrost "~11µs @ 5k RPS", Portkey "<1ms" — did not reproduce in that harness; treat cross-vendor "Nx faster" claims as marketing until independently reproduced. Kong: not yet measured ("low" per vendor).

Pick by what you care about

What about TensorZero?

You'll still see TensorZero (Rust; gateway + observability + evals in one binary) in older comparisons — it once hit #1 GitHub Trending. As of June 2026 its repo is archived / read-only (the company wound down). The Apache-2.0 code and community forks remain usable, but there's no upstream maintenance or security response, so it's not a safe default for a new project. If TensorZero's single-binary "gateway + observability" pitch was the draw, the closest maintained paths today are Bifrost (throughput) or Portkey (governance + observability hooks), with a dedicated tool like MLflow or Helicone for evals.

Security: patch discipline matters more than the logo

Self-hosting means you own the security. Honest 2026 facts:

Full ★1–5 compliance/security/stability scores for 23 gateways: gateway scorecard.

Don't forget the model cost

The gateway is $0-markup; your bill is the model. Same 100K-token report: $0.03 on DeepSeek vs $3.01 on GPT-5.5 (106×). A self-hosted gateway's biggest win is routing cheap-by-default and escalating only when needed — see the computed cost tables.

Verdict

Still deciding whether to self-host at all? The condensed self-hosted gateway how-to-choose guide covers the why and the one-line picks.

See all 50+ gateways organized by need, with decision tree and data: 👉 Awesome AI Gateway · interactive site