StackMap
Subscribe

9router vs litellm

Self-hosted gateway pointing any AI coding CLI (Claude Code, Codex, Cursor, Cline) at 40+ providers, with subscription→cheap→free auto-fallback and tool_result compression for 20-40% token savings. — versus — Open-source AI gateway: call 100+ LLM providers in OpenAI format via a Python SDK or self-hosted proxy — with cost tracking, virtual keys, guardrails, load balancing and logging.

The curated verdict

Both are self-hosted gateways routing to many providers with fallback; 9router aims at coding CLIs, LiteLLM at app/SDK developers.

9routerlitellm
Stars22k54k
Forks3.8k9.9k
LanguageJavaScriptPython
LicenseMITNOASSERTION
Last activity9 days agotoday
Topicsgateway, codinggateway
Curated connections710

9router — the curator's take

The 'never hit a rate limit again' gateway: run it on localhost, point Claude Code / Codex / Cursor / Cline / Copilot at its OpenAI-compatible endpoint, and it round-robins your accounts and cascades Subscription → cheap ($0.2-0.6/1M) → free (Kiro, OpenCode) providers so a job never dies mid-flight, while RTK compresses tool_result payloads (git diff, grep, ls) to shave 20-40% of tokens. Best when you juggle several provider subscriptions/keys and keep exhausting quota. NOT for you if you want one stable premium model (free-tier fallbacks vary in quality/availability), if routing traffic through third-party free providers raises data-privacy concerns, or if you want savings from smarter code retrieval rather than payload compression. Overlaps heavily with lynkr — pick 9router for free/multi-account fallback breadth, lynkr for tool-stripping, semantic caching and local-model routing.

litellm — the curator's take

The default answer to "one API for every LLM." Reach for it when app code or an agent fleet must hit many providers without per-SDK glue, or when a team needs a central proxy with spend caps, virtual keys and logging. The SDK is a thin drop-in; the proxy is the real value (dashboard, budgets, rate limits). NOT an inference engine — it routes to backends like vLLM/Ollama, doesn't run models. Overkill if you only ever call one provider. Guardrails/evals exist but are lighter than dedicated tools.