Expand description
Choosing a model from --model, settings and available credentials.
Port of packages/coding-agent/src/core/model-resolver.ts in pi v1.0.0.
Structs§
- CliModel
- The result of
--modelresolution. - Pattern
Match - A pattern match, with a thinking level from a
:levelsuffix. - Scoped
Model - A model in the session’s scope, with the level its pattern named.
Constants§
- DEFAULT_
MODEL_ PER_ PROVIDER - The model pi picks for a provider when nothing else decides.
- DEFAULT_
THINKING_ LEVEL - pi’s default thinking level.
Functions§
- exact_
match - A model by exact reference:
provider/id, or a bare id that is unique. - initial_
model - The starting model when
--modelis absent: the saved default if it has credentials, else the first authenticated provider’s default model, else the first authenticated model. - parse_
pattern - Matches
pattern(optionallypattern:level) againstmodels. - resolve_
cli_ model - Resolves
--providerand--modelagainst every model, authenticated or not. - resolve_
model_ scope - pi’s
resolveModelScopeFromModels: the modelspatternsselect frommodels, in pattern order without duplicates, and a warning for each pattern that selects nothing or names an invalid level. A pattern is a glob overprovider/idor the id, ignoring case, or a model pattern as--modeltakes. Either may end in:level.