omo-router
v0.1.6
Published
Provider switching and automatic model discovery for the native OMO/Senpi harness.
Readme
omo-router
Provider switching and automatic model discovery for the native OMO/Senpi harness.
omo-router writes the supported OMO custom-provider files under
~/.omo/agent. It does not patch OMO internals, copy API keys into the
repository, or require CC Switch.
Requirements
- Node.js 22 or newer
- OMO native (
omo) - An API key for the provider you want to use
Install and first setup
Install the published CLI globally:
npm install --global omo-routerOr run it without a global install:
npx --yes [email protected] --helpIf you are inside this source checkout, run npx from another directory
because the checkout itself is named omo-router. For example:
cd ~
npx --yes [email protected] listThe CLI creates timestamped backups before changing:
~/.omo/agent/models.json~/.omo/agent/settings.json~/.omo/omo.jsonc
Windows and Linux command rules
Run each command on its own line. Do not paste two commands together without a
newline or command separator. If you accidentally concatenate commands,
deepseek-flashomo-router is treated as one invalid preset name.
Windows PowerShell
$env:DEEPINFRA_API_KEY="your-deepinfra-key"
omo-router key deepinfra
omo-router use deepinfra deepseek-flashWindows Command Prompt
set DEEPINFRA_API_KEY=your-deepinfra-key
omo-router key deepinfra
omo-router use deepinfra deepseek-flashLinux Bash and WSL
export DEEPINFRA_API_KEY="your-deepinfra-key"
omo-router key deepinfra
omo-router use deepinfra deepseek-flashPowerShell uses $env:NAME; Bash uses export NAME. WSL follows the Linux
Bash instructions and has its own Node/npm installation.
Windows quick start
Run these PowerShell commands one at a time:
node --version
npm install --global [email protected]
omo-router --help
$env:DEEPINFRA_API_KEY="your-deepinfra-key"
omo-router key deepinfra
omo-router use deepinfra deepseek-flash
omo-router current
omoIf OMO is already running, exit and start it again before opening /model.
You can use npx instead of a global install:
npx --yes [email protected] list
npx --yes [email protected] key deepinfra
npx --yes [email protected] use deepinfra deepseek-flashLinux quick start
Run these Bash commands one at a time:
node --version
npm install --global [email protected]
omo-router --help
export DEEPINFRA_API_KEY="your-deepinfra-key"
omo-router key deepinfra
omo-router use deepinfra deepseek-flash
omo-router current
omoFor long-term use, storing the key with omo-router key deepinfra and then
clearing the shell variable is safer than putting a real key in shell profiles.
Configure a provider
Set the API key in the current shell and store it in the OMO agent directory. The file is written with restricted permissions and the value is never printed.
DeepInfra
export DEEPINFRA_API_KEY="your-deepinfra-key"
omo-router key deepinfra
omo-router use deepinfra deepseek-flashDeepInfra presets:
deepseek-flashdeepseek-proqwen-coder
DeepInfra uses its Anthropic-compatible endpoint:
https://api.deepinfra.com/anthropic.
OpenRouter
export OPENROUTER_API_KEY="sk-or-v1-..."
omo-router key openrouter
omo-router use openrouter deepseek-freeOpenRouter presets:
deepseek-freeqwen-coder
Together AI
export TOGETHER_API_KEY="your-together-key"
omo-router key together
omo-router use together minimaxGroq
export GROQ_API_KEY="your-groq-key"
omo-router key groq
omo-router use groq llamaOpenGateway
export OPENGATEWAY_API_KEY="your-opengateway-key"
omo-router key opengateway
omo-router use opengateway deepseek-fastOpenGateway uses https://apis.opengateway.ai/v1.
Automatic model discovery
When key <provider> succeeds, omo-router requests that provider's
official /models catalog and merges the available models into OMO's
models.json. Existing curated presets are preserved.
Refresh a provider later:
omo-router sync openrouter
omo-router sync deepinfraThe catalog request uses the key only in an Authorization: Bearer header.
The key is not written to models.json, printed, or committed.
Select models inside OMO
Register the provider once, then start OMO:
omo-router key deepinfra
omo-router use deepinfra deepseek-flash
omoIf OMO is already running, exit and start it again after key, sync, or
use. OMO reads the updated provider and model files at startup; restarting
ensures the /model picker shows the new catalog and the new default.
Inside OMO, open the model picker:
/modelDiscovered and curated models are available there. You can also inspect the active default from the shell:
omo-router list
omo-router currentTo set a model that is not a curated preset:
omo-router use openrouter --model deepseek/deepseek-r1CLI reference
omo-router list
omo-router current
omo-router key <provider>
omo-router sync <provider>
omo-router use <provider> [preset]
omo-router use <provider> --model <provider-model-id>use changes the OMO default provider/model and direct model aliases. A
per-command omo --model ... argument still takes precedence.
Security and backups
- API keys are stored outside the repository under
~/.omo/agent. - Key files use mode
0600where the platform supports it. - Request-time resolvers read the key only when OMO sends a request.
- Every mutation creates a timestamped
.bak-provider-*backup. - Never put a real key in shell history, README files, tests, or git.
Development
npm test
node --check provider-switch.mjs
node --check model-catalog.mjsThe test suite covers provider switching, catalog normalization, automatic registration, backup behavior, and key non-disclosure.
Troubleshooting
Unknown preset "deepseek-flashomo-router"
Two commands were pasted together. Run them separately:
omo-router use deepinfra deepseek-flash
omo-router currentomo-router is not recognized
Install the global CLI and check its location:
npm install --global [email protected]
where.exe omo-routerOn Linux:
npm install --global [email protected]
which omo-routerA model is missing from /model
Refresh the provider catalog and restart OMO:
omo-router sync deepinfraDEEPINFRA_API_KEY not found
Set the variable in the same shell that runs the command:
PowerShell:
$env:DEEPINFRA_API_KEY="your-deepinfra-key"
omo-router key deepinfraLinux or WSL Bash:
export DEEPINFRA_API_KEY="your-deepinfra-key"
omo-router key deepinfraReplace the placeholder with the real key. Do not type the placeholder literally.
Model discovery failed
The provider catalog could not be reached, the key may be expired, or a firewall may be blocking the request. Check the key and network, then retry:
omo-router sync deepinfraThe CLI exits nonzero and reports a concise actionable error instead of printing a JavaScript stack trace for expected provider or catalog failures.
License
Add the project license before distributing this package.
