r/OpenCodeConfigs • • Oct 05 '26

I built a small OpenCode plugin because I got tired of editing model configs by hand

Post image

I built a small OpenCode plugin because I got tired of editing model configs by hand

I’ve been using OpenCode with multiple models/providers, and I wanted a simple way to give an agent a fallback chain instead of having a single model configured for it.

So I ended up making a small plugin for my own setup:

OpenCode Model Router

The basic idea is pretty simple:

Primary → Secondary → Tertiary

You can assign up to three models to each OpenCode agent and let the next model in the chain take over when the previous one fails.

I also wanted to avoid constantly editing JSON files manually, so the plugin has a local web UI where I can:

  • select an agent

  • choose its primary / secondary / tertiary models

  • see the models available in my OpenCode setup

  • save the chains

  • apply them to the actual OpenCode configuration

It also supports provider-qualified model references, so the same model served through different providers can be treated as separate chain steps.

There is also support for oh-my-opencode-slim, where the chains are written as native agents.<agent>.model arrays.

A couple of other things I found useful in my own setup:

  • changes are backed up before being applied

  • the UI runs locally

  • there is a /model-router command for configuring chains without opening the browser

  • the project has zero external dependencies

I originally made this simply because I needed it myself. I figured there might be other OpenCode users with a similar setup, so I decided to put it out there rather than keeping it as a local script.

GitHub:
Search for the "OpenCode-Model-Router" extension on GitHub; I couldn't include the link because I am a new user.

I'm particularly interested in hearing from people using OpenCode with multiple providers/models:

How are you handling model fallback today?

Are you manually changing configs, using another plugin, or just sticking with a single model per agent?

If you try this, I'd also genuinely appreciate hearing what breaks or feels awkward. I built it around my own setup, so there are almost certainly configurations I haven't considered yet.

1 Upvotes

0 comments sorted by