LiteLLM vs Portkey Gateway (self-hosted)
Both are alternatives to Portkey. Here's how they stack up — verified facts, no spin.
Also searched as Portkey Gateway (self-hosted) vs LiteLLM — same comparison, one verdict.
LiteLLM
TOP PICKOne OpenAI-compatible API in front of 100+ providers, running on your own box.
LiteLLM is the de facto open gateway for this layer: a proxy that exposes an OpenAI-compatible endpoint in front of 100+ providers, with virtual keys, per-team budgets, rate limits, fallbacks and logging. You run it, so prompts never leave your infrastructure and there is zero markup on token spend — you pay the model providers directly. At 55k GitHub stars with commits landing daily it is the most widely adopted option here. Licensing is worth reading precisely: the core is MIT, while everything under the repository's enterprise/ directory carries a separate commercial licence.
Portkey Gateway (self-hosted)
Portkey's own routing engine, MIT-licensed and running on your hardware.
Worth knowing before you buy the platform: Portkey publishes its gateway as open source under the MIT licence, so the routing engine — 250+ models, failover, load balancing, caching — can be self-hosted at no cost. What the subscription adds is the hosted control plane: dashboards, prompt management, guardrails, analytics and support. If your requirement is the routing and not the console, this is the same engine without the bill or the third-party data path.
Side by side
| LiteLLM | Portkey Gateway (self-hosted) | |
|---|---|---|
| Sovereignty Score | 90 | 86 |
| Open source | Yes | Yes |
| Self-hostable | Yes | Yes |
| Local-first | Yes | Yes |
| License | MIT (core); enterprise/ directory under a separate commercial licence | MIT |
| Pricing | Free and self-hosted — you pay the model providers directly with no markup, plus hosting for a small VM (roughly $20–50/month). A paid enterprise tier exists for SSO, audit logs and support. | Free — the gateway is MIT-licensed. You pay only your model providers and your own hosting. |
LiteLLM is Macrostack's recommended Portkey alternative, so it's our pick here.
LiteLLM
Strengths
- +Zero markup — provider tokens are billed to you at cost
- +Prompts and completions never leave your infrastructure
- +Virtual keys, per-team budgets and rate limits built in
- +100+ providers behind one OpenAI-compatible endpoint; 55k stars, daily commits
Trade-offs
- −You run it: deployment, upgrades, monitoring and uptime are yours
- −Observability is basic out of the box — expect to pair it with a tracing tool
- −The MIT core stops at the enterprise/ directory; SSO and audit logging sit behind a commercial licence
- −A proxy you operate is another production dependency to keep healthy
Portkey Gateway (self-hosted)
Strengths
- +MIT licence on the full routing engine
- +Same 250+ model coverage as the hosted product
- +The lowest-friction exit from Portkey's paid tier — same engine, same config shape
- +No third party in the request path when self-hosted
Trade-offs
- −You lose the dashboards, prompt management and guardrails that justify the subscription
- −Development cadence is slower than LiteLLM's
- −Smaller self-hosting community, so fewer worked examples when something breaks
- −You are self-hosting a vendor's open core — feature direction still follows their commercial product
Related alternative guides
Facts verified 2026-07-30. Licenses and pricing change — spotted something out of date? That's a correction we want.