Expand description
Model catalog — two-mode aliases (pinned + auto-resolve), dependency-tree config merge, and models cache lifecycle.
Model aliases map short names (opus, sonnet, codex) to concrete model IDs. Two modes:
- Pinned: explicit model ID, no resolution needed.
- AutoResolve: pattern-based resolution against a cached model catalog.
Merge precedence: consumer > deps (declaration order).
Modules§
Structs§
- Cached
Model - A single model entry in the cache.
- Model
Alias - A model alias — either pinned to a specific model ID or auto-resolved against the models cache at resolution time.
- Models
Cache - Cached model catalog from external API.
- Resolved
Alias - Fully resolved model alias — everything a consumer needs to launch.
- Resolved
DepModels - Info about a resolved dependency’s model config.
Enums§
- Harness
Source - How the harness was determined.
- Model
Spec - How a model alias resolves to a concrete model ID.
- Refresh
Mode - Refresh
Outcome
Functions§
- auto_
resolve - Resolve an auto-resolve spec against the models cache.
- builtin_
aliases - Minimal builtin aliases so common model names work out of the box. No descriptions — packages layer those on top. Precedence: consumer > deps > builtins.
- ensure_
fresh - fetch_
models - Fetch models from the models.dev API.
- filter_
by_ visibility - Filter resolved aliases by visibility config.
- glob_
match - Simple glob matching:
*matches any sequence of characters. Everything else is literal. Case-sensitive. - is_
mars_ offline - load_
models_ cache_ ttl - merge_
model_ config - Merge model aliases from dependency tree.
- now_
unix_ secs - now_
unix_ secs_ value - read_
cache - Read models cache from
.mars/models-cache.json. - resolve_
all - Resolve all aliases to concrete model IDs + harnesses.
- resolve_
refresh_ mode - write_
cache - Write models cache to
.mars/models-cache.json(atomic via tmp+rename).