---
title: "Self-hosted LLM gateways compared: limits, fallbacks and logs"
description: "How Kaeso, LiteLLM, Bifrost, Portkey and Helicone compare on spend limits, model fallbacks, provider key pools and request logging, with the measured throughput cost of logging."
url: https://kaeso.app/articles/comparing-self-hosted-llm-gateways
markdown: https://kaeso.app/articles/comparing-self-hosted-llm-gateways.md
language: en
alternates:
  de: https://kaeso.app/de/articles/comparing-self-hosted-llm-gateways.md
  zh-CN: https://kaeso.app/zh-CN/articles/comparing-self-hosted-llm-gateways.md
published: 2026-11-23
authors:
  - Kaeso Team
tags:
  - comparison
  - budgets
  - fallbacks
  - logging
  - gateway
image: https://kaeso.app/articles/comparing-self-hosted-llm-gateways/cover.jpg
index: https://kaeso.app/llms.txt
---

# Self-hosted LLM gateways compared: limits, fallbacks and logs

How Kaeso, LiteLLM, Bifrost, Portkey and Helicone compare on spend limits, model fallbacks, provider key pools and request logging, with the measured throughput cost of logging.

> Every page, article and docs page of Kaeso is listed in https://kaeso.app/llms.txt.

- Published: 23 November 2026
- Reading time: 4 min
- Author: Kaeso Team

Most self-hosted LLM gateways claim spend limits, fallbacks and request logging on their feature lists. In production, the differences lie in three engineering details: whether a budget actually stops concurrent overruns, whether fallbacks and key rotation break prompt caches, and how much throughput request logging costs on the hot path.

This guide compares **Kaeso 0.7.0**, **LiteLLM**, **Bifrost**, **Portkey Gateway** and **Helicone** across those three operational pillars, grounded in each project's architecture and our published [ai-gateway-bench results](https://kaeso.app/benchmarks).

## Feature comparison: limits, fallbacks and logging

| Capability | Kaeso 0.7.0 | LiteLLM | Bifrost 2.6.0 | Portkey Gateway | Helicone |
| --- | --- | --- | --- | --- | --- |
| Hard spend budgets | Atomic worst-case reservation in Valkey before upstream call | Post-response database accounting + virtual key budgets | Virtual key hierarchical budgets | Workspace budgets (advanced controls in Pro/Enterprise) | Cost tracking and rate limits |
| Nested limit hierarchy | Project › Member/Service account › Key (strict nesting) | Organization › Team › User › Virtual key | Customer › Team › Virtual key | Workspace › Virtual key | Organization / property filters |
| Fallback routing | Visual & API alias routes (by error kind, headers, tokens, splits) | YAML `fallbacks` and `context_window_fallbacks` | Failover chains and load balancing | Config-driven fallback chains and load balancing | Proxy retries and provider fallbacks |
| Multi-key prompt cache stickiness | Weighted sticky draw per caller in Valkey across replicas | Router load balancing strategies | Key pool balancing | Weighted routing configs | Provider key routing |
| Request log store | Self-hosted ClickHouse (optional, off per org/project) | PostgreSQL + external callbacks (Langfuse, S3, Datadog) | Built-in logs + Prometheus / OTEL | Local logs in core; full store in hosted platform | ClickHouse observability-first store |
| Measured throughput (2 cores, 64 clients) | 6,338 req/s (5,324 logs on) | 74 req/s Python / 3,211 req/s Rust (no logs) | 2,806 req/s (no logs) | 779 req/s (no logs) | Not in BerriAI's local lane |

## 1. Spend limits and hard budgets

A spend limit that checks finished rows in PostgreSQL cannot enforce a hard cap under concurrency: an agent loop or batch job firing twenty parallel streams will pass the check twenty times before the first token finishes billing.

