Skip to content

Kaeso vs Cloudflare AI Gateway

Self-hosted on your own servers with local models & SSO vs hosted edge proxy on Cloudflare.

Back to all comparisons

In short.

Cloudflare AI Gateway is a managed edge proxy running on Cloudflare's network with fast global caching, retries and logging, but it cannot be self-hosted and all traffic traverses Cloudflare. Kaeso is software you run on your own Linux server, VPC or Kubernetes cluster so provider keys, prompts, usage logs and local Ollama or vLLM models never leave your infrastructure.

How a request travels.

Where API keys live, where budgets and translation happen, and where prompts and logs are stored.

Kaeso 0.7.0

  1. 01Your app sends a request with its own OpenAI, Anthropic, Gemini or ElevenLabs SDK.
  2. 02Kaeso checks the key, the model and the budget on your server, in Valkey.
  3. 03It calls one of 50 providers, or your Ollama or vLLM server, with your own key.
  4. 04Usage goes to PostgreSQL and the request log to your ClickHouse.

Cloudflare AI Gateway

  1. 01Your app points its SDK at gateway.ai.cloudflare.com.
  2. 02A Cloudflare edge location caches, rate limits and handles fallbacks.
  3. 03It calls the provider's API, with your key passing through Cloudflare.
  4. 04Logs appear in the Cloudflare dashboard and can be stored in R2.

Feature by feature.

Verified on 23 November 2026 against each project's repository, documentation and our published benchmark run.

View comparison sources on GitHub
CriterionKaeso 0.7.0Cloudflare AI Gateway
Self-hosted on your own serversKaeso 0.7.0Self-hosted onlyCloudflare AI GatewayHosted edge service only (no self-hosting)
Gateway runtimeKaeso 0.7.0Rust (single binary + Postgres, Valkey, optional ClickHouse)Cloudflare AI GatewayCloudflare global edge network
Open-source licenceKaeso 0.7.0MIT (everything in one repo)Cloudflare AI GatewayProprietary managed service
OIDC SSO & SCIM in free codeKaeso 0.7.0Yes: OIDC SSO, SCIM 2.0, 2FA, audit logs, no user capCloudflare AI GatewayCloudflare Zero Trust / account access
Spend & token limitsKaeso 0.7.0Hard & soft budgets reserved in Valkey (exact USD + display currency)Cloudflare AI GatewayRate limits & edge analytics (billing via Cloudflare)
Fallbacks & routingKaeso 0.7.0Alias routes (fallbacks, conditions, splits) + weighted sticky key poolsCloudflare AI GatewayDynamic routing, retries & edge caching
Request logs & privacyKaeso 0.7.0Own ClickHouse, content logging off per org/project, CSV/JSONL exportCloudflare AI GatewayStored in Cloudflare dashboard / R2
Local models (Ollama, vLLM, LM Studio)Kaeso 0.7.0Custom providers with auto-detect (Ollama, vLLM, LM Studio, llama.cpp)Cloudflare AI GatewayNo (publicly reachable endpoints only)
Inbound API formatsKaeso 0.7.0OpenAI Chat & Responses, Anthropic Messages, Gemini API, ElevenLabsCloudflare AI GatewayUniversal endpoint + OpenAI, Anthropic, Gemini
MCP tool gateway & guardrailsKaeso 0.7.0Per-project OAuth MCP portal + built-in secrets/PII & HTTP guardrailsCloudflare AI GatewaySeparate Cloudflare Workers MCP tooling
Measured throughput (2 cores, 64 clients)Kaeso 0.7.06,338 req/sCloudflare AI GatewayHosted edge (not benchmarked locally)

Five verified benchmark dimensions.

Cloudflare AI Gateway was not part of BerriAI's local ai-gateway-bench lane. Kaeso 0.7.0 measured 6,338 req/s (5,324 req/s with ClickHouse request logs on) on two dedicated cores with +0.54 ms median added latency at 16 clients.

Inspect every table, image digest and raw file
Higher is better
  1. 01Kaeso0.7.06,338 req/s6,086–6,355
  2. 02Kaeso0.7.0, request logs on5,324 req/s5,085–5,388
  3. 03LiteLLM Rustmain at d4e8f96, unreleased3,211 req/s3,146–3,265
  4. 04Bifrost2.6.02,806 req/s2,777–2,819
  5. 05Portkey1.15.2779 req/s776–793
  6. 06LiteLLM Python1.110.274 req/s74–75

Benchmarked on BerriAI's ai-gateway-bench (two dedicated cores, 64 clients, median of three rounds). Full scripts and raw archives at /benchmarks.

Choose Kaeso when

  1. 01Compliance or security requires provider keys, prompts and request logs to remain strictly inside your own VPC or on-premises servers.
  2. 02You need hard per-project, per-member and per-key spend budgets in exact USD (plus your organization's display currency).
  3. 03You route traffic to private Ollama, vLLM or LM Studio GPU servers alongside cloud providers.
  4. 04You want MIT-licensed open-source software with OIDC SSO, SCIM 2.0, audit logs and an MCP portal with zero vendor lock-in.

Choose Cloudflare AI Gateway when

  1. 01Your apps already run on Cloudflare Workers and you want zero-ops global edge caching and request logging in two minutes.
  2. 02You do not need self-hosting, local private models or multi-tenant internal spend accounting.

Common questions.

01Can Cloudflare AI Gateway be self-hosted on my own servers?
No. Cloudflare AI Gateway runs exclusively on Cloudflare's managed network with no Docker image or Helm chart for on-premises deployment. Kaeso is self-hosted only and runs on any Linux host or Kubernetes cluster.
02How does key handling differ between Kaeso and Cloudflare AI Gateway?
In Kaeso, your provider keys are AES-256-GCM encrypted on your own server and apps only ever hold scoped hashed Kaeso keys (sk-kso-…). Apps never receive raw upstream provider secrets.
03Does Kaeso support response caching like Cloudflare AI Gateway?
Yes. Each Kaeso project can enable an exact post-translation response cache in Valkey with configurable TTL (5 minutes to 7 days) and standard Cache-Control header support.

Measure it on your own stack.

Install Kaeso with one command, point one SDK at it, or rerun our published benchmark harness on your own hardware.