The useful way to read this project is as infrastructure between your coding tool and your model accounts. Claude Code, Codex, Cursor, Cline, Copilot-style clients, Antigravity, OpenClaw, and other OpenAI-compatible tools can point at `http://localhost:20128/v1`; 9Router then decides how to translate, compress, route, retry, and log the request.
Get the latest on AI, LLMs & developer tools
New MCP servers, model updates, and guides like this one — delivered weekly.
Editorial note
This article is based on the GitHub repo, README, package metadata, source tree, npm metadata, releases/tags, recent issues, recent PRs, and provider configuration files researched on June 3, 2026. The README's free/unlimited language is treated as project positioning, not independently verified quota advice.
1. 9router in One Sentence
9Router is an MIT-licensed local LLM gateway for coding agents that combines OpenAI-compatible APIs, provider translation, multi-account fallback, quota tracking, RTK tool-output compression, a dashboard, and Docker/local deployment.
| Area | Detail | Why it matters |
|---|---|---|
| Repository | decolua/9router | https://github.com/decolua/9router |
| Primary language | JavaScript | Primary GitHub language at research time. |
| License | MIT | Check bundled or binary licenses separately where relevant. |
| Created | January 5, 2026 | Published package checked: 0.4.66 on May 29, 2026; GitHub Releases latest entry checked: v0.4.63 on May 26, 2026. |
2. Why It Matters
The project matters because AI coding workflows are no longer tied to one client or one model provider. Developers often use Claude Code, Codex, Cursor, Cline, Antigravity, and OpenAI-compatible tools in parallel, while model access comes from subscriptions, API keys, free tiers, regional providers, and local-compatible endpoints.
9Router tries to normalize that mess into one endpoint and one dashboard. Instead of reconfiguring every coding tool when one provider hits quota or changes an event shape, you create provider accounts, model aliases, combos, and fallback chains in the router.
The aggressive token-saving angle is also practical. Coding agents burn context on diffs, grep output, logs, file listings, and repeated tool transcripts. RTK compression runs before format translation, so the project can reduce payload size without requiring each upstream client to know about the compression format.
3. Architecture and Mental Model
9Router is a Next.js dashboard plus API gateway with a separately published CLI package. The app rewrites OpenAI-compatible routes into Next API handlers, delegates chat work into the `open-sse` translation/routing core, stores runtime state in local data storage, and exposes a dashboard for provider, quota, log, and combo management.
| Area | Detail | Why it matters |
|---|---|---|
| Client surface | `http://localhost:20128/v1` | OpenAI-compatible endpoint used by Claude Code, Codex, Cursor, Cline, Antigravity, and similar clients. |
| Dashboard | Next.js app | Provider setup, combos, aliases, quota, usage, logs, endpoint settings, cloud sync, and model tests. |
| CLI package | `9router` on npm | Starts the local runtime, launcher, tray-oriented hooks, and packaged app behavior. |
| Request handlers | `src/app/api/v1/*` | Routes for chat completions, responses, messages, models, embeddings, images, speech, search, and fetch. |
| Translation core | `open-sse/*` | Format translation, provider execution, streaming helpers, token refresh, and fallback helpers. |
| Provider registry | `src/shared/constants/providers.js` | OAuth providers, API-key providers, free/free-tier providers, media kinds, aliases, and risk metadata. |
| Storage | Local data directory and SQLite adapters | Current source uses database adapters even though older architecture docs still mention JSON storage. |
4. Smallest End-to-End Setup
The commands below are copied from the repository documentation and checked against the current research snapshot. Treat them as a starting point, then read the linked README before installing into a production environment.
# Global install path
npm install -g 9router
9router
# Source development path
git clone https://github.com/decolua/9router.git
cd 9router
cp .env.example .env
npm install
PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev
# Docker path
docker run -d \
--name 9router \
-p 20128:20128 \
-v "$HOME/.9router:/app/data" \
-e DATA_DIR=/app/data \
decolua/9router:latestA small first task should prove the integration before you attach it to critical data or large workspaces.
# Configure your coding client with the local router
Endpoint: http://localhost:20128/v1
API key: copy from the 9Router dashboard
Model: choose a 9Router model alias or combo, for example kr/claude-sonnet-4.5
# Local URLs
Dashboard: http://localhost:20128/dashboard
OpenAI-compatible API: http://localhost:20128/v15. Technical Deep Dive
5.1 It is a gateway, not a model provider
9Router does not magically create a new foundation model. It sits between coding clients and upstream providers. The router translates request shapes, refreshes tokens where supported, manages API keys, routes to accounts, and decides what to do when the preferred provider fails or hits a configured limit.
That distinction matters for risk. If an upstream provider changes a stream event, rejects a schema, removes a free tier, or limits account usage, 9Router has to adapt quickly. Recent issues show exactly that kind of provider churn.
Claude Code / Codex / Cursor / Cline
-> http://localhost:20128/v1
-> 9Router endpoint settings
-> combo / alias / provider account
-> upstream model API
-> translated stream back to client5.2 Combos are the routing primitive
The README frames fallback as a three-tier chain: subscription first, cheap providers second, free providers last. In practice, that becomes a combo configuration in the dashboard. A combo is where you encode model preferences, fallback order, and which accounts are allowed to serve a request.
This is useful for long coding days because manual provider switching is friction. It is also dangerous if you do not understand each provider's terms, quota, latency, and model quality. A fallback chain can keep work moving, but it can also quietly change model behavior mid-task.
5.3 RTK compresses agent tool output before translation
The most concrete technical feature is RTK Token Saver. Tool results from coding agents are often huge: diffs, search results, trees, logs, numbered reads, and shell output. 9Router detects those structures and applies specialized compression filters before the request is translated to Claude, OpenAI, Gemini, Vertex, Kiro, or another target shape.
The README says the filter is safe by design: if compression fails or makes output larger, the original text is kept. That is the right default because lossy or broken compression of a diff can make an agent edit the wrong code.
tool_result: git diff / grep / tree / logs
-> RTK filter selection
-> compressed or original payload
-> format translation
-> upstream provider request5.4 Format translation is the hard part
The project supports OpenAI chat completions, OpenAI Responses, Claude-style messages, Gemini, Cursor, Kiro, Vertex, Antigravity, Ollama-style paths, embeddings, image generation, speech, search, and web fetch routes. That is a large compatibility surface.
Recent bugs show the cost: assistant prefill behavior, Vertex limitations, provider-specific token parameters, GitHub Gemini stream assembly, and media model tests can all break differently. 9Router's value comes from absorbing those differences, but that means the repo has to track upstream changes constantly.
5.5 Local storage and logs are part of the threat model
A router like this stores or touches provider credentials, OAuth sessions, request logs, usage records, model aliases, and possibly raw prompts. The current source includes local database adapters; the README describes local data under a data directory. Treat the machine running 9Router as credential-bearing infrastructure.
That does not make the project unusable. It means you should configure logging intentionally, use least-privilege API keys where possible, avoid routing sensitive client data through accounts with unclear terms, and keep the dashboard port private unless you have deliberately deployed it behind authentication.
6. Real-World Wrong vs Right Patterns
| Wrong | Right | Reason |
|---|---|---|
| Assume 9Router provides unlimited model access by itself. | Treat it as a router over real upstream accounts, subscriptions, and free tiers. | Provider terms, quotas, and model availability still apply. |
| Point every tool at one fallback combo without testing. | Create separate combos for coding, cheap experimentation, media, and sensitive work. | Different clients and tasks need different latency, quality, and risk profiles. |
| Enable verbose logs forever. | Use request logging for debugging, then reduce retention and protect the data directory. | Logs can contain prompts, code, keys, and business context. |
| Rely on a GitHub release page alone for freshness. | Check npm, tags, and the default branch when debugging version-specific behavior. | 9Router's npm/tag state has moved ahead of the latest GitHub release entry. |
7. Common Mistakes and Current Issues
The issue tracker matters because these are young, fast-moving repos. The article uses issues as risk signals, not as proof that a project is unusable.
| Area | Detail | Why it matters |
|---|---|---|
| Provider terms | OAuth/subscription-backed providers may carry account restriction risk. | The source includes risk notices; do not route business-critical traffic blindly. |
| Version divergence | npm/tag 0.4.66 was newer than the latest GitHub release entry at research time. | Be precise when reporting versions. |
| Streaming stalls | Issues report stalls, empty streams, placeholders, and prompt echo behavior. | Long reasoning and provider adapters need smoke tests. |
| Media endpoints | Recent PRs route image and STT probes to real media endpoints. | Do not assume chat-completion tests validate every modality. |
| Runtime dependencies | An issue reports SQLite dependency pruning in packaged runtime paths. | Packaged installs deserve local launch verification. |
| Stale docs | Older architecture docs mention JSON storage while current source includes SQLite adapters. | Prefer source and README over older architecture notes when they conflict. |
8. Performance, Scaling, and Cost Notes
9Router's performance is dominated by two variables: upstream provider behavior and router-side translation/compression overhead. The router can reduce prompt size with RTK, but it cannot make a slow or overloaded upstream provider fast.
Fallback improves availability only if the fallback models can actually handle the task. A cheap/free model may keep the stream alive but produce lower-quality code edits, weaker tool calls, or incompatible function-call structures.
The best cost pattern is explicit segmentation: premium combo for risky edits and reviews, cheaper combo for exploration, local/free combo for broad search and summaries, and media-specific routes for image/speech/video requests.
9. Who It Is For
| Use it if | Skip it if |
|---|---|
| You use multiple AI coding clients and want one local endpoint. | You only use one provider and value simplicity over routing flexibility. |
| You actively manage quotas, subscriptions, free tiers, and cheap APIs. | Your organization forbids proxying OAuth/subscription-backed sessions. |
| Your coding-agent prompts include large diffs, logs, and search output. | You need audited enterprise gateway controls before routing source code. |
| You are comfortable debugging fast-moving provider adapters. | You need a stable appliance with slow, conservative releases. |
10. Community Signal
The GitHub issue and PR surface is extremely active and highly technical. Most signal comes from users testing provider combinations across Claude Code, Antigravity, OpenCode, MiniMax, Xiaomi, GitHub Gemini, Vertex, and custom compatible endpoints.
The strongest positive signal is practical: people are using it with real coding clients and quickly reporting edge cases. The strongest caution is the same fact in reverse: provider and client protocols are changing fast enough that a router has to be patched continuously.
The repo's README uses strong free/unlimited language, but the issue tracker tells a more engineering-grounded story: model IDs change, streaming formats differ, OAuth paths break, and dashboard tests must be modality-aware.
11. The Verdict: Is It Worth Using?
Our Take
Use 9Router if you want a local, hands-on gateway for routing AI coding tools across multiple providers and you are willing to manage provider risk carefully. Skip it for regulated production code paths until you have reviewed credential storage, logging, provider terms, and fallback behavior under your own policies.
12. The Bigger Picture
9Router is part of a broader move from single-model clients to local AI infrastructure. Developers increasingly want model routing, budget control, quota visibility, proxy compatibility, and provider abstraction without changing every editor or terminal agent.
The unsolved problem is trust. Routing is easy to demo; safe routing is harder. The next generation of tools will need explicit policy controls, credential separation, audit logs, redaction, and reproducible model-routing decisions.
13. Frequently Asked Questions
Q: Is 9Router an AI model provider?
No. It is a local router and dashboard that sends requests to upstream providers, accounts, free tiers, subscriptions, or compatible endpoints you configure.
Q: What endpoint should I configure in my coding tool?
Use `http://localhost:20128/v1` and the API key shown by the 9Router dashboard, then choose a model alias or combo defined inside 9Router.
Q: What is RTK Token Saver?
RTK compresses common coding-agent tool outputs such as diffs, grep results, file trees, logs, and numbered reads before the payload is translated and sent upstream.
Q: Why do versions differ between npm and GitHub Releases?
At research time, npm/tags were ahead of the latest GitHub release entry. For debugging, check npm metadata, tags, releases, and the default branch together.
Q: Is it safe to use OAuth/subscription accounts through a router?
That depends on provider terms and your risk tolerance. The project includes risk notices for some providers, so treat this as a policy decision, not a purely technical setup step.
Q: Where does local data live?
The README describes local data under the configured data directory, and current source includes SQLite adapters. Protect that directory because it can contain credentials, usage records, and logs.
Q: What breaks most often?
Recent issues point to upstream provider schema changes, streaming assembly, model IDs, token parameters, media endpoint tests, and packaged runtime dependencies.
14. Glossary
| Area | Detail | Why it matters |
|---|---|---|
| Gateway | A local service that receives model requests and forwards them elsewhere. | 9Router's core role. |
| Combo | A configured routing/fallback chain. | Used to choose subscription, cheap, or free routes. |
| RTK | Tool-output compression layer. | Reduces large agent tool results before provider translation. |
| OpenAI-compatible | API shape many tools can point to. | 9Router exposes compatible `/v1` endpoints. |
| OAuth provider | Provider authenticated through a user session. | Can carry extra account-policy risk. |
| Media endpoint | Image, speech, video, or STT path. | Should not be tested only through chat completions. |
| Fallback | Routing to the next provider/account when the first fails. | Useful but can change model behavior. |
15. All Sources and Links
Primary Sources
Issues and PRs
Release Sources
Internal Links
16. Source Attribution Table
| Area | Detail | Why it matters |
|---|---|---|
| README | Positioning, quick start, endpoint, provider tiers, RTK, Docker, dashboard surface. | Primary source. |
| Package metadata | CLI package, version nuance, Node requirement, executable entry. | Primary source. |
| Source tree | Next routes, translation core, provider registry, database adapters. | Architecture source. |
| Issues/PRs | Provider churn, streaming stalls, media probes, runtime dependency caveats. | Freshness signal. |
| npm and releases | Version divergence between published package, tags, and release entries. | Freshness source. |
Get the Ultimate Antigravity Cheat Sheet
Join 5,000+ developers and get our exclusive PDF guide to mastering Gemini 3 shortcuts and agent workflows.
Related Guides
Humanizer Skill Guide
blader/humanizer: 29 AI-writing patterns, voice calibration, and a two-pass audit, all in one Claude Code skill.
Guides & FeaturesMastering Agent Skills
The open standard for portable AI agent expertise.
Guides & FeaturesAntigravity Workflows Guide
Create automation recipes with Turbo Mode and AgentKit 2.0.
Guides & FeaturesHow to Change Antigravity Themes
Customize themes, dark mode, icons, and color schemes.
Guides & FeaturesHow to Change Language
Switch Antigravity to Spanish, German, Japanese, and more.
Guides & FeaturesAntigravity Security Guide
Known vulnerabilities, safe settings, and hardening steps.