- **Kaeso** checks every limit that applies (project, member or service account, and API key) in one atomic step in **Valkey** before calling the provider. For a hard spend budget, Kaeso reserves the request's worst-case cost (input tokens plus maximum output at the model's exact pricing tier, in exact decimal USD) and reconciles the real cost when the reply ends. Soft budgets allow traffic through and trigger alerts at 50%, 80% and 100% (plus signed webhooks). Each organization can view budgets and analytics in its own currency at daily ECB rates ([Hard budgets, limits and currencies](https://kaeso.app/articles/budgets-limits-and-usage)).
- **LiteLLM** supports rich virtual keys (`max_budget`, `budget_duration`, `rpm_limit`, `tpm_limit`) and budget-based model fallbacks, making it flexible for teams already using PostgreSQL and Redis, though spend updates occur asynchronously after responses complete.
- **Bifrost** provides hierarchical budgets across keys and teams with fast Go middleware, while **Portkey** reserves full multi-tenant budget governance for its commercial tiers.

## 2. Model fallbacks, retries and provider key pools

Reliable failover has two layers: failing over between keys of the same provider without breaking prompt caching, and falling back to another model when a provider is down or overloaded.

- **Kaeso** handles both layers explicitly:
  - **Weighted provider key pools.** Assign several keys of the same provider (for example two Azure regions or primary and overflow Anthropic accounts) to one project with weights from 1 to 100. Every gateway replica pins a caller to the same provider key so Anthropic and OpenAI prompt caches stay warm; if a key is rate-limited or refused, Kaeso fails over to the next healthy key and places the failed key on a shared Valkey cooldown ([Provider key pools](https://kaeso.app/articles/provider-key-pools)).
  - **Alias routes.** An alias holds an ordered route: fallbacks triggered selectively by `unavailable`, `limited`, `unsupported` or `rejected`, conditions on prompt size or headers (sending long prompts directly to a larger-context model instead of failing first), and weighted A/B splits. Every response includes a `kaeso-route` header tracing every step tried, and retries run only where you explicitly enable them ([Retries and fallbacks](https://kaeso.app/articles/retries-and-fallbacks)).
- **LiteLLM**, **Bifrost** and **Portkey** all offer mature fallback chains and retries. Bifrost and Portkey also ship built-in semantic caching, whereas Kaeso ships an exact post-translation response cache in Valkey (no semantic cache).

## 3. Request logging and its real performance cost

Logging every prompt, tool call and reply is easy at 5 requests a second and expensive at 5,000.

In Kaeso, request logs write asynchronously in memory batches to **ClickHouse** after the response streams out, so logging never blocks time to first token. You control privacy and storage separately:

- **Metadata vs content retention.** Defaults are 90 days for metadata (model, status, tokens, cost, timing, caller) and 30 days for prompt/reply content, configurable per organization.
- **Content logging off.** Disable prompt and reply body logging at the organization or project level while keeping exact token counts, spend totals, budgets and analytics in PostgreSQL.
- **Media opt-in.** Images, audio and files are logged only as type and byte size unless both organization and project opt into keeping media (capped at 10 MiB per request).
- **Measured overhead.** On [kaeso.app/benchmarks](https://kaeso.app/benchmarks), turning full ClickHouse request logging on reduced Kaeso's two-core capacity by 16%, from **6,338 req/s to 5,324 req/s**, while added latency at 16 clients stayed nearly unchanged (+0.62 ms p50 / +1.45 ms p99 vs +0.54 / +1.47 ms). Even with full request logging on, Kaeso served more requests per second than LiteLLM Rust (3,211 req/s), Bifrost (2,806 req/s), Portkey (779 req/s) and LiteLLM Python (74 req/s) with their logging off.

If your primary requirement is forwarding traces into existing third-party observability platforms such as Langfuse or Datadog, LiteLLM's callback ecosystem or Helicone's observability tooling fits that workflow directly. If you want self-contained request logs, cost analytics and CSV/JSONL exports on your own infrastructure with measured low overhead, Kaeso includes the full stack out of the box ([Request logs and privacy](https://kaeso.app/articles/request-logs-and-privacy)).

See the full side-by-side matrix on [/compare](https://kaeso.app/compare).

Product names in this article belong to their owners and are used only to name the software and services involved. Kaeso is not affiliated with or endorsed by them.

By Kaeso Team

## More articles

- [One API for OpenAI, Anthropic, Gemini and local models](https://kaeso.app/articles/one-api-for-openai-anthropic-gemini-and-local-models.md): Which open-source AI gateways unify OpenAI, Anthropic, Google Gemini and local servers like Ollama and vLLM under one API, and how Kaeso translates five formats without dropping parameters.
- [Self-hosted AI gateway checklist: keys, logs and data control](https://kaeso.app/articles/self-hosted-ai-gateway-security-checklist.md): What to look for in a self-hosted AI gateway when provider API keys, prompts and usage logs must stay on your own servers. Nine checks for engineering teams.

[See all articles](https://kaeso.app/articles.md)

## Own the gateway. Own the record

```bash
curl -fsSL https://kaeso.app/install.sh | sh
```

[Install Kaeso](https://docs.kaeso.app/self-hosting/installation) · [Open the live demo](https://demo.kaeso.app)
