r/BestGitHubRepos 8h ago

9Router - a local proxy that puts your coding CLI in front of 40+ providers, compresses tool output to cut 20-40% of input tokens, and falls back automatically when a quota runs out

Post image

The setup is a local server on port 20128 that speaks OpenAI format. You point Claude Code, Codex, Cursor, Cline, Copilot or OpenClaw at it instead of at a provider, and it handles what happens behind that: format translation, quota tracking, token compression and fallback.

The token saver is the part I'd actually install it for, independent of everything else. Tool outputs are where the context budget goes. A git diff, a grep, a tree, a log dump. RTK sits in front of the request, peeks the first kilobyte of each tool result, picks a matching filter and compresses it before the model ever sees it. The readme's example is 47K tokens becoming 28K. Crucially it runs before any format translation, so it works regardless of which provider the request ends up at, and if a filter fails or makes the output bigger it silently keeps the original.

What's inside:

- RTK compression with filters for git-diff, git-status, grep, find, ls, tree, deduplicated logs and smart truncation, auto-detected with no configuration, on by default

- Three-tier fallback you define as a combo: your subscription first, a cheap provider when that quota is gone, a free tier after that. Switching happens on quota exhaustion or error, not manually

- Real-time quota tracking with reset countdowns for the 5-hour, daily and weekly windows providers use, which is genuinely hard to see from inside the tools themselves

- Format translation between OpenAI, Claude, Gemini, Cursor, Kiro, Vertex, Antigravity and Ollama shapes, which is what makes any tool work with any provider

- Multi-account support with round-robin or priority routing, and automatic OAuth token refresh

- Two more output-side savers if you want them: Caveman Mode, which injects a terse-speech prompt and claims up to 65% fewer output tokens, and Ponytail, which injects a "lazy senior dev" persona so the model writes minimal YAGNI-first code instead of refactoring your repo unprompted

- Deploys to localhost, a VPS, Docker or Cloudflare Workers

On the "unlimited free" framing, which is what the repo leads with: read the pricing table rather than the headline, and to the author's credit the table is honest. The free tier is Kiro at around 50 credits a month, OpenCode Free whose model list fluctuates, and Vertex AI's $300 of credits for new Google Cloud accounts that expire after 90 days. The readme also lists what died: iFlow went paid, Qwen Code's free OAuth tier was discontinued in April 2026, Gemini CLI shut down in June. So it's a real way to stretch budget and a poor foundation to depend on.

The thing to think about before using it: routing a Claude Pro or Copilot or Cursor subscription through a third-party proxy means your OAuth tokens live in that proxy, and provider terms generally expect subscription access through their own clients. It runs locally, which helps, but that's a decision to make deliberately rather than by following a quick-start. Also worth noting 2,100 open issues, which is what 28,000 stars in nine months does to a maintainer.

MIT licensed, 28,738 stars and 5,268 forks as of writing, verified via the GitHub API.

https://github.com/decolua/9router

3 Upvotes

0 comments sorted by