LiteLLM vs Cloudflare AI Gateway
The question that decides it: Do you want the gateway inside your infrastructure, or at an edge you never have to run?
Our verdict
If nobody on the team wants to operate a proxy, Cloudflare AI Gateway is close to free and effectively zero maintenance, and its 5% fee only applies if you opt into paying providers through Cloudflare. If you need provider breadth, air-gapped operation, or control over what gets logged, LiteLLM.
Why
The operational asymmetry is the whole comparison. Cloudflare AI Gateway is a hosted endpoint you point your existing SDK at; there is nothing to deploy, patch or scale, and the core features — analytics, caching, rate limiting and DLP scanning — are free on every plan including the free one. LiteLLM is a container you run with Postgres and Redis behind it, and everything about its availability is your problem.
Provider coverage is not close. LiteLLM reaches 140+ providers; Cloudflare enumerates 24. Cloudflare's list covers the names most teams actually use, and its documentation is explicit that features work across the supported set, but if your requirement is "we must be able to call anything", it is the wrong shelf. Neither publishes a model total, and neither should be judged on one.
The logging default deserves more attention than it usually gets. Cloudflare AI Gateway logs the full request and response by default. That is genuinely useful — it is what makes the analytics and the replay worth having — and it can be turned off. But it means prompt and completion content sits in Cloudflare's logs unless you go and change it, which is a different starting posture from LiteLLM, where logging is configurable and the logs land wherever you put them. If you handle regulated data, this is the sentence to take to your reviewer.
Money is nearly a non-issue on both, in different ways. LiteLLM charges nothing and costs you infrastructure. Cloudflare charges nothing for the gateway itself and takes 5% only if you use Unified Billing to pay upstream providers through Cloudflare — bring your own provider keys instead and that fee does not arise. The honest cost comparison is therefore your engineers' time against a 5% opt-in.
Which one, concretely
Choose LiteLLM if
- You need provider breadth — 140+ against Cloudflare's 24
- You need air-gapped operation, which Cloudflare explicitly cannot do
- You want to decide what is logged and where it lands, rather than opt out of a default
- You want the routing config in version control alongside your application
Choose Cloudflare AI Gateway if
- You want a gateway with no servers, no database and no on-call rotation
- The providers you use are already in Cloudflare's supported list
- You are already on Cloudflare and want the analytics and caching without new vendors
- You want request-level analytics and replay without building the logging pipeline yourself
What catches people out
- Cloudflare logs the full request and response by default, including prompt and completion content, until you turn it off
- Cloudflare's 5% applies only to credits bought through Unified Billing — with your own provider keys there is no percentage fee
- Cloudflare is managed only and not air-gappable; if that is a requirement, it is disqualified rather than merely worse
- LiteLLM's free tier is the whole gateway, but SSO, RBAC and audit logs need a commercial licence with no published price
Side by side
1 of 9 fields differ, marked with a dot. Every figure links to the vendor page it came from. Blank values read Not published rather than No — silence from a vendor is not a negative answer.
| Field | LiteLLM | Cloudflare AI Gateway |
|---|---|---|
| Ease of leaving Derived score, higher is easier | 100/100 Easy to leave | 58/78 Some work to leave |
| Runs fully disconnected Air-gapped deployment | Yes | No |
| Response caching Response caching | Yes | Yes |
| Content guardrails Content guardrails | Yes | Yes |
| Strips personal data PII redaction | Yes | Yes |
| Usage dashboards and logs Observability | Yes | Yes |
| Can use your own provider accounts BYOK supported | Yes | Yes |
| Settings can live in version control Declarative config-as-code | Yes | Yes |
| GitHub stars GitHub stars | 57,500 | Not published |
| Requests per second ceiling Throughput | 2,800 rps | Not published |
Verified 3 days ago for LiteLLM and Verified 3 days ago for Cloudflare AI Gateway. Want more fields, or a third option in the mix? Open these two in the full comparison tool.
Common questions
Does Cloudflare AI Gateway cost anything?
The gateway features are free on all plans, including analytics, caching, rate limiting and DLP scanning. The only percentage fee is 5% on credits if you choose to pay upstream providers through Cloudflare's Unified Billing. Log volume is capped by plan: 100,000 logs total on Workers Free, 10 million per gateway on Workers Paid.
How many providers does each support?
LiteLLM states 140+ providers. Cloudflare's provider-native page enumerates 24 and its documentation refers to 20+ supported providers. Neither publishes a meaningful aggregate model count.
Can I run Cloudflare AI Gateway on my own infrastructure?
No. It is managed only and cannot be air-gapped. LiteLLM is self-host only and can be.
Which is less work to operate?
Cloudflare, by a wide margin. There is nothing to deploy or maintain. LiteLLM requires you to run the proxy plus Postgres and Redis, and to own its uptime.