Skip to main content

Module model

Module model 

Source
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§

ModelEntry
ModelRegistry
RoleEntry

Functions§

choose_by_difficulty
Opt-in difficulty heuristic: pick frontier when the estimated input token count exceeds the threshold, else cheap. None when misconfigured (caller falls through to model_ref/global default).
pick_cheap_model
Pick the cheapest chat-capable model_ref for Smart background routing, excluding exclude (the agent’s own primary). Chat-capable = capabilities contains “chat” OR is empty (legacy entries assumed chat). 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.