Skip to content

Repository files navigation

oModel

A small TUI to help set OMO (oh-my-openagent) models — command omodel.

what omo suggests + what you already have → pick one → save a clean config.

Per agent/category, oModel shows omo's fallback chain filtered to the models you can actually run (via opencode models) — each as one row per serving provider, dedicated providers before gateways. You pick one and it fills in the correct provider/ prefix and a valid variant, then writes it back to omo's config: only the agents/categories blocks are rewritten clean — everything else in the file, including comments and commented-out config, is kept verbatim (timestamped backups each save).

 oModel: opencode · anthropic · openai
┌──────────────────────────────┐┌──────────────────────────────────────────────────┐
│ AGENTS                       ││ agent: sisyphus                                  │
│   sisyphus                   ││ model: anthropic/claude-opus-5                   │
│     ↳ ultrawork              ││ variant: max                                     │
│   hephaestus                 ││ ctx 256k · $5/$25 · reasoning · image            │
│   oracle                     │└──────────────────────────────────────────────────┘
│   librarian                  │┌──────────────────────────────────────────────────┐
│   explore                    ││ ● anthropic/claude-opus-5 (max)                  │
│   multimodal-looker          ││   opencode/claude-opus-5 (max)                   │
│   prometheus                 ││   opencode/kimi-k3                               │
│   metis                      ││   openai/gpt-5.6-sol (medium)                    │
│   momus                      ││   opencode/gpt-5.6-sol (medium)                  │
│   atlas                      ││   opencode/glm-5.2  (≈ omo glm-5)                │
│   sisyphus-junior            ││ + add model…                                     │
│ CATEGORIES                   ││                                                  │
│   visual-engineering      ▂▂ ││                                                  │
│   ultrabrain                 ││                                                  │
│   deep                       ││                                                  │
│   artistry                   ││                                                  │
└──────────────────────────────┘│                                                  │
┌─ PRESETS ────────────────────┐│                                                  │
│ ● 1 daily                    ││                                                  │
│   2 max-power                ││                                                  │
│ + add preset…                ││                                                  │
│                              ││                                                  │
└───── saved 07-30 · 4 models ─┘└──────────────────────────────────────────────────┘
 s save · q quit · ? help                                                    v0.4.0

