Skip to main content

Module provider

Module provider 

Source
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.
ListedModel
One model a provider’s endpoint lists, with only what the endpoint said.
ModelSpec
A model with what the engine should know about it beyond its id.
PeriodUsage
One period’s usage against its limit.
ProviderConfig
One entry of providers.
ProviderSwitch
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.
QuotaStatus
A provider’s usage in the periods it is in now.
ResolvedTiers
Tiers with the gaps filled.
TaskTiers
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) and web_fetch (WebFetch reading a page — unset, WebFetch uses 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.
ModelEntry
One entry of a provider’s models.
ThinkingToggle
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§

QuotaLedger
Where providers’ usage is kept.
RouteObserver
Told about every ProviderSwitch of a session’s calls.
TaskRouting
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 order puts 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 empty order is the first defined provider alone.