OpenCode Model Router: per-agent model fallback chains with a local web UI
Long sessions tend to end the same way: the primary model starts returning rate-limit errors, or the provider goes quiet mid-task. The work is half done, the context is fully loaded, and the fix is either to wait or to switch models by hand and hope continuity survives. If you run more than one provider — OpenRouter, DeepSeek, and others — you already have somewhere to fail over to. What is…
Long sessions often end due to rate-limit errors or provider downtime, forcing a model switch to maintain continuity. OpenCode Model Router is a plugin that addresses this issue by adding model fallback chains with a local web UI. Each OpenCode agent gets its own chain consisting of a primary, secondary, and tertiary model. When the primary model fails, the plugin automatically fails over to the secondary and then tertiary model.
The MIT-licensed project is currently at version 0.3.1. Chains are per-agent, allowing different workloads to have unique ordering without compromising on a global fallback list. Each agent maintains its own three slots, with the option to include an optional variant for distinct model builds. The web UI, accessible at http://127.0.0.1:37337, allows management of chains with a dark-themed interface and provider-grouped, searchable model drawer.
Saving and applying changes saves the configuration and creates a backup. The plugin is dependent on OpenCode installation, has no dependencies itself, and can be installed via a provided script.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.