Model tiers
Yokai does not pin one model for the whole run. Each phase gets a capability tier, each tier lists agent and model candidates in order, and each turn takes the first candidate that opens.
Why tiers
Renaming a field and redesigning a state machine do not need the same model. A tier describes how much capability a phase needs. Your settings map each tier to concrete agents and models. When a provider changes its lineup, you edit one list in .koi/yokai.yml instead of every phase.
Junji alone does not use tiers. When you run /junji next, the phase runs with whatever agent and model you have open.
The pieces
- Tier: one of four bands,
low,medium,highorultra.mediumis the default. - Phase assessment: the tier chosen for one phase, with a one-line reason, approved by a human. On a JSON board it sits on the card as
"yokai": {"model-tier": "high", "reason": "..."}. - Candidate: one agent with an optional model, effort and speed, such as
{agent: claude, model: opus}. A tier holds an ordered list of candidates; the first is preferred. - Role: the kind of turn. Plan, coder, judge and seal use the phase tier unless you lift them. Repair, fix and triage (Diagnose) use
ultraunless you set otherwise.
A tier is a band, not a model. Yokai treats model IDs as opaque strings that the agent supplies; it never interprets them.
How a turn picks its candidate
- If you launched with
--agent,--modelor--effort, Yokai builds one candidate from those flags and skips the rest of this list. - Otherwise it finds the role's tier:
roles.<role>.tierif set, else the phase tier for plan, coder, judge and seal, elseultrafor repair, fix and triage. - It walks that tier's candidate list when the turn opens. If a candidate cannot open a session because it is unreachable, rate limited or unstable, Yokai writes a skip row to
ledger.jsonland tries the next one for the same turn. - A skipped candidate is not tried again until
tiers.retry_after_secspasses (3600 seconds by default). If every candidate is skipped, the run halts.
A red test or a Build that does not converge is the work failing, not a reason to switch candidates. A missing effort or speed option is a notice, not a skip. An agent that dies mid-turn is an interrupt; the turn can reattach.
Example settings
# .koi/yokai.yml
model_mode: tiers
tiers:
low:
- agent: claude
model: haiku
medium:
- agent: claude
model: sonnet
- agent: codex # fallback if Claude is unavailable
high:
- agent: claude
model: opus
ultra:
- agent: claude
model: opus
effort: max
roles:
judge:
tier: high
With this file, a medium phase codes with Sonnet and is reviewed by Opus. If the Claude adapter cannot open a session, the coder turn falls back to Codex with its default model.
model_mode: single means you chose One model in setup: the same agent and model fill all four bands.
Who chooses the tier
Yokai proposes a tier and a reason for each unfinished phase during setup, or the optional /yokai assess helper does it from chat. You approve with Approve and continue. A saved, complete choice is authoritative: Yokai does not ask again at the next launch or check it against a hash. Reconsider it yourself when a phase's scope changes. Headless startup stops if a phase has no tier or no reason.
A rough guide: low for mechanical edits with clear checks, medium for bounded work with good tests, high for cross-module changes and migrations, ultra for tightly coupled work where another failed attempt is expensive. Agents and models suggests concrete models.
What can go wrong
missing or incomplete phase assessment. A phase has nomodel-tieror noreason. Openyokai setupand approve the proposals.tiers.medium must list at least one candidate. A band is an empty list. Add a candidate or rerun setup.- Every candidate skipped. The agent is logged out or out of quota. Fix the login, or wait for
retry_after_secs. - A notice like
effort ... exposes no ... selection. The turn still runs, but the candidate setsefforton an agent that has no reasoning selector, often Cursor. Removeeffortfrom that candidate.