Expand description
Registry of model providers and the models they offer.
Providers are stored in a map keyed by their stable unique id (e.g.
"bedrock"). Models are identified globally by a ModelRef
(provider id + provider-scoped model id).
Providers run as separate processes configured in
~/.infinity/providers.json (see ProvidersConfig): each entry maps a
provider id to the command that serves that provider over a Unix socket.
The daemon spawns each command, reads the socket path the process prints
on stdout, and talks to it through a
RemoteModelProvider.
Structs§
- Catalog
Model - A model in the catalog, tagged with the provider that offers it.
- Catalog
Model Source - [
ModelSource] over the daemon’s catalog: each completion round resolves the model persisted for its thread in the conversation store, falling back to the global default when the selection is no longer available. Model switching is just persisting a new selection — the next round picks it up, and an in-flight completion finishes on the model it started with. - Model
Catalog - All registered providers and their available models.
- Provider
Config - Configuration for a single model provider process in
providers.json. - Providers
Config - The providers configured in
~/.infinity/providers.json: a JSON object mapping provider id to aProviderConfig, e.g.:
Functions§
- load_
providers_ config - Load the providers config from
path. There is no implicit default: at least one provider must be configured (e.g. viainfinity provider install) for the daemon to start. - spawn_
configured_ providers - Spawn every provider in the config. Returns the
(provider_id, provider)pairs forModelCatalog::newplus the child process handles, which must be kept alive for as long as the providers are in use. - spawn_
provider - Spawn a provider process and wait for it to print its socket path on
stdout. The returned
Childkills the process when dropped; callers must keep it alive for as long as the provider is in use.