Per-turn model routing and context management for OpenCode V2 and Kilo — a workspace of three packages sharing one pricing brain, one security gate, and one staged release pipeline.
| Package | Role |
|---|---|
@231self/opencode-router |
Routes each turn to the best model from your pool (small local judge + deterministic floor), with pins, failover, subagent policy, a TUI /router surface, and a CLI. |
@231self/opencode-compaction |
Context management: the context optimiser, a priced compact/keep/delegate advisory (/ctx), and /ctx here. |
@231self/opencode-shared |
Shared runtime: cache-aware pricing/measurement, config/state host adapters, Kilo shim, model-ref semantics. Zero dependencies. |
opencode plugin add @231self/opencode-router
opencode plugin add @231self/opencode-compaction/router web serves a dashboard on 127.0.0.1 — plan burn first, per-model
unit prices, consumption bars by day or hour, and the routing decisions
behind them. Every table sorts, filters, and searches; a decision line
expands to its reason. The command opens your browser; /router web stop
closes it.
Loopback only, and every response is an allow-list projection: counts, sizes, prices, and labels — never prompt text, tool output, or credentials.
- User docs:
packages/router/README.md - Architecture:
docs/architecture.md - Benchmarks:
docs/benchmarks/(routing reports regenerated for 0.3.0; live compaction tolerance run still pending) - Research:
docs/paper/draft.md— cache-aware compaction economics - Releasing:
docs/releasing.md(CI stages over npm trusted publishing; a maintainer approves with 2FA) - Designs:
docs/specs/,docs/superpowers/
Licensed Apache-2.0.
