@kevin0181/ccrouter
v0.2.6
Published
9Router-based local AI router with selectable active combo models
Readme
CCRouter (Personal Fork)
A personal local AI router based on 9Router.
This fork is tuned for my own Codex/AI-coding workflow:
- Keep clients pointed at one local OpenAI-compatible endpoint:
http://localhost:20128/v1 - Keep the client model name stable, such as
codex-default - Switch the real active upstream model from the dashboard
- Try the selected active model first, then fall back through the combo order when it fails or runs out of quota
License / Fork Note
- This project keeps the original
MITlicense. - This is a personal fork/customization of 9Router.
- The README and behavior are simplified for my local/private workflow.
- Keeping the MIT license is fine; the README can be changed to match this fork as long as the license notice itself is preserved.
What This Project Does
CCRouter runs locally and acts as a routing layer between AI coding clients and multiple upstream providers.
Codex / CLI tool
|
| OpenAI-compatible API
v
http://localhost:20128/v1
|
v
CCRouter
- provider/account selection
- combo routing
- active model first
- fallback handling
- request/response format translation
|
v
Upstream providersRun From Source
CLI command:
ccrouterStop a running instance:
ccrouter stopStop a specific port:
ccrouter stop --port 20128Development mode:
cp .env.example .env
npm install
PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run devProduction mode:
npm run build
PORT=20128 HOSTNAME=0.0.0.0 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run startDefault URLs:
- Dashboard:
http://localhost:20128/dashboard - OpenAI-compatible endpoint:
http://localhost:20128/v1
Codex Desktop Setup (Manual)
The old ccrouter setup codex helper command has been removed.
Configure Codex manually instead.
Example ~/.codex/config.toml:
model = "codex-default"
model_provider = "ccrouter"
[model_providers.ccrouter]
name = "CCrouter"
base_url = "http://localhost:20128/v1"
wire_api = "responses"If the client requires an API key, use a dummy key:
setx OPENAI_API_KEY dummyRestart Codex Desktop after changing the config.
Combo Workflow
Use Dashboard -> Combos to create a stable model alias such as codex-default.
Example:
codex-default
1. gh/claude-opus-4.6 active
2. gh/gpt-5.3-codex fallback
3. cx/gpt-5.5 fallbackRules:
- The combo name is what the client uses.
- The selected
activeModelis tried first. - If the active model fails, CCRouter tries the remaining models in order.
- Clicking
Use firstchanges the active model without editing the client config.
Local Data
By default, CCRouter stores local data under the app data directory.
On Windows:
%APPDATA%\ccrouterThis can be overridden with:
DATA_DIR=/path/to/dataNotes
- This fork is maintained mainly for personal use.
- Upstream 9Router changes may be merged manually when needed.
- The documentation intentionally focuses on my local setup instead of public onboarding.
