Agentic.LLM.Canonical
(agentic v0.3.0)
Copy Markdown
Canonical model identity. The (provider, model_id) → canonical_id mapping
used to group pathways for the same underlying model weights across
providers (e.g. Anthropic direct, Claude Code CLI, OpenRouter all serve
claude-sonnet-4).
Resolution order for for_model/2:
- Static overrides (Codex aliases, Claude Code short aliases, z.ai GLM family — anything models.dev doesn't list)
- The cached models.dev catalog (~50 providers, refreshed every 24h)
- Pattern rules (e.g. strip OpenRouter org prefix)
- Fallback
"<provider>:<model_id>"so the model is never canonical-less
Persistence
The fetched models.dev snapshot is written to ~/.agentic/models_dev.json
on every successful refresh so first boot is fast and we degrade cleanly
when models.dev is unreachable.
Summary
Functions
Returns a specification to start this module under a supervisor.
Resolve the canonical id for (provider, model_id). Always returns a
non-nil binary; falls back to "<provider>:<model_id>" for unknowns.
Inspect cache state — debugging/Mix-task use.
Return the rich models.dev metadata row for (provider, model_id) if
one is cached. nil otherwise.
Force a refresh from models.dev.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Resolve the canonical id for (provider, model_id). Always returns a
non-nil binary; falls back to "<provider>:<model_id>" for unknowns.
Inspect cache state — debugging/Mix-task use.
Return the rich models.dev metadata row for (provider, model_id) if
one is cached. nil otherwise.
Force a refresh from models.dev.