If you are looking for LiteLLM alternatives, you will find four kinds: a gateway you host yourself (Bifrost, agentgateway, the Portkey gateway), a hosted router (OpenRouter, Vercel AI Gateway, Cloudflare AI Gateway, us), no gateway at all (a provider SDK plus a fallback in your code), and LiteLLM itself, pinned and hashed. The top results give you a feature grid. This post gives you what they do not: the two 2026 LiteLLM incidents lined up from the project’s own pages with their exposure windows, an alternatives table built from each project’s repository or pricing page on 27 November 2026, a decision flow, and an ops-hours calculator you can fill in. We publish this and we run one of the hosted options, so the hosted answer is the one we have a stake in. Judge accordingly.
What counts as a LiteLLM alternative?
Anything that lets one application talk to several model providers through one interface counts, and the four kinds solve different problems. Be clear about which problem you have before you read a comparison grid, because “a gateway” covers a library, a proxy server, a cloud service and a billing layer.
LiteLLM deserves a fair description first. Its GitHub repository calls it an open source AI gateway for 100+ LLMs, offered as a Python SDK and as a proxy server, and showed about 64,000 stars when we read it on 27 November 2026. The project’s documentation describes the proxy as a self-hosted server with virtual keys, spend tracking, load balancing, fallbacks, guardrails and an admin interface, and it says to use the Python SDK instead if one Python application needs none of that. PyPI listed version 1.111.0 as the latest release and an MIT licence; the GitHub page lists the licence as “Other”, so read the licence file for what the enterprise features need. Nothing below says LiteLLM is a bad project. It has the longest provider list of the projects we read, and for many teams it is still the right choice.
The reason people search for alternatives right now is narrower: the way it was delivered failed twice in one year. The comparison of what each alternative changes about that risk is the useful part, and it needs the facts of the two incidents first.
What happened in the two 2026 LiteLLM incidents?
On 24 March 2026 two PyPI releases, 1.82.7 and 1.82.8, carried a credential stealer, and on 21 October 2026 a release called 1.107.0 did the same through PyPI and the project’s container images. The two attacks entered by different doors, and that difference is the most useful thing to take from them. All of the figures below come from the project’s own incident pages, the registry’s report, a GitHub advisory and Microsoft’s analysis, read on 27 November 2026.
| March 2026 | October 2026 | |
|---|---|---|
| Affected | PyPI releases 1.82.7 and 1.82.8 | PyPI release 1.107.0; Docker Hub and GHCR tags v1.107.0, latest, main-latest, main-stable |
| Exposure | PyPI’s report: 2 h 32 min from upload to quarantine, over 119,000 downloads | PyPI 11:39 to 13:23 UTC; Docker Hub 11:46 to 14:20 UTC |
| Entry point | A compromised Trivy dependency in the project’s CI exposed a PyPI token (PyPI report) | An admin key for an internal experimental service, committed to a public repository in May and never revoked, led to an organisation owner’s GitHub token (LiteLLM’s follow-up) |
| Official Docker image | Not affected, per the project | Affected |
| Artifacts | Unsigned, published outside the pipeline | Signed, with valid Trusted Publishing provenance, because the pipeline itself built attacker-controlled source |
| What it took | Environment variables, SSH keys, cloud credentials, Kubernetes tokens, database passwords | Credentials across developer tools, cloud, browsers and the proxy’s own database records (Microsoft) |
The March page, titled Suspected Supply Chain Incident, names the affected releases, says the malware harvested secrets and sent them to a domain that is not LiteLLM’s, and advises rotating every credential on an affected system. It also says the official proxy Docker image was not affected and that a clean 1.83.0 came out on 30 March from a rebuilt pipeline. The GitHub advisory rates it critical and lists 1.82.7 and 1.82.8 as the affected range. One detail shows why you read primary sources: LiteLLM’s first page said the packages were live for about 40 minutes, while the PyPI report counts 2 h 32 min from upload to quarantine. We use PyPI’s number and mark the disagreement.
The October incident page says the release pipeline was compromised, that 1.107.0 contained compiled malware that steals credentials and loads remote-code tools, and that enterprise customers on the private registry were not affected. Its recovery advice is blunt: do not start with pip, because any Python start in an affected environment runs the payload again; delete the startup files, kill the loader process, rebuild, and rotate everything the host could reach, including every provider key stored in the proxy’s database and the master and virtual keys. Microsoft’s analysis adds that removing the package or a release tag is not sufficient recovery, because the startup files sit outside the package directory.
How long each bad release was live
- March: PyPI, upload to quarantine2 h 32 minPyPI incident report
- October: PyPI, 1.107.01 h 44 minLiteLLM, 11:39 to 13:23 UTC
- October: Docker Hub tags2 h 34 minLiteLLM, 11:46 to 14:20 UTC
- A three-day install cooldown72 hwhat the PyPI report suggests
The two incidents also differ in what a defender could have done. LiteLLM’s own comparison says the controls added after March (isolated stages, Trusted Publishing, signed images, immutable tags, pinned actions) worked as designed and limited the damage, but could not stop an attacker who held an organisation owner’s token, because the owner controls the pipeline. A signature proved the artifact came from the pipeline. It did not prove the pipeline was building what you thought. That is not a story about careless people. The project published detailed timelines, a root cause and a list of changes, which is more than many vendors do. It is a story about what a widely installed package that holds keys looks like to an attacker.
What do the alternatives look like on 27 November 2026?
Here is the table we built from each project’s repository, documentation or pricing page. Every cell was read on 27 November 2026, and where a page gave no figure we left the cell plain instead of copying one from a roundup. “Status” is what the primary page itself shows today.
| Option | Runs where | Licence and language, as listed | Status and cost notes from the source |
|---|---|---|---|
| LiteLLM, pinned | Your servers | PyPI: MIT; GitHub: “Other”; Python with a Rust core per the README | PyPI latest 1.111.0; two malicious releases in 2026, both pulled |
| Bifrost | Your servers | Apache-2.0, Go | README lists 23+ providers, failover, caching, virtual keys, budgets; enterprise adds clustering, guardrails, MCP gateway |
| agentgateway | Your servers or Kubernetes | Apache-2.0, Rust and Go | README: a Linux Foundation project, LLM gateway with budget and spend controls plus MCP and A2A |
| Portkey gateway | Your servers, edge workers | MIT, TypeScript | Latest tag v1.15.2 (12 January); README banner announces a 2.0 pre-release |
| Helicone AI Gateway | Your servers or Helicone cloud | GPL-3.0, Rust | Parent acquired by Mintlify on 3 March 2026, in maintenance mode |
| TensorZero | Your servers | Apache-2.0, Rust | Archived on GitHub, read-only |
| OpenRouter | Hosted | Service | 5.5% fee on credit purchases, $0.80 minimum, 5% for crypto; no markup on inference |
| Vercel AI Gateway | Hosted | Service | No markup, no platform fee on tokens; free tier covers a subset of models |
| Cloudflare AI Gateway | Hosted | Service | Core features free; 5% fee on Unified Billing credits, card only |
| Provider SDK plus a fallback | Your code | Whatever the SDK uses | No new service; you write the fallback |
| One AI API Key | Hosted | Service | $10 sign-up credit, 47 free ids, no card; no bring-your-own-key |
We left out Kong AI Gateway, Envoy-based gateways and Apache APISIX. They are real options, but we did not open their documentation for this post, and we would rather drop a row than repeat a claim we did not check.
The self-hosted group
Bifrost has the feature list closest to LiteLLM’s proxy: virtual keys, budgets, failover and caching. It is a Go service you start with one command or a container, configured through a web interface, under Apache-2.0. Its README advertises under 200 microseconds of overhead at 5,000 requests a second; that is the vendor’s own figure and we did not measure it. The line to read is the enterprise one: the README says enterprise deployments add adaptive load balancing, clustering, guardrails and the MCP gateway, so check which side of that line your needs fall on.
agentgateway comes from a different direction. It is an Apache-2.0 proxy that the README describes as a Linux Foundation project, built around agent and tool traffic (MCP and agent-to-agent) with an LLM gateway that has budget and spend controls and failover. It has a Kubernetes controller and a standalone mode. If you already run Gateway API on Kubernetes, it fits naturally. If you want one container and a key-management page, compare it with Bifrost first.
Portkey’s gateway is a small MIT-licensed TypeScript project with retries (up to five, with exponential backoff), fallbacks, load balancing and guardrails in its README. Two things to check before adopting it: the latest tagged release on its releases page is v1.15.2 from 12 January, and the README announces a 2.0 pre-release that merges its enterprise gateway into the open-source project. Our Portkey comparison is dated and sourced.
Two names appear on older lists and need care. The Helicone AI Gateway is a Rust project that GitHub lists under GPL-3.0, and its README still carries a Public Beta badge. Mintlify announced it was acquiring Helicone on 3 March 2026 and said Helicone would keep operating in maintenance mode, with security updates, bug fixes and new models still shipping and help for customers migrating elsewhere. Helicone’s own home page now says Helicone is part of Experiential Labs, with details to come. Our guide to Helicone alternatives goes through what maintenance mode does and does not break. TensorZero’s repository carries an Archived label on GitHub, so it is read-only; do not start a new deployment on it.
The hosted group
All three big hosted gateways say they pass provider prices through, and they differ on what they charge around that. OpenRouter’s FAQ says it charges 5.5% with a $0.80 minimum when you buy credits and 5% for crypto, does not mark up inference, and offers bring-your-own-key with a monthly allowance before a 5% fee applies. Vercel’s pricing page says no markup and no platform fee on tokens, a free tier limited to a subset of models, and add-on surcharges for some optional capabilities. Cloudflare’s pricing page lists analytics, caching and rate limiting as free, charges 5% on credits bought through Unified Billing, and accepts cards only for those credits. Our guide to gateway fees lays the same three side by side with the arithmetic.
One ownership fact matters for the hosted group. Stripe’s newsroom announced on 19 August 2026 that it had agreed to acquire OpenRouter, and Stripe Japan’s press release of 16 November reproduces the announcement that the acquisition was completed on 10 November. The release describes OpenRouter as a neutral foundation for choosing models and announces no new pricing, and we read no more into it than that. Fees, credit expiry and data terms are the things to watch, and the OpenRouter alternatives post lists seven options if you want a second route ready.
For a full side-by-side of the whole market we maintain a nine-option gateway table with criteria stated up front,, and our dated OpenRouter comparison says where they are stronger than we are.
What does a self-hosted gateway put at risk that a hosted one does not?
It puts every key it routes with in one place you operate. That is the structural difference the incidents expose, and it is not a flaw of LiteLLM alone: any self-hosted gateway that holds provider keys, a master key and a database has the same shape.
Think about what the October recovery advice asked people to rotate: the instance’s cloud role, every provider key stored in the proxy’s database, the master key and the virtual keys, the database password, and any secret in the environment of any process on the host. That list is long because the gateway sits at a junction. It needs keys for five providers, a key that mints more keys, and a database that stores them, so a stolen environment is a stolen set of accounts.
A hosted gateway has a different failure. You hold one key, issued by the operator, and the provider keys never reach your hosts. A bad release in the operator’s pipeline can still hurt you, and you cannot inspect that pipeline. What you can do is bound the damage on your side of the line. A key with a spend limit, an expiry date and a model allowlist can only cost what it is allowed to cost, and a small prepaid balance caps the rest. The guide to one key per project with spend limits shows the pattern, and the API key security guide covers storage and rotation for any key.
| If this leaks or is stolen | Self-hosted gateway | Hosted gateway |
|---|---|---|
| A provider key | Yours, with the provider’s own limits | Not on your hosts |
| The master or admin key | Can mint keys and read spend | Not applicable, the operator holds it |
| The gateway key your apps use | Limited by the virtual key’s budget | Limited by the key’s spend limit and your balance |
| The host environment | Everything the host could read | Your app’s own secrets only |
| The release pipeline | Yours to secure and audit | The operator’s, which you cannot audit |
The last row is the honest cost of hosted. If a vendor’s pipeline is compromised, you are exposed to the vendor’s mistake. That is a trust decision, and the way to make it is to test the service cheaply and read what it publishes, which the part about our own service below does step by step. A company with its own security team and an audit requirement may rightly prefer to carry that risk itself.
Which supply-chain checks would have stopped these incidents?
Seven checks cover the failure modes both incidents showed, and the first three are free. Which of the two incidents each one would have stopped is stated plainly in the table, because several of the folk-wisdom fixes do not work against October.
| Check | Stops | Would it have stopped March? | October? |
|---|---|---|---|
| Pin the exact version and verify hashes | A new release arriving silently | Yes, if pinned to an earlier version | Yes, if pinned to an earlier version |
| Install cooldown (ignore releases under about 3 days old) | Malware that is pulled within hours | Yes: window was 2 h 32 min | Yes for PyPI: window was 1 h 44 min |
| Container image by digest, not tag | A moving tag repointed to bad content | Official image was not affected | Yes: four tags were repointed |
| Read a script before piping it to a shell | A bad installer | Not applicable | Not applicable |
| Block outbound traffic from the proxy host except provider hosts | Data leaving to an unknown domain | Likely: exfiltration went to a named outside domain | Likely: the collector uploaded over the network, per Microsoft |
| Keep keys small: provider-side spend caps, scoped keys | Loss after a theft | Limits the loss | Limits the loss |
| Treat signatures and provenance as necessary, not sufficient | False confidence | A signature was absent | A valid signature did not help |
A few notes on the table. The first row works because hash-checking mode makes pip refuse anything whose hash is not in your requirements file; the pip documentation says that by default pip does no check against remote tampering, and that hash-checking needs every requirement pinned and hashed. The second row comes from the PyPI report, which suggests dependency cooldowns of about three days and shows exclude-newer = "P3D" for uv and an absolute --uploaded-prior-to option from pip 26.0. The report also estimates that between 40 and 50 percent of LiteLLM installs were unpinned, fetching the latest release on every install, which is the population a poisoned release reaches first.
The fourth row is a smaller point but a real one. The proxy documentation’s quick start is a command that downloads a script from the project’s main branch and pipes it to a shell. That is common practice and not a reproach to the project, but it means that the safety of that line is the safety of whatever sits on that branch the moment you run it. Read the script first, or install a pinned release by another route.
The fifth row deserves attention because it is the check that works whatever the attacker does. A gateway host needs to reach your provider hosts and almost nothing else. If the March payload had tried to send data to a domain that is not on your allowlist, the connection would have failed. The project describes the exfiltration target as a domain it does not own. An egress rule is a few lines of firewall configuration, and it is the one control on this list that you can apply to every alternative above, including ours if you ever self-host.
# 1. requirements.txt: exact version plus hashes (build it with pip-compile --generate-hashes)
litellm==<the-version-you-reviewed> \
--hash=sha256:<hash-from-your-own-lock-file>
# 2. install refusing anything that is not pinned and hashed
python -m pip install --require-hashes --only-binary :all: -r requirements.txt
# 3. uv: ignore releases younger than three days (pyproject.toml)
[tool.uv]
exclude-newer = "P3D"
# 4. Docker Compose: an image digest you checked, never a moving tag
services:
gateway:
image: ghcr.io/berriai/litellm@sha256:<digest-you-verified>If you run a LiteLLM environment today, two small things are worth doing this afternoon. The first is to check what is installed. The second, for any host you suspect, is to look for the incidents’ files without starting Python, because the October guidance says that starting Python in an affected environment re-runs the payload.
import sys
from importlib import metadata
BAD = {"1.82.7", "1.82.8", "1.107.0"} # releases the project itself named as malicious
try:
version = metadata.version("litellm")
except metadata.PackageNotFoundError:
print("litellm is not installed in this environment")
sys.exit(0)
print("litellm", version)
if version in BAD:
print("MALICIOUS RELEASE. Stop. Rotate every secret this host could read.")
sys.exit(2)# Look for the files the two incidents left behind, without starting Python
find / -xdev \( -name 'litellm-1.82.7.dist-info' -o -name 'litellm-1.82.8.dist-info' \
-o -name 'litellm-1.107.0.dist-info' -o -name 'litellm_init.pth' -o -name 'cook.pth' \) 2>/dev/nullThe Python script is for a fresh environment or a CI job that guards a build; on a host you think was exposed, use the find command and then follow the project’s incident pages. The file names come from those pages: litellm_init.pth from March, cook.pth and the 1.107.0 metadata folder from October.
Could your gateway survive a bad release?
0 of 8 in place
Exposed
A bad release would reach production unnoticed. Fix the first three items before you touch anything else, or use a hosted route and spend this time elsewhere.
How many hours does running your own gateway really take?
Plan for routine hours every month plus a block for each incident, and price your time instead of treating it as free. The calculator below uses a different set of inputs from the break-even calculator in our LiteLLM against a hosted gateway post: it adds the incident work, which is what 2026 made hard to ignore. Every default is a placeholder to replace, not a quote from any vendor.
Self-hosting hours with incidents included
- Hours per incident, rotation included
- 16.17
- Hours a year, routine plus incidents
- 68.33
- Self-hosting, cost a year
- $4,580.00
- Hosted overhead, cost a year
- $1,320.00
- Share of self-hosting cost that is incident work
- 42.4%
- Break-even monthly token spend
- $6,939.39
The 5.5% default is OpenRouter's published credit fee, read on 27 November 2026; our own overhead is a gap in each model's rate, not a fee. It ignores volume terms, free tiers, provider discounts you hold directly and the cost of downtime. The two incidents a year is the 2026 count for LiteLLM, not a forecast.
The defaults give a worked example. Each incident is 12 hours of rebuild plus 25 secrets at 10 minutes each, which is 4.17 hours, so 16.17 hours. Two of them are 32.33 hours. Routine work is 3 hours a month, or 36 hours a year, so the total is 68.33 hours. At $60 an hour that is $4,100, and with $480 of infrastructure the year costs $4,580. At $2,000 a month in tokens and a 5.5% overhead, the hosted route costs $1,320 a year, so the hosted route is cheaper by $3,260. The incident work alone is $1,940, about 42 percent of the self-hosting bill.
Change one input at a time. Set the incidents to zero and self-hosting drops to $2,640, still above the hosted figure at this spend. Raise the token spend to $7,000 a month and the 5.5% overhead is $4,620, so self-hosting at $4,580 starts to win; the break-even line with the defaults is about $6,940 a month. That is the pattern the earlier post found with a simpler model, and the new line is the one people forget: a security incident is not a rare event for a package that holds keys.
Two honest caveats. If you already run production services with on-call and a patching routine, your marginal hours are lower than the defaults, and self-hosting wins at a lower spend. If you hold provider discounts that a gateway cannot match, the savings on the token bill can dwarf either side of this arithmetic. If you want to price the tokens before you decide anything, use the cost calculator and the guide to estimating a monthly LLM bill.
Do you need a gateway at all?
Often you do not. One service that talks to two providers needs a fallback function, not a proxy with a database, and the code is short enough to read in a minute. The fallback below keeps base URL, key and model id in environment variables, tries the primary, and moves to the backup on a connection error or an error status. It has no dependency beyond the official OpenAI SDK, which several providers accept with a different base URL.
import os
import openai
from openai import OpenAI
# Two routes, all values from the environment so either can be swapped in minutes
ROUTES = [
{"base_url": os.environ["PRIMARY_BASE_URL"], "key": os.environ["PRIMARY_API_KEY"], "model": os.environ["PRIMARY_MODEL"]},
{"base_url": os.environ["BACKUP_BASE_URL"], "key": os.environ["BACKUP_API_KEY"], "model": os.environ["BACKUP_MODEL"]},
]
def ask(prompt: str) -> str:
last_error = None
for route in ROUTES:
client = OpenAI(base_url=route["base_url"], api_key=route["key"], timeout=30, max_retries=1)
try:
reply = client.chat.completions.create(
model=route["model"],
max_tokens=300,
messages=[{"role": "user", "content": prompt}],
)
return reply.choices[0].message.content
except (openai.APIConnectionError, openai.APIStatusError) as err:
last_error = err # try the next route
raise last_errorWhat you give up is everything a gateway centralises: one key per project, spend tracking per key, a usage record across providers, and one place to change a model name. The code above also treats every error alike; the right retry rules differ for a 429 and a 500, which the guide to LLM API 429 errors and the post on uptime and fallbacks work through. The guide to what an LLM gateway is explains the layer if the term is new.
The cost of switching later is the other half. Keep three values in configuration and nowhere else, as the guide to switching an SDK to a different base URL shows, and the migration guide lists what changes when you move.
Which alternative fits you
Which describes your situation?
One Python app, two providers
A team that needs budgets and SSO
Coding agents and scripts, many models
Regulated or contract-bound data
How does a hosted gateway like ours pass the same tests?
We cannot tell you to trust us, so here are the tests you can run yourself, in order of cost. The first three cost nothing and take under an hour. We publish this post and run the service, which is why we list the limits first.
The limits are these. Keys here carry a spend limit, an expiry date, a model allowlist and a requests-per-minute limit, and one account owns them. There is no bring-your-own-key, no teams, no single sign-on and no custom code in the request path. We do not promise uptime, and the terms say so. If any of those is a requirement, self-hosting is the answer and this section is not for you.
The tests, then:
- Sign in and look. Sign-in is Google only and nothing asks for a card. The $10 sign-up credit pays priced models first, and 47 free ids share 100 requests and 3,000,000 tokens a day with a $0 balance. Adding credit and paid models are handled by hand today: email somdutt777@gmail.com, because online checkout is not open yet. The pricing page and the models page show current rates and what is listed.
- Make one call. Create a key in the console and send the request below to a free id. Only the base URL and the key differ from any OpenAI-compatible client, which is also why leaving is cheap.
- Read the record. Open the usage page and find the request. It shows model, token counts and charge, not your prompt: by default what you send is not stored, we keep counts and not content, and we do not train on your data. The routing and privacy docs show the fields.
- Check the model. The six checks for a real model work on any gateway, ours included.
- Look at what we publish. The status page probes each listed model, the rankings show measured usage, and the transparency page says what we monitor and what we cannot see.
export ONEAIAPIKEY_API_KEY="paste-your-key-here"
curl https://api.oneaiapikey.com/v1/chat/completions \
-H "Authorization: Bearer $ONEAIAPIKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "z-ai-glm-5.3:free",
"max_tokens": 120,
"messages": [{"role": "user", "content": "Name one risk of running an LLM proxy yourself, in one sentence."}]
}'What the hosted route buys you in reliability is a retry layer you do not write. The gateway retries the model you named up to twice, and if it is still failing, fallback rules, presets and automatic routing can move the request to another similar model. You can name up to three fallback ids with the X-Fallback-Models header, and only the attempt that answers is billed; the headers reference and the failover rules give the detail. The cost of that convenience is the one named earlier: you trust our pipeline, and you cannot inspect it. Bound it with a spend limit, an expiry and a small balance, the way the cost-control documentation suggests.
We also run into the same supply-chain questions you do. A hosted gateway is software built from dependencies, and it is not exempt from the failure modes in this post; the difference is that you are not the one installing the package. If you want to know how we handle releases and keys before you send traffic, email somdutt777@gmail.com and ask, and compare the answer with the questions in our guide to what a gateway sees and stores. A vague answer from any operator is an answer.
What would we do?
We would not rip out a working, pinned LiteLLM because of a headline. We would pin it and hash it, wait three days before upgrades, restrict the host’s outbound traffic, cap the provider keys and write down the rotation steps. If nobody on the team wanted to own that, we would move to a hosted route, test it free for a week, and keep the base URL in configuration so the choice is reversible.
For a developer, a small team or an agent setup with many models behind one key, the shortest path is a hosted key. Start with the free models list and the browser chat, which draws on the same allowance, then read the quickstart for the first call from code. The guide to free models via the API sorts them by task, and the Anthropic and OpenAI compatibility guide explains which client formats the endpoint speaks. For a decision about the whole class of gateway, the 12-point provider checklist is the hub of this series, and the gateway fee comparison shows what other gateways add on top of token prices.
If you are coming from OpenRouter instead of LiteLLM, the migration guide covers keys and model ids, the OpenRouter comparison is dated and sourced, and the review of One AI API Key is written in the same plain tone as this one. Money terms are on the terms page and in the post on prepaid credits: once a key is created and its usage consumed we do not give money back, and if something on our side breaks you can write to support with a genuine concern, case by case. Every request is also covered by the acceptable use policy.
Test the hosted route before you build the self-hosted one
$10 sign-up credit, 47 free models sharing 100 requests and 3,000,000 tokens a day, no card.