Skip to content

About

Per-turn model routing for OpenCode V2 and Kilo, decided by a small local judge, with cache-aware pinning and a context optimiser.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

opencode-router

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

Local dashboard

/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.

The local dashboard: plan burn, spend by model with unit prices, and consumption bars

Licensed Apache-2.0.

About

Per-turn model routing for OpenCode V2 and Kilo, decided by a small local judge, with cache-aware pinning and a context optimiser.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages