Expand description
Model providers as settings.json describes them — the providers list,
each entry’s vendor, protocol, models, tiers and quota — the contract a
session’s code routes its calls through (TaskRouting), and where
quota usage is kept (QuotaLedger).
Lives in base so Settings can carry these types directly. The router
that falls back along model.order is model::routing; building a live
client from a ProviderConfig needs a concrete protocol and is the
assembly’s job (assembly::model_router).
Structs§
- Destination
- A provider and the model a call is sent to it with.
- Listed
Model - One model a provider’s endpoint lists, with only what the endpoint said.
- Model
Spec - A model with what the engine should know about it beyond its id.
- Period
Usage - One period’s usage against its limit.
- Provider
Config - One entry of
providers. - Provider
Switch - A call that went to a different provider than the call before it.
- Quota
- Token limits per period, counted as uncached input plus cache writes plus output; cache reads do not count. A period left out has no limit.
- Quota
Status - A provider’s usage in the periods it is in now.
- Resolved
Tiers Tierswith the gaps filled.- Task
Tiers - The tier each kind of model call asks for. The task types:
main(the conversation),subagent(sub-agents started without a model of their own),compact(summarizing for compaction),memory(extracting memories),title(naming a session),web_search(WebSearch) andweb_fetch(WebFetchreading a page — unset,WebFetchuses no model and returns the page text). - Tiers
- Which of a provider’s models serves each tier, as written.
Enums§
- ApiType
- The wire protocol a provider speaks.
- Model
Entry - One entry of a provider’s
models. - Thinking
Toggle - The request fields an OpenAI-style endpoint switches thinking with.
- Tier
- A model tier. Tasks and sessions ask for a tier; each provider says which of its models serves it.
- Vendor
- Who runs the endpoint. Decides what the protocol leaves open: how thinking is switched on, whether reasoning goes back, how effort is spelled.
Traits§
- Quota
Ledger - Where providers’ usage is kept.
- Route
Observer - Told about every
ProviderSwitchof a session’s calls. - Task
Routing - Where a session’s model calls go: the model each kind of call goes through, and what a model or tier name stands for at the provider calls go to first.
Functions§
- routing_
order - The providers
orderputs calls through, first to last, each with its tiers filled — or what is wrong with the configuration. Every defined provider is checked, ordered or not. An emptyorderis the first defined provider alone.