LiteLLM alternatives: open-source Portkey vs hosted OpenRouter
Updated Published By Agent Radar4 min read
Short answer
Need a self-hosted LiteLLM alternative? Separate Portkey’s MIT gateway from OpenRouter’s hosted API, with free-plan limits and a migration checklist.
Top pick: Portkey. An MIT-licensed gateway you can run yourself; hosted Developer and Production plans are separate products.
Quick comparison
| Pick | License | Pricing | Source |
|---|---|---|---|
| 1.Portkey | MIT (gateway repository) | Self-hosted code; separate hosted free Developer plan and paid Production plan | Gateway repository |
| 2.OpenRouter | Not stated | Hosted Free plan or paid model usage and credit-purchase fees | Quickstart |
If you searched for open-source LiteLLM alternatives, start with deployment control: Portkey’s gateway can run on your infrastructure; OpenRouter is a hosted API, not an open-source gateway recommendation. They solve different operational needs. A unified model API is not necessarily self-hostable.
Choose by what you need to replace
| Requirement | Starting point | Important boundary |
|---|---|---|
| Own the gateway process and inspect its code | Portkey | MIT gateway code; hosting and inference are separate |
| Stop operating a gateway and call a managed endpoint | OpenRouter | Hosted service, not the self-hosted shortlist |
| Keep the Python interface but reduce dependencies | LiteLLM with litellm-core | A packaging change, not a gateway migration |
LiteLLM documents both its Python SDK and a self-hosted proxy with virtual keys, cost tracking and an admin UI. Its leaner litellm-core distribution preserves Python imports but cannot coexist with the full distribution. Check that option if dependency footprint—not routing—is your problem. LiteLLM documentation.
The actual LiteLLM license makes code outside enterprise/ MIT-licensed and points enterprise code to separate terms. An unrecognized GitHub license field is not evidence that a project lacks an open-source license; read its license file.
Portkey: the self-hosted candidate
Portkey’s gateway license is MIT. Its repository quickstart runs a local gateway with Node.js/npm and documents routing, retries, fallbacks and a local console. These are reasons to evaluate it, not proof that your LiteLLM configuration transfers unchanged.
The repository currently labels Gateway 2.0 a pre-release. Pin the version you evaluate and check its actual capabilities; do not treat announced enterprise-to-open-source convergence as completed feature parity. Running the gateway locally also does not mean inference stays local: that depends on the model endpoint you configure.
Hosted Portkey is a separate choice. The pricing page lists a free Developer plan for prototyping, with 10,000 recorded logs per month and three-day log retention; it says excess logs stop being recorded rather than requests stopping. Production is listed at $49/month with 100,000 recorded logs and additional overages. The page also contains a request-limit comparison table, so confirm applicable metering before budgeting. These are service terms, not conditions of the MIT repository license. Portkey pricing.
OpenRouter: useful only if hosted is acceptable
OpenRouter documents an API at openrouter.ai/api/v1 and OpenAI SDK integration. That can suit a team choosing a managed endpoint, but those documents do not establish a self-hosted OpenRouter gateway option. OpenRouter quickstart.
Its pricing page lists a Free hosted plan capped at 50 requests/day, alongside paid plans. Standard charges a 5.5% credit-purchase fee and bills inference at published provider rates. Free hosted access is neither an open-source license nor unlimited free inference. Recheck the model and plan you intend to use before switching. OpenRouter pricing.
A migration checklist—not a drop-in claim
Use this as a staging acceptance plan, not as a report of tests we performed:
- Inventory the integration. Are callers using LiteLLM’s Python
completion()function or its HTTP proxy? Replacing an HTTP endpoint does not automatically replace a Python library API. - Map routing explicitly. Record model aliases, provider credentials, fallback order and retry limits. Keep the original route available for rollback.
- Test the responses your app uses. Include streaming cancellation, tool calls, structured output, usage accounting and provider errors—not just one successful chat request.
- Check control-plane features separately. Verify per-team keys, budgets, log retention, access controls and export requirements against the exact deployment and plan.
- Compare total cost. Separate gateway hosting, managed-service fees and model inference. A free software license answers only one of those questions.
Scope and sources
Checked October 30, 2026 against the primary documents linked above. We did not install these gateways, benchmark speed, measure savings or test production migration. The ordering follows the page’s self-hosting intent, not a measured quality ranking. It is a focused comparison of the existing catalog entries, not an exhaustive list of open-source gateways.
For the broader routing decision, use Best LLM gateway. This page stays focused on leaving LiteLLM without confusing open-source code, local deployment, hosted free access and paid services.
The picks
An MIT-licensed gateway you can run yourself; hosted Developer and Production plans are separate products.
Pros
- Published local gateway quickstart
- Routing, retries and fallbacks documented
Cons
- Operating infrastructure and model usage are separate costs
- Repository labels Gateway 2.0 a pre-release; do not assume enterprise feature parity
Pricing Self-hosted code; separate hosted free Developer plan and paid Production plan
- Rank 2
OpenRouter
A hosted model API, included as a non-self-hosted alternative—not as an open-source gateway.
Pros
- OpenAI SDK integration documented
- Avoids running your own gateway service
Cons
- Does not meet this guide’s self-hosted gateway requirement
- Free hosted access is limited and is not a software license
Pricing Hosted Free plan or paid model usage and credit-purchase fees
Questions
Which option is an open-source LiteLLM alternative?
Portkey’s gateway repository is MIT-licensed and documents local deployment. OpenRouter is included only as a hosted-service alternative.
Is LiteLLM itself open source?
Its root license makes code outside the enterprise directory MIT-licensed; enterprise code has separate terms. A missing GitHub license badge does not override the license file.
Does self-hosting mean free models or offline operation?
No. Running a gateway locally does not run model weights locally. Infrastructure and any external model-provider charges remain separate.
Should I migrate if I only need a smaller Python dependency?
Not necessarily: LiteLLM documents litellm-core as a leaner SDK distribution. Evaluate that before replacing your gateway or rewriting calls.
