macrostack
Browse

The AI stack

Categories

Local & Sovereign AINotes & KnowledgeObservability & MonitoringPassword ManagersWeb AnalyticsTeam ChatSmart HomeNetworking & RoutersVideo ConferencingCloud Storage & SyncPhotos & MediaAPI DevelopmentImage EditingWorkflow Automation & iPaaSDeveloper Tools & ContainersOffice & Productivity SuitesNo-Code DatabasesCode Hosting & Git ForgesProject ManagementEmail Marketing & NewslettersScheduling & BookingError Tracking & Exception MonitoringLog Management & SIEMVPN & PrivacyEmail & Secure MailVector Databases & AI SearchLLM & Agent FrameworksDomains & Web HostingData Removal & PrivacyAuthentication & IdentityHelp Desk & Customer SupportCloud & VPSKubernetes & Container PlatformsEmbedding ModelsPDF & DocumentsAI Coding AssistantsAI Voice & SpeechLLM Observability & EvaluationLLM Gateways & RoutingCloud GPU & AI ComputeCI/CD & build automationData & pipeline orchestrationModel serving & inferenceAI agent frameworksBackend as a serviceSecrets managementFeature flags & experimentationProduct analyticsSearch infrastructureUptime & status monitoringAffiliate & partner platformsVisitor identification & personalisationWikis & internal docsIdentity & access managementData warehouses & analytics enginesCustomer data platformsCRMObject storageBI & dashboardsE-signatureWhiteboards & diagrammingIn-memory data stores & cachingPlatform as a serviceTransactional & bulk emailHeadless CMSDesign & prototypingE-commerce platformsInternal tools & admin panelsManaged databasesForms & surveysFine-Tuning & Model TrainingRAG & Retrieval PlatformsLLM Evaluation & TestingAI Guardrails & Content SafetySpeech Recognition & TranscriptionExperiment Tracking & ML OpsDocument AI & OCRCompliance automation & security posture

About

How we rank & score
Head-to-head · LLM Gateways & Routing

LiteLLM vs OpenRouter

Both are alternatives to Portkey. Here's how they stack up — verified facts, no spin.

Also searched as OpenRouter vs LiteLLM — same comparison, one verdict.

The short answer

LiteLLM is open source (MIT (core); enterprise/ directory under a separate commercial licence) and OpenRouter is not (Proprietary (hosted service)) — so the real question is whether you want to own the llm gateways & routing stack or rent it.

90

LiteLLM

TOP PICK

One OpenAI-compatible API in front of 100+ providers, running on your own box.

OPEN SOURCEMIT (core); enterprise/ directory under a separate commercial licenceSELF-HOSTLOCAL-FIRST

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.

32

OpenRouter

One key, hundreds of models, nothing to run — the honest hosted pick.

SOURCE-AVAILABLEProprietary (hosted service)

OpenRouter is a hosted router: a single API key and one OpenAI-compatible endpoint in front of hundreds of models across providers, with automatic fallback and a unified bill. There is nothing to deploy and no subscription — you pay per token with a small margin on top of provider rates. If what you actually wanted was to stop juggling five provider accounts, this solves it in an afternoon and is frequently the right answer even for teams who could self-host.

Side by side

10 points of comparison, every one read from a verified field. Green marks the side that wins a row outright. A dash means we do not hold that fact — never that it is zero.

 LiteLLMOpenRouter
Sovereignty ScoreOur transparent 0–100 composite for data ownership and exit cost.9032
Open sourceYesNo
Self-hostableYesNo
Local-first dataYesNo
LicenseMIT (core); enterprise/ directory under a separate commercial licenceProprietary (hosted service)
PricingFree 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.No subscription — pay-as-you-go per token at provider rates plus a small margin. Some free models are available.
RAM to run it wellThe figure that actually matters, not the vendor's minimum.2 GB
Realistic running costWhat the box costs each month if you run it yourself.$12–24/mo, against LLM gateway products charging per request
Setup timeHonest first-install estimate, not the marketing quickstart.1 hour
Ongoing maintenanceThe part nobody budgets for.Low, but it is now in the path of every model call you make.
The verdict

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

OpenRouter

Strengths

  • +Zero operations: one key, one endpoint, hundreds of models
  • +No monthly fee — you pay only for tokens used
  • +Unified billing across providers, with automatic fallback
  • +The fastest way to test many models without opening accounts everywhere

Trade-offs

  • Hosted and proprietary: every prompt transits OpenRouter
  • A margin on token spend rather than provider cost
  • No self-hosting path at all
  • Score of 32 reflects a closed hosted service — a transparency lens, not a judgement on quality

Which one fits you

The trade-offs above, turned into a decision. Find the line that describes your team.

Choose LiteLLM

if you want the source and the option to fork it, and you would rather run it on your own hardware, and your data should stay on machines you control.

Choose OpenRouter

if zero operations: one key, one endpoint, hundreds of models.

Neither, yet

if both carry a real cost you should weigh first — you run it: deployment, upgrades, monitoring and uptime are yours, and hosted and proprietary: every prompt transits OpenRouter. If either of those is a dealbreaker for your team, the shortlist is wrong rather than the choice.

What it takes to run these yourself

Real requirements and honest running costs, not the vendor quickstart.

LiteLLM vs OpenRouter — common questions

Is LiteLLM a better fit than OpenRouter for llm gateways & routing?

It depends on what you are optimising for, and the honest split is this: LiteLLM scores 90 to OpenRouter's 32 on data ownership and exit cost, so it is the safer choice if you care about being able to leave. OpenRouter earns its place on a different axis — zero operations: one key, one endpoint, hundreds of models. Neither is a wrong answer for every team; the table above is the actual comparison.

What happens if we want to switch later?

LiteLLM keeps its data local or in open formats, so leaving is an export rather than a negotiation. OpenRouter keeps your data on its own infrastructure, which is the part to plan for: confirm the export path before you commit, not when you are already trying to leave.

Can I self-host LiteLLM?

LiteLLM can be self-hosted; OpenRouter cannot, so it stays on the vendor's infrastructure whatever you do.

Are LiteLLM and OpenRouter both alternatives to Portkey?

Yes — both appear in our Portkey comparison, which is why they are worth putting side by side. People usually arrive here already having decided to move off Portkey and now choosing between the two replacements, which is a narrower and much easier question.

See all 4 Portkey alternatives →

Related alternative guides

Facts verified 2026-07-30. Licenses and pricing change — spotted something out of date? That's a correction we want.

The Macrostack brief

New swaps, worth your inbox.

A short, occasional email when we add a high-intent alternative or ship a new head-to-head. No spam, no selling your address — unsubscribe in one click.