Expand description
Named model registry shared by all agents.
On disk: ~/.mur/models.yaml. Schema:
schema_version: 1
models:
anthropic_opus_4_7:
provider: anthropic
model: claude-opus-4-7
secret: env:ANTHROPIC_API_KEY
capabilities: [chat, tools]Structs§
Enums§
- Billing
Mode - Who pays when this model answers.
- Requirement
- A capability the request needs from whatever model serves it. Derived from the request itself (an image in the messages, a tool list) and never from config: a router may only substitute a model that can do the job.
Constants§
- CAP_
CHAT - Registry capability strings. The baseline (
chat) is legacy-permissive — an entry with nocapabilitiesat all predates the field and is assumed chat-capable. Everything above the baseline is fail-closed. - CAP_
TOOLS - CAP_
VISION
Functions§
- choose_
by_ difficulty - Opt-in difficulty heuristic: pick
frontierwhen the estimated input token count exceeds the threshold, elsecheap.Nonewhen misconfigured (caller falls through to model_ref/global default). - pick_
cheap_ model - Pick the cheapest registry entry that can serve a request needing
reqs, excludingexclude(the agent’s own primary). None when no qualifying entry exists → caller keeps normal candidates (fail-expensive). - resolve_
model_ refs - Build the ordered list of model_refs to try:
[primary, ...fallback]. Priority per-agent → global. The primary is de-duplicated out of the chain (no point retrying the same ref back-to-back). Returns empty when nothing is configured, so the caller keeps today’s single-inline-model behaviour. - satisfies
- Can this entry serve a request needing
reqs?