luqman-v1/9router-go

High-performance Go proxy gateway for 9Router LLM routing — 32K RPS, 42MB RAM, CGO-free

What it solves

AI coding tools like Claude Code, Cursor, and Codex often burn through subscription quotas, hit rate limits mid-task, and waste tokens on large tool outputs (like git diffs or file listings). Manually switching between providers is painful. 9router-go fixes this by sitting between your coding tool and many AI providers, automatically picking the cheapest working option and compressing token usage.

How it works

9router-go is a single Go program that runs a local server (default on port 20130). You point your coding tool at this server (like http://localhost:20130/v1) with an API key from the dashboard. The router then talks to 40+ providers and 100+ models on your behalf. It tries providers in tiers: your subscription (Claude Code, Codex, Copilot) first, then cheap providers (GLM, MiniMax), then free ones (Kiro, OpenCode Free). If one tier runs out of quota or budget, it falls back to the next. It also includes an RTK token saver that automatically compresses tool results to cut token usage by 20–40%. The dashboard, embedded in the binary, lets you manage providers, API keys, routing strategies (fallback, round-robin, sticky, etc.), and see usage stats.

Who it’s for

Developers who use AI coding assistants and want to avoid paying for unused subscription quota, hitting rate limits, or manually juggling multiple providers. It’s also for anyone who wants to try free AI models without signups. The single-binary design means you don’t need Node.js or a separate service.

Highlights

  • Single binary with embedded dashboard – no Node.js runtime needed.
  • Connects Claude Code, Cursor, Codex, Gemini, Cline, and many other tools.
  • RTK token saver compresses tool results to save 20–40% tokens.
  • Auto-fallback across subscription, cheap, and free providers.
  • Multiple routing strategies: fallback, round-robin, sticky, capacity, fusion.
  • Works with 40+ providers and 100+ models.
  • Can share a database with the original 9Router (Next.js version) – no migration needed.
  • One-line install for macOS, Linux, Windows, and Docker.
  • Built-in background mode, autostart service, and self-update.

Related

  • Project
  • Project
  • Project
  • Project