Skip to main content

Module selection

Module selection 

Source
Expand description

Account selection: which account serves a session the gateway has no binding for.

The walk is the orgโ€™s accounts list then fallback_accounts, filtered by declared models: the first account whose models list includes the requested model wins. Within the surviving set the first account in walk order wins, with saturation demoting an account to a later tier: ready beats saturated, and a Bailed account is the last resort (its 429 hit the usage probe, not inference).

Re-exportsยง

use crate::account::AccountKey; ๐Ÿ”’
use crate::account::AccountStateMap; ๐Ÿ”’
use crate::account::LoadingState; ๐Ÿ”’
use crate::account::account_serves; ๐Ÿ”’

Structsยง

OrgPin
An orgโ€™s walk order: the primary pin, then fallbacks.

Enumsยง

SelectionError
Why no account was selected. Loud by design: a silent fallback would route a session to an account its model cannot use.

Functionsยง

declares ๐Ÿ”’
true when the account serves model, by declaration or alias.
select_account
Pick the account for model out of orgโ€™s walk order: the first account whose declared models include the model. Ready accounts beat saturated ones, and Bailed accounts are the last resort. A retired account - one a reload removed - is never offered.