agent-zero/plugins/_model_config
Alessandro 63d0536cdc Update default main model to Claude Sonnet 5
Set the bundled model config, Balance preset, and onboarding OpenRouter default to anthropic/claude-sonnet-5. Refresh the model config README example to match.
2026-07-02 17:29:40 +02:00
..
api Add deferred first-send model gate 2026-07-02 17:29:40 +02:00
extensions Add deferred first-send model gate 2026-07-02 17:29:40 +02:00
helpers Add deferred first-send model gate 2026-07-02 17:29:40 +02:00
webui Add deferred first-send model gate 2026-07-02 17:29:40 +02:00
AGENTS.md Add deferred first-send model gate 2026-07-02 17:29:40 +02:00
default_config.yaml Update default main model to Claude Sonnet 5 2026-07-02 17:29:40 +02:00
default_presets.yaml Update default main model to Claude Sonnet 5 2026-07-02 17:29:40 +02:00
hooks.py Refactor API key handling and update system improvements 2026-03-24 14:41:46 +01:00
plugin.yaml feat: add _model_config plugin with call-time model resolution 2026-03-14 09:41:19 -07:00
provider_metadata.yaml Add llama.cpp and vLLM local providers 2026-06-15 05:37:28 +02:00
README.md Update default main model to Claude Sonnet 5 2026-07-02 17:29:40 +02:00

Model Configuration

Manage which models Agent Zero uses for chat, utility, and embeddings, with support for scoped overrides and reusable presets.

What It Does

This plugin centralizes model selection and model-related settings for the application. It provides helpers and APIs for:

  • selecting chat, utility, and embedding models
  • reading and saving model presets
  • checking for missing API keys
  • allowing optional per-chat model overrides
  • resolving config at global, project, agent, and chat scope

Main Behavior

  • Scoped configuration
    • Reads plugin config through the standard plugin config system with project and agent overrides.
  • Preset management
    • Loads presets from a user file when present and falls back to bundled defaults.
    • Project presets can be stored beside a project's scoped model config.
  • Per-chat override
    • Allows a chat context to store a temporary override or preset reference in context data.
  • Model object construction
    • Builds ModelConfig objects and the runtime chat, utility, and embedding wrappers used elsewhere in the app.
  • API key validation
    • Reports configured providers that still require API keys.

Key Files

  • Core helper
    • helpers/model_config.py resolves config, presets, overrides, and runtime model objects.
  • APIs
    • api/model_config_get.py
    • api/model_config_set.py
    • api/model_override.py
    • api/model_presets.py
    • api/model_search.py
    • api/api_keys.py
  • Hooks
    • hooks.py exposes plugin-level integration hooks.

Configuration Scope

  • Settings section: agent
  • Per-project config: true
  • Per-agent config: true
  • Always enabled: true

Project-Scoped Model Config

Projects store copied model settings in the standard scoped plugin path:

/a0/usr/projects/<project>/.a0proj/plugins/_model_config/config.json

Project-only presets live beside that config:

/a0/usr/projects/<project>/.a0proj/plugins/_model_config/presets.yaml

The project preset file uses the same plain YAML list schema as global presets. It does not contain scope metadata:

- name: Research
  chat:
    provider: openrouter
    name: anthropic/claude-sonnet-5
    api_base: ""
    ctx_length: 200000
    ctx_history: 0.7
    vision: true
  utility:
    provider: openrouter
    name: openai/gpt-5.4-mini

Preset slots are partial overlays. Missing fields inherit from the current effective config, so a preset can switch only the model identity while preserving tuned context windows, rate limits, and nested kwargs. The utility and embedding slots are optional and only apply when they declare a provider or model name; otherwise those configured models are inherited. Selecting a preset for a project writes the merged result into the project's config.json.

Plugin Metadata

  • Name: _model_config
  • Title: Model Configuration
  • Description: Manages LLM model selection and configuration for chat, utility, and embedding models. Supports per-project and per-agent overrides with optional per-chat model switching.