Skip to main content

Model Catalog

@cachehit/model-catalogv2026.10.26.1· Apache-2.0· 1d agoBEHAVIORS
01README

Choose which model each kind of work uses, and fall back to the next model when one is rate limited, out of quota or unavailable. Built for agent steps run with @cachehit/agents (Kiro CLI).

You own the catalog: each role (for example implementer, reviewer, classifier) has ordered tiers of {model, costClass, toolProfile, effort}. resolveDispatch stores the tier a step should use for one (workItem, role, attempt). Given a failure class, or the newest failed @cachehit/agents invocation for the work item, it advances on rate-limit, quota and model-unavailable, stays on other failures, and parks when tiers or attempts run out. Results are idempotent per (workItem, role, attempt).

Quick Start

swamp extension pull @cachehit/model-catalog
swamp model create @cachehit/model-catalog catalog --global-arg 'catalog={
  "version": "1",
  "roles": {
    "implementer": {"tiers": [
      {"model": "claude-haiku-4.5", "costClass": "low", "toolProfile": "actor"},
      {"model": "claude-sonnet-4.6", "costClass": "medium", "toolProfile": "actor"}
    ]},
    "reviewer": {"tiers": [
      {"model": "claude-opus-4.8", "costClass": "high", "toolProfile": "readonly"}
    ]}
  }
}'

swamp model method run catalog resolveDispatch \
  --input workItem=WI-42 --input role=implementer --input instanceName=kiro
swamp data get catalog dispatch--WI-42--implementer--1 --json

Methods

  • resolveDispatch: store the model, tool profile and effort for one attempt, applying a fallback when a failure signal is given or read.
  • recordFallback: store only the fallback decision for a signal.
02Release Notes

First release. resolveDispatch and recordFallback select a Kiro model per role from your catalog and fall back to the next tier on rate limits, quota and unavailable models, reading failures from @cachehit/agents.

03Behaviors1
@cachehit/model-catalogv2026.10.26.1model_catalog/model_catalog.ts

Global Arguments

ArgumentTypeDescription
roleMap?recordFolds your own role names onto catalog roles, for example {"security-review":"reviewer"}
signalTagKeys?objectInvocation tag keys that identify the work item and phase of an agent run
fn resolveDispatch(instanceName: string, attempt?: number, currentTier?: number, agentModel?: string)
Store the model, tool profile and effort a step should use for this attempt, moving to the next tier after a rate limit, quota or unavailable model
ArgumentTypeDescription
instanceNamestringAgent step or model instance; recorded unchanged
attempt?number
currentTier?numberTier the previous attempt ran on; inferred from the failed invocation's model when read from agentModel, else 0
agentModel?string@cachehit/agents model instance to read invocations from; defaults to instanceName
fn recordFallback(currentTier?: number, attempt?: number)
Store the fallback decision for a failure signal without resolving a dispatch
ArgumentTypeDescription
currentTier?number
attempt?number

Resources

dispatch(infinite)— Model, tier, tool profile and effort a step uses for one (workItem, role, attempt)
fallback(infinite)— Fallback decision (advance, no-fallback or park) for one (workItem, role, attempt)
04Stats
A
100 / 100
Downloads
2
Archive size
17.5 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
05Platforms
06Labels