This repository is an npm workspace monorepo with lockstep versioning.
packages/core→@drwestman/model-router-corepackages/opencode→@drwestman/model-router-opencodepackages/claude→@drwestman/model-router-claudepackages/codex→@drwestman/model-router-codex
All packages are currently private.
corecontains host-agnostic config validation, policy resolution, prompt rendering, model normalization, and generic state helpers.opencodeis the active implemented adapter package with adapter-local config and host-isolated state defaults.claudeis an implemented private Claude plugin package with hook integration, plugin metadata, skills, and local install/package workflows.codexis still a scaffold package with separatetiers.jsonand package metadata, but no claimed host integration yet.- The root package is only the private workspace container. Runtime code lives under
packages/.
- OpenCode adapter config:
packages/opencode/tiers.json - Claude adapter config:
packages/claude/tiers.json - Codex adapter config:
packages/codex/tiers.json
Default state locations are isolated per host:
- OpenCode:
~/.config/opencode/opencode-model-router.state.json - Claude:
~/.config/claude/model-router.state.json - Codex:
~/.config/codex/codex-model-router.state.json
npm installRegister the OpenCode plugin in the documented global plugin directory:
npm run install-opencode:localThis writes ~/.config/opencode/plugins/model-router.js as a CommonJS loader that dynamically imports the built adapter from this workspace. Do not also list "model-router" in an OpenCode plugin array; that uses npm-plugin loading instead of the local plugin directory.
Install the Claude plugin from this workspace into your local Claude config:
npm run install:claude-plugin:localBuild the Claude plugin as a distributable tarball artifact:
npm run package:claude-pluginPractical repo checks:
npm run build
npm run typecheck
npm run test:package