Skip to main content

Module model_registry

Module model_registry 

Source

Re-exports§

pub use crate::known_models::KNOWN_MODELS;
pub use crate::known_models::lookup_known_model;

Structs§

AliasEntry
ModelConfigUpdate
ModelEntry
ModelInfo
ModelRow
ProviderConfig
ProviderEntry
ProviderGroup
ProviderPreset
ProviderPresetModel

Enums§

ModelMigrationOutcome

Constants§

DEFAULT_CONFIG_PROVIDER_TYPE
PROVIDER_PRESETS

Statics§

MODEL_CONFIG_LOCK
Serializes tests that mutate the global model registry.

Functions§

add_alias_to_config
all_aliases
all_model_entries
all_provider_entries
all_provider_groups
Return all models grouped by provider, with complete metadata. Single canonical source for UI — no manual union of all_model_entries + discovered_models + aliases.
all_provider_groups_with_empty
Return enabled configured providers even when no model has been registered yet.
config_provider_types
discovered_models
enabled_provider_names
is_first_run
is_provider_enabled
migrate_config_if_needed
model_entry
model_info
parse_config
Unified config parser — parses [providers.X], [models.X], and [alias.X] sections from a TOML string into a ProviderConfig.
provider_display_name
read_config_toml_pub
register_all_preset_models
Register preset models for all config providers that match a PROVIDER_PRESETS entry. Called at bootstrap after register_providers_from_config.
register_discovered
Build ModelEntry values from discovered models and register them. Models are keyed as <provider_name>:<slug> (e.g. Codex:codex/gpt-5.5).
register_discovered_for_provider
register_model_entries
Register additional model entries without clobbering existing ones.
register_preset_models_for
Register preset models for a provider whose base_url matches a PROVIDER_PRESETS entry. Models are marked discovered = true so they survive set_model_config reloads but are never written to config.toml. User-defined models in config.toml take priority.
register_provider_entries
Register additional provider entries without clobbering existing ones.
remove_alias_from_config
resolve_alias
set_discovered_models
set_model_config
Backwards-compatible alias for set_provider_config.
set_provider_config
Set the base model configuration (from config.toml). Preserves previously registered discovered models.
update_alias_in_config
upsert_model_config
upsert_provider_config

Type Aliases§

ModelConfig
Backwards-compatible alias — ProviderConfig is the canonical name.