claude-opus-5 is offered twice — once under anthropic, once under the opencode gateway. Pick the row and you pick the prefix. (Which providers and models you see are your own; these are omo's first-choice ones for this agent. The ▂▂ is the scrollbar — the target list is longer than the pane.)

Requirements

  • Python ≥ 3.9
  • opencode CLI on PATH (degrades gracefully if absent)
  • bun — only for omodel --refresh-omo (regenerating bundled suggestion data)

Installation

Standalone binary (recommended)

curl -fsSL https://raw.githubusercontent.com/zhoufanscut/oModel/main/install.sh | sh

Installs omodel to ~/.local/bin. Supported platforms: linux-x64 and darwin-arm64 (Apple Silicon). Intel macs (darwin-x64) aren't pre-built — install via pipx install git+https://github.com/zhoufanscut/oModel.

The prebuilt linux-x64 binary needs a glibc at least as new as whatever the ubuntu-latest GitHub Actions runner ships at build time. On older distros where the binary fails to start with a glibc-version error, use the pipx/uvx install path below instead.

pipx / uvx (from GitHub, no PyPI)

# pipx
pipx install git+https://github.com/zhoufanscut/oModel

# uvx (run without installing)
uvx --from git+https://github.com/zhoufanscut/oModel omodel

# uv tool install
uv tool install git+https://github.com/zhoufanscut/oModel

Updating

omodel --update          # what's available? then it asks before installing
omodel --update --yes    # no prompt (for scripts and cron)

--update tells you what's out and asks Update now? [y/N] — so it doubles as "is there anything new?", and saying no costs you nothing. It never prompts when there's no terminal to answer on (piped, redirected, CI) or when you asked for --json: it reports and stops.

If you installed the standalone binary, saying yes replaces it in place: it downloads the release tarball, verifies its published sha256, and runs the new binary to confirm it works on this machine before swapping it in — so a bad download or a glibc mismatch leaves your working omodel untouched. If you installed with pipx / uv / pip, it prints the exact command for your install (it won't write into a tree another tool owns).

This is the only thing in omodel that uses the network. Launching it does not check for updates.

Maintainer / development

git clone https://github.com/zhoufanscut/oModel
cd oModel
uv pip install -e .

Regenerate the bundled suggestion data with omodel --refresh-omo (needs bun and an omo checkout; point it with --omo-src PATH or $OMO_SRC). See DESIGN.md for details.

Usage

omodel                          # launch the TUI
omodel --config PATH            # use a specific config file
omodel --restore                # list recent backups and restore one
omodel --refresh-omo [--omo-src P]  # regenerate bundled suggestion data from an omo checkout
omodel --refresh-models         # force `opencode models --refresh` + rebuild the local cache
omodel --print                  # print current resolved models, no UI
omodel --check                  # dry-run CI check (exit 0; degrades if opencode absent)
omodel --update [--yes]         # update omodel itself to the latest GitHub release (asks first)
omodel --version

opencode's model list and per-model details are cached for 24h under ~/.cache/omodel/, so warm launches are instant. Press r in the TUI (or run omodel --refresh-models) to force a live re-fetch and rebuild the cache.

Key bindings (TUI)

Key Action
(j k) Navigate agents/categories or candidates
(h l) Jump between the targets and candidates panes
Tab / Shift+Tab Cycle all three panes (targets → presets → candidates) — the way to reach the presets card
Enter Set the highlighted candidate (or open + add model…); on a preset, switch to it; on + add preset…, add one
v Pick a variant for the current candidate
a Add a custom model (candidates / category row), an ultrawork / compaction sub-target (agent row), or a new preset holding the current models (presets card)
r Refresh the model list — or, on a preset, rename it
x Clear the current agent/category model (on a sub-target or a model row you added: delete the row; on a preset: delete it, after a confirm — never the one you're using)
u / Ctrl+r Undo / redo the last edit (in session)
s Save (diff + confirm modal)
? Key overlay — the base-screen keys the hint bar doesn't already show, grouped by pane
q Quit (if unsaved: save & quit / discard / cancel)
(h l) in a dialog Move between buttons (Tab works too)

How it works

  1. What omo suggests — oModel bundles a snapshot of omo's model requirements, so it needs neither an omo checkout nor a network call at runtime.
  2. What you have — read live from opencode models. The TUI degrades to suggestions-only if opencode is absent.
  3. Pick — each suggested model you can run is shown as one row per serving provider (dedicated providers before gateways). Pick a row and oModel applies the provider/ prefix and a valid variant for you.
  4. Save — shows a diff before writing a clean config, snapshotting the prior file to a timestamped backup (omodel --restore to roll back).

Presets sit under the agent list, and they're what you actually edit. One is always active (); your model changes go into it, and s writes it to the config. Press Enter on another preset to switch (your edits stay in the one you leave), r to rename one, x to delete one, and a (or Enter on the last row, + add preset…) to add another from the models you're looking at — keep as many as you like. First run seeds a default preset from the config you already have, so your config always matches one of your presets — never a state you can't get back to. Nothing is written until you press s, and then both files are written together; presets live beside your config in .omodel-presets.json, so a --config override keeps its own set.

Using oModel from an agent

If you work with an LLM coding agent, it can drive oModel directly instead of hand-editing your config — which means it gets the provider/ prefix, the variant check, the backup and the preset invariant, same as you do from the TUI.

omodel agent-guide                            # the full contract, written for an agent
omodel candidates agent:sisyphus --json       # what this agent can run
omodel set agent:sisyphus opencode/kimi-k3 --dry-run   # preview; drop --dry-run to write

(omo revises its suggested models most weeks, so take real ids from omodel candidates rather than from any example here.)

Also targets, show, check, clear, apply (batch, one save) and preset ls|use|new|rm — all with --json. Exit codes carry the meaning: 0 success, 1 oModel failed, 2 usage, 3 refused (unknown target, a model you can't run, a bad variant).

Telling your agent oModel exists

An agent that reaches for omodel --help finds agent-guide and reads the whole contract from there. The gap is earlier than that: asked to change a model, an agent's first instinct is often to open omo's config and edit it — and nothing in that file mentions oModel.

So say it once, before the agent forms a plan. Paste this into your CLAUDE.md, AGENTS.md, or whatever instructions file your agent reads at startup:

## Changing OMO models

Never hand-edit omo's config (`~/.omo/omo.jsonc`) — it skips the `provider/` prefix, the
variant check,
the backup and the preset invariant. Use the `omodel` CLI instead:

    omodel agent-guide                        # read this first — the full contract
    omodel candidates <target> --json         # what a target can run; use a row's `value` verbatim
    omodel set <target> <value> [--variant V] # writes config + presets together

Targets are `agent:<name>`, `agent:<name>.ultrawork`, `agent:<name>.compaction`, `cat:<name>`
(`omodel targets --json` lists them). Exit 3 means the request was refused — read the message
and pick another candidate. Exit 1 means omodel failed; stop and report.

One line of it does the real work: never hand-edit the file. Everything else the agent can discover from omodel agent-guide.

See DESIGN.md for the full design — data sources, resolution rules, caching, and packaging.

License

oModel's own code is MIT-licensed — see LICENSE.

The bundled omo-suggestions.json is derived from oh-my-openagent (Sustainable Use License v1.0) — see NOTICE for full attribution and redistribution constraints.

About

A small TUI to help set OMO (oh-my-openagent) models — shows omo's suggestions next to what you already have, so you can pick one and save a clean config.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages