Skip to content

Security and governanceComparison

LiteLLM alternatives in 2026: AI gateways compared

What happened when two LiteLLM releases on PyPI were backdoored, what LiteLLM changed afterwards, the supply-chain controls that matter for any service holding every provider key, and the gateway options available in 2026, each described from its own documentation.

By INFRO Editorial

Published

8 min read

Dark ground with a chain of glass nodes lit in amber, one link cracked and isolated while the rest of the chain reroutes around it

In short

On 24 March 2026, litellm 1.82.7 and 1.82.8 were published to PyPI with credential-stealing code after the attackers obtained publishing access through a compromised Trivy scanner in LiteLLM's CI; LiteLLM removed them, rotated credentials and shipped a clean v1.83.0 through a rebuilt pipeline. The lesson applies to every gateway: pin by hash, publish with short-lived credentials, isolate the proxy and scope the keys it holds. Alternatives are self-hosted open-source gateways (Portkey's gateway, Bifrost, Agent Router, Kong), managed gateways (Cloudflare, Vercel), aggregators (OpenRouter) and BYOK control planes such as INFRO.

Key takeaways

  • litellm 1.82.7 and 1.82.8 were malicious on PyPI on 24 March 2026; LiteLLM says its official Proxy Docker image, which pins dependencies, was not affected.
  • The entry point was a compromised security scanner in CI, not LiteLLM's source code. Any gateway with a release pipeline carries the same class of risk.
  • A gateway holds every provider key you own, so treat it as a tier-zero service: pin by hash, isolate it, scope its keys and rehearse rotation.
  • Alternatives differ most on who holds the provider keys and what happens when your key fails, not on model count.
  • Every product here changes often. Check each vendor's own page on the day you decide.

LiteLLM alternatives became a common search after 24 March 2026, when two LiteLLM releases on PyPI were found to contain credential-stealing code. The short answer: alternatives include self-hosted open-source gateways (Portkey's gateway, Bifrost, Agent Router, Kong AI Gateway), managed gateways (Cloudflare AI Gateway, Vercel AI Gateway), aggregators (OpenRouter) and BYOK control planes such as INFRO. But switching products does not by itself fix the risk the incident exposed. Any gateway holds every provider key you have, and the controls around it matter more than the logo on it.

This article sets out what happened, from LiteLLM's own account and a security vendor's analysis, then the controls that apply to any gateway, then the alternatives, described only from their own pages.

What happened in the LiteLLM supply-chain attack

LiteLLM's security update states that litellm==1.82.7 and litellm==1.82.8 were published to PyPI on 24 March 2026, starting at 10:39 UTC, and that both have been removed. LiteLLM believes the compromise originated in the Trivy dependency used in its CI/CD security scanning workflow; the attacker bypassed the official release workflow and uploaded the packages directly to PyPI1.

Datadog Security Labs traced this to a wider campaign it attributes to TeamPCP. On 19 March, attackers published a malicious Trivy release and force-pushed most trivy-action tags to malicious commits; the tainted actions dumped CI runner memory and exfiltrated credentials. The same campaign reached Checkmarx KICS on 23 March, LiteLLM on 24 March and the Telnyx Python SDK on 27 March2.

According to Datadog, the LiteLLM payload collected environment variables, SSH keys, cloud and Kubernetes credentials, Docker configuration, shell history, database credentials and CI/CD secrets, encrypted them and sent them to a lookalike domain. Version 1.82.7 ran when the proxy module was used; 1.82.8 added a .pth file that runs whenever the Python interpreter starts, which made it the higher-risk version2.

How LiteLLM responded

LiteLLM's update lists its response: the packages removed from PyPI, maintainer credentials rotated, Google's Mandiant engaged for forensics, new releases paused for a supply-chain review, confirmation that no malicious code reached main, cosign-signed Docker images from v1.83.0-nightly, and published SHA-256 checksums and scans for releases v1.78.0 to v1.82.6. On 30 March it announced a clean v1.83.0, built by a new CI/CD pipeline with isolated environments and stronger release gates1.

LiteLLM also states who was not affected: the official LiteLLM Proxy Docker image, which pins dependencies in requirements.txt, LiteLLM Cloud, installs from GitHub source, and anyone who stayed on 1.82.6 or earlier1. That detail is the most useful lesson in the whole incident. The deployment path that pinned its dependencies was not exposed.

LiteLLM remains a widely used open-source project with an MIT license, and its proxy offers virtual keys, per-key and per-team budgets, fallbacks, logging integrations and guardrails3. Nothing in this incident is a reason to assume another gateway's release pipeline is safer without asking.

Supply-chain controls for anything that holds every provider key

A gateway is a tier-zero service. It sees every prompt, and in most designs it holds a credential for every provider account you own. Datadog's guidance is to treat any install of the affected versions as a full-credential exposure, and its point that "reverting the compromised packages" is not complete remediation applies to every product in this article2.

  1. Install by hash, not by version range. pip's hash-checking mode installs only files whose hashes you recorded, and requires every dependency to be pinned once it is on. It protects against a package being altered and against a surprise upgrade through a loose specifier4.
  2. Publish with short-lived credentials. If you maintain anything that ships to PyPI, Trusted Publishing lets CI prove its identity over OIDC and receive a project-scoped token that expires after about 15 minutes, so a token stolen from runner memory stops working quickly5.
  3. Pin your CI actions by commit, not tag. The Trivy stage worked because tags were force-pushed to malicious commits2. A tag is a pointer someone else can move.
  4. Isolate the proxy. Run the gateway in its own container or service account, with only its own secrets mounted, no cloud credentials beyond what it needs and egress limited to provider hosts. The payload harvested whatever the process could read2.
  5. Scope the keys it holds. Give the gateway inference keys only, one per provider account or project, never an organization admin key. See least privilege for provider admin keys.
  6. Rehearse rotation. Know how long it takes to replace every provider key the gateway holds, and every key your applications use to reach the gateway. The guide to securing LLM API keys covers inventory and rotation order.
requirements.txt (hash-pinned)
# generated with: pip-compile --generate-hashes requirements.in
litellm==<verified version> \
    --hash=sha256:<hash recorded from your verified build>
# every transitive dependency is pinned and hashed the same way

# install with:
#   pip install --require-hashes -r requirements.txt

The LiteLLM alternatives, compared

The useful comparison is operational: who runs the gateway, who holds the provider keys, whether your own provider accounts serve the traffic, what happens on failure, whether budgets see the spend, and what is recorded. The table summarises what each product's own pages say; the sections below give the detail and the caveats.

OptionHostingWho holds provider keysYour own provider accounts (BYOK)FailoverBudgetsObservability
LiteLLM proxyYou run itYour deploymentYesFallbacks, load balancingPer key, team, userLogging integrations
Portkey gateway (OSS)You run it, or Portkey's cloudYour deploymentYesFallbacks, retries, load balancingNot described in READMEUsage analytics, local console
BifrostYou run itYour deploymentYesAutomatic failover, load balancingVirtual keys, team and customer budgetsPrometheus, tracing, logs
Agent Router (formerly Envoy AI Gateway)You run it, or hosted by TetrateThe routerYesProvider fallbackToken limits per team, app or modelOpenTelemetry GenAI
Kong AI GatewaySelf-hosted or Kong-hosted data planes, managed through KonnectThe gateway's provider entityYesLoad balancing and failoverToken rate limitingMetrics, OpenTelemetry, audit logs
Cloudflare AI GatewayManagedCloudflare Secrets Store, or per requestYes, or Cloudflare billingRetries and model fallbacksSpend limits incl. BYOK on priced modelsAnalytics, logs
Vercel AI GatewayManagedVercel teamYes, falls back to Vercel's credentialsProvider and model fallbacksBudgets exclude BYOK spendRequest logs
OpenRouterManagedOpenRouterYes, falls back to shared capacity by defaultProvider fallbacks by defaultNot compared hereNot compared here
INFROManagedINFRO, sealed per connectionOnly your own accountsAcross your own connectionsHard caps per org, project, member, keyUsage, traces, audit log

Self-hosted open-source gateways

Running your own gateway keeps keys and prompts inside your network. It also makes the supply chain yours: you choose versions, verify them and patch them.

  • Portkey's gateway is MIT-licensed and starts with npx @portkey-ai/gateway, Docker, Node.js or a Cloudflare Workers deployment. Its README lists fallbacks, up to five retries with backoff, weighted load balancing across keys or providers and pre-built guardrails; it does not describe budgets6.
  • Bifrost is Apache 2.0, runs with npx -y @maximhq/bifrost or Docker, and lists automatic failover, load balancing across keys and providers, hierarchical budgets through virtual keys, Prometheus metrics, tracing and an MCP gateway7.
  • Agent Router, the new name of Envoy AI Gateway since it joined the Agentic AI Foundation on 10 September 2026, keeps its Apache 2.0 license, CRDs, aigw CLI and maintainers8. Its site lists provider fallback, token limits per team, app or model, provider credentials held and rotated at the router, OpenTelemetry GenAI telemetry and a filtered MCP tool catalog, on Kubernetes, standalone or hosted by Tetrate9.
  • Kong AI Gateway is managed through Konnect with data planes self-hosted, Kong-hosted or on Kubernetes. It lists token-based rate limiting, semantic caching, prompt guards and PII sanitising, load balancing and failover, and provider credentials centralised in an AI Model Provider entity10.

Managed gateways

A managed gateway moves patching and release engineering to the vendor. You are then trusting their pipeline, so ask how they build, sign and deploy it.

  • Cloudflare AI Gateway lists analytics, logging, caching, rate limiting, and request retry and model fallback11. BYOK keys are stored in Cloudflare Secrets Store, and a provider authorization header on the request takes precedence over the stored key12. Its spend limits count BYOK traffic for models with known pricing and return 429 at the limit; Cloudflare notes that spend is tracked with eventual consistency, so a concurrent burst can briefly pass it13.
  • Vercel AI Gateway offers request logs, budgets per team, project, key or member, and provider and model fallbacks14. With BYOK, a failed request is retried on Vercel's own system credentials, billed to your AI Gateway balance, and BYOK spend is not counted in budgets15.

Aggregators

OpenRouter serves traffic through its own provider accounts or your keys. With BYOK it charges a fee of 5% of what the same usage would cost on OpenRouter, and by default falls back to its shared endpoints when your key fails or hits a rate limit; each key can be set to never use shared capacity16. Provider fallbacks are on by default and can be disabled per request with allow_fallbacks: false17. The OpenRouter alternatives comparison covers the commercial model in more depth.

BYOK control planes

INFRO is a hosted gateway that serves traffic only through provider accounts you connect, and it bills a software subscription with no markup on model spend. Each provider key is sealed with AES-256-GCM, bound to your organization and that one connection, and never returned by any endpoint. Applications use INFRO gateway keys, which can be limited to chosen providers or IP ranges and rotated with an overlap window, so the old key keeps working while you deploy the new one. Failover moves between your own connections only; there is no shared pool to fall back to, so budgets, which are hard caps per organization, project, member and key, see all of the spend. Request traces, usage by key and project, and an audit log of key, connection and policy changes are recorded. A hosted gateway is still a party you trust with your keys: ask any vendor, including us, how its release pipeline is protected.

Choosing after an incident

Decide by your constraints, not by the incident:

  • Prompts and keys must stay in your network. Self-host. Budget the engineering for version pinning, isolation and upgrades, and compare the work with the build vs buy analysis.
  • You want no gateway to operate, and your own contracts must carry all traffic. Check, for each managed option, what happens when your key fails and whether budgets count your own-key spend. Those two answers differ more than the feature lists.
  • You stay on LiteLLM. Pin a verified version by hash, prefer the pinned Docker image path LiteLLM recommends, isolate the proxy, scope its keys, and keep up with its later security releases.

Whatever you choose, write the rotation runbook now and run it once. The incident's real cost fell on teams that had to discover, under pressure, which keys a compromised process could read.

Questions readers ask

Was the LiteLLM Docker image affected by the March 2026 compromise?
LiteLLM states that customers running the official LiteLLM Proxy Docker image were not affected, because that image pins its dependencies, and it lists LiteLLM Cloud, source installs from GitHub and installs that stayed on 1.82.6 or earlier as unaffected too. Environments that installed 1.82.7 or 1.82.8 from PyPI should be treated as fully exposed.
Is LiteLLM safe to use after the supply-chain attack?
LiteLLM removed the two malicious releases, rotated maintainer credentials, engaged Mandiant, published checksums for earlier releases and shipped v1.83.0 from a rebuilt CI/CD pipeline. Whether it fits you is a question of your own controls: pin a verified version by hash, run the proxy isolated, and keep upgrading for later security fixes as LiteLLM publishes them.
What is the difference between LiteLLM and Portkey's gateway?
Both are open-source gateways you can run yourself. LiteLLM is a Python SDK and proxy with virtual keys, budgets, fallbacks, logging integrations and guardrails. Portkey's gateway is an MIT-licensed gateway you can start with npx or Docker or deploy to Cloudflare Workers, with fallbacks, retries, load balancing and guardrails; its README does not describe budgets.
Do I need to rotate provider keys if I never installed the bad versions?
Not because of this incident. Rotation is still worth rehearsing: a gateway holds every provider key you own, and the time to learn how long a rotation takes is before you need one.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.Security Update: Suspected Supply Chain Incident (opens in a new tab) — LiteLLM. Accessed Oct 19, 2026.
  2. 2.LiteLLM and Telnyx compromised on PyPI: Tracing the TeamPCP supply chain campaign (opens in a new tab) — Datadog Security Labs. Accessed Oct 19, 2026.
  3. 3.LiteLLM AI Gateway (proxy server) (opens in a new tab) — LiteLLM. Accessed Oct 19, 2026.
  4. 4.Secure installs (opens in a new tab) — pip (PyPA). Accessed Oct 19, 2026.
  5. 5.Trusted Publishers (opens in a new tab) — Python Package Index. Accessed Oct 19, 2026.
  6. 6.Portkey-AI/gateway (opens in a new tab) — GitHub. Accessed Oct 19, 2026.
  7. 7.maximhq/bifrost (opens in a new tab) — GitHub. Accessed Oct 19, 2026.
  8. 8.Envoy AI Gateway is becoming Agent Router (opens in a new tab) — Agent Router. Accessed Oct 19, 2026.
  9. 9.Agent Router (opens in a new tab) — Agent Router. Accessed Oct 19, 2026.
  10. 10.Kong AI Gateway (opens in a new tab) — Kong. Accessed Oct 19, 2026.
  11. 11.AI Gateway overview (opens in a new tab) — Cloudflare. Accessed Oct 19, 2026.
  12. 12.Bring your own keys (BYOK) (opens in a new tab) — Cloudflare. Accessed Oct 19, 2026.
  13. 13.Spend limits (opens in a new tab) — Cloudflare. Accessed Oct 19, 2026.
  14. 14.Vercel AI Gateway: Models, Routing, and Observability (opens in a new tab) — Vercel. Accessed Oct 19, 2026.
  15. 15.Bring Your Own Key (BYOK) to AI Gateway (opens in a new tab) — Vercel. Accessed Oct 19, 2026.
  16. 16.BYOK (opens in a new tab) — OpenRouter. Accessed Oct 19, 2026.
  17. 17.Provider selection (opens in a new tab) — OpenRouter. Accessed Oct 19, 2026.

About this article

Written by the team building INFRO, which competes with several products named here. The incident is described from LiteLLM's own security update and Datadog Security Labs' analysis, both opened on 2026-10-19. Every statement about another gateway is taken from that product's own README, documentation or announcement, opened the same day, and limited to what it says; where a page did not state something, the table says so. No performance comparison is made. INFRO's behaviour is described from its public documentation.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.