plugins/_model_config/README.md
Manage the reusable model presets used for Agent Zero's main, utility, and embedding models.
Default is always present, appears first, and cannot be renamed or deleted.usr/plugins/_model_config/presets.yaml. Plugin defaults in mode_presets_fallback.yaml are used only when a saved collection cannot be initialized.Default, while provider-specific kwargs are replaced or cleared instead of leaking between providers.Global, project, project/profile, and agent-profile scopes store only a preset name in their standard plugin config.json:
{"model_preset": "Balance"}
For example, a project selection is stored at:
/a0/usr/projects/<project>/.a0proj/plugins/_model_config/config.json
The normal plugin resolution order selects the most specific available reference. A missing or deleted reference safely resolves to Default. Chats may store an explicit preset reference in chat_model_override; clearing it returns the chat to its scoped selection.
The startup migration converts the prior global full model configuration into Default, preserves existing global presets, promotes distinct scoped full configurations and legacy project presets into uniquely named global presets, and rewrites scoped config files to selection-only JSON. Original files receive a .pre-unified-presets.bak backup before replacement; the migration is idempotent.
At every startup, legacy migration runs first. If usr/plugins/_model_config/presets.yaml then exists, initialization returns immediately without network access. Otherwise the plugin makes one bounded request for agent0ai/a0-presets/model_presets.yaml, validates the whole collection, removes secret fields, and saves it locally. A download, parse, or validation failure processes and saves plugin-local mode_presets_fallback.yaml through the same validation path, so initialization remains usable offline.
helpers/model_config.py owns preset validation, resolution, compatibility config shapes, and runtime model construction.api/model_presets.py owns global preset editing, scoped selection, and reference repair after rename/delete/reset.extensions/python/startup_migration/_10_migrate_model_config.py owns legacy conversion.extensions/python/startup_migration/_20_bootstrap_model_presets.py owns missing-collection initialization and plugin-local fallback.webui/preset-overview.html is the shared Settings/plugin-settings summary widget.webui/main.html is the preset editor._model_configagenttruetruetrue