@oxel40/opencode-model-groups
v0.1.0
Published
opencode plugin: switch a whole team of agents between named model/variant presets from a config file and a /modelgroup picker
Downloads
190
Maintainers
Readme
@oxel40/opencode-model-groups
Switch a whole team of opencode agents between named
model/variant presets — from one config file and a /modelgroup picker in
the TUI.
Define a group once:
// ~/.config/opencode/model-groups.json
{
"groups": {
"default": {},
"hierarchical": {
"orchestrator": { "model": "github-copilot/claude-opus-5", "variant": "medium" },
"implementer": { "model": "github-copilot/claude-opus-5", "variant": "low" },
"verifier": { "model": "github-copilot/gpt-5.6-luna", "variant": "medium" }
}
}
}Point your agents at it with a group:<alias> placeholder instead of a real
model string:
// opencode.json
{
"agent": {
"orchestrator": { "model": "group:orchestrator" },
"implementer": { "model": "group:implementer" }
}
}Then flip the whole team between presets with the /modelgroup command
(bound in the TUI), without editing opencode.json at all. Any agent whose
alias is missing from the active group falls back to opencode's own default
model.
Install
// opencode.json — rewrites `group:*` model placeholders on config load
{
"plugin": ["@oxel40/opencode-model-groups"]
}// tui.json — adds the `/modelgroup` picker command
{
"plugin": ["@oxel40/opencode-model-groups/tui"]
}Both entries are needed: the server half resolves the placeholders, the TUI half lets you switch the active group interactively. opencode installs npm plugins automatically via Bun at startup.
How it works
~/.config/opencode/model-groups.jsonholds every named group. Missing file → the plugin is a no-op.- The currently active group name is plugin-owned state, written by
/modelgroupto opencode's state dir — not part ofopencode.json. - On every config load,
group:<alias>in an agent'smodel(or in the top-levelmodel/small_model) is replaced with that alias's entry from the active group. An alias absent from the group is dropped (falls back to opencode's default); a malformed entry (missingmodel) is dropped and logged as an error. - Switching groups via
/modelgroupdisposes the running instance so the next request re-resolves config with the new group.
License
MIT
