Model Configuration

Configure AI model settings

Model Configuration Guide

Prompt-first procedure: Describe the outcome you want in your agent conversation. The agent should select and load the appropriate AIWG assets, explain material changes, request any needed approval, and report verification evidence. Exact commands and flags appear only in the CLI reference.

Start with a prompt

“Choose the cheapest capable worker for this task. Show me the effective

strategy and ceiling, keep coupled edits local, and ask before premium.”

“Keep automatic delegation off for this project; I will request workers when

needed.”

Use the agent orchestration guide for the mode/tier ladder, bounded briefs, return budgets, and provider limits. State a scope, verification oracle, and stop condition before selecting a worker.

Overview

AIWG uses a configurable model mapping system that allows users to specify which AI models to use for different agent roles without modifying deployment scripts or documentation.

The current provider-aware contract separates three concerns:

  • canonical policy: `model-role`, `model-tier`, optional `model-effort`, and an

exceptional exact `model-override`;

  • provider capabilities:

`agentic/code/providers/model-capabilities.v1.json`; and

  • volatile exact identifiers:

`agentic/code/providers/model-catalog.v1.json`.

Provider compilation reports one of `native`, `compiled`, `inherited`, `global-only`, `informational`, or `unsupported`. An unsupported field is omitted rather than copied into an artifact that ignores it. See wrapper enforcement for the per-provider artifact contract.

Generated context always emits a compact delegation rubric from `agentic/code/addons/aiwg-utils/templates/context/delegation-rubric.md`, including projects without `.aiwg/aiwg.config`. `AIWG_HIDE_PARALLELISM_IN_CONTEXT=1` suppresses it. Regenerate migrates `AIWG-PARALLELISM-CAP` markers to `AIWG-DELEGATION` without duplicating the block. The AGENTS.md bridge mirrors the compact policy.

Configure prompt policy in project-root `models.json`, under `defaults.workerSelection` (builtin → user → project), not a top-level `delegation` block. `mode` is `advisory` until the topology measurement gate passes; `default` delegates bounded read-heavy, verbose, independent and verification work, and `off` keeps work local unless explicitly requested. The condensed return budget defaults to 2000 tokens (`returnBudgetTokens`), a policy value from the rubric renderer. The wrapper brief has its own default; see the orchestration guide.

For advisory guidance, set this in project-root `models.json`; change `mode` to `"off"` to keep work local unless delegation is explicitly requested:

{ "defaults": { "workerSelection": { "mode": "advisory", "returnBudgetTokens": 2000 } } }
Use AIWG to complete this documented outcome: Overview
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Project `config set/reset` rejects all model-owned defaults, including the new policy keys. Edit `models.json` through the existing reviewed worker policy proposal/apply path documented in the agent-owned config operation; remove an override to restore its inherited value. Reads through `config get the origins option` remain available.

The cheapest-capable guidance defaults to `cost-effective`, with premium as the guidance ceiling; legacy resolver omission retains configured ordering and adds no ceiling (#4407 compatibility). Set strategy and ceiling explicitly to enforce them. `balanced` retains configured order; `quality` ranks eligible pricing classes highest first. These are cost proxies, not measured quality claims. Use existing `roleGuidance` and `taskClasses` for tier floors and per-task role adjustments. A project can narrow a user ceiling; widening is rejected before writing. Premium still requires authorization, and flagship always requires user election; a flagship session never makes workers flagship.

Native router, Ralph and MC defaults share `resolveDelegationDefaults()` through the delegation resolver. `resolveModelTier()` loads builtin → user → project policy; synchronous `routeModelTier()` accepts the same merged `ConfigLoader` result. Without a loaded config it uses builtin role guidance (coding/standard) for supervised and unattended work. Explicit invocation tiers and ceilings remain supported. Strategy ranking keeps the existing eligible-worker semantics above. MC resolves workers before estimating spend. `SONNET_CACHE_USD` is a labelled standard-tier cache-cost estimate coefficient, not a model selector; estimates use each worker's resolved tier.

Bounded extraction uses `aiwg-model-explorer` / economy, implementation and routine review use `aiwg-model-coding-worker` / standard, oracle checks use `aiwg-model-verifier` / standard, and high-consequence reasoning uses `aiwg-model-reasoning-worker` / premium. Keep trivial lookups, coupled edits, serial dependencies and user back-and-forth local. See `subagent-scoping` Rule 4a for the brief contract, condensed return and central verification requirements. Provider notes distinguish native per-agent selection, global-only controls, pending Grok Build enforcement and unverified/unsupported surfaces; they are not live audits.

The versioned schemas are under `schemas/models/`. The compatibility input `max-quality` normalizes to canonical `flagship`.

Flagship election and the current ladder

`flagship > premium > standard > economy`; `max-quality` is a compatibility alias for `flagship`. Verified IDs (2026-10-27):

TierClaudeCodex
flagship`claude-fable-5-1``gpt-6-astra`
premium`claude-opus-5-5``gpt-6.1-sol`
standard`claude-sonnet-5-5``gpt-6.1-terra`
economy`claude-haiku-5-5``gpt-6-luna`

Flagship catalog entries carry `selection: user-elected` and steward labels them user-elected only. Routing `requestedTier: flagship` (runtime Tier 4) requires `election: user` or an exact `agentName` hit in `flagshipAllowlist`, supplied by the caller from explicit worker election/allowlist authority. Premium authorization, complexity, high impact and unattended operation grant no flagship election. Unelected requests cap at premium; compilation rejects unelected flagship bindings/overrides. Explicit worker bindings in project `models.json` and `aiwg.config` still win: this project's coding role stays on Sol.

Configuration File Location

Models are defined in `models.json` files with the following priority:

1. Project-level: `./models.json` (highest priority) 2. User-level: `~/.config/aiwg/models.json` 3. AIWG defaults: `agentic/code/frameworks/sdlc-complete/config/models.json`

Deployment merges AIWG defaults ← user ← project recursively: omitted provider tiers (`claude`, `factory`, `devin`), `shorthand` and `*_shorthand` entries inherit. Plain objects merge; a null, array, or scalar override of an inherited object is ignored with a warning naming the key and source file. Other explicit values replace lower-priority values. A project containing only `defaults.workerSelection` keeps shipped Claude pins. Setting `claude.coding.model` overrides that pin and retains other roles. `_source` lists applied layers in merge order; CLI flags still win.

Configuration File Format

Project and user files can contain partial overrides. Provider role mappings and canonical `defaults`, `tiers`, and agent overrides are validated by the model schemas. For worker policy use the orchestration reference and preserve unrelated provider mappings. Source agents use tier aliases and canonical role/tier fields; exact provider identifiers belong in approved configuration rather than portable agent definitions.

Model Roles

AIWG classifies both the legacy aliases and pinned or provider-qualified Claude-family identifiers consistently:

Canonical familyRoleRecognized examples
Opusreasoning`opus`, `claude-opus-5`, `anthropic/claude-opus-5`
Sonnetcoding`sonnet`, `claude-sonnet-5`, `anthropic/claude-sonnet-5`
Haikuefficiency`haiku`, `claude-haiku-4-5`, `anthropic/claude-haiku-4-5`

An explicit identifier outside a recognized family remains `unknown`. Role filters do not silently include it in the coding population, and provider transforms preserve it instead of rewriting it as a coding model. Omitted model metadata retains the legacy coding default during deployment.

Claude deployments compile bare aliases by default. A source agent that says `model: sonnet` deploys to `.claude/agents/` as `model: claude-sonnet-5-5` (the `claude.coding.model` tier in `models.json`; `opus` → `claude-opus-5-5`, `haiku` → `claude-haiku-5-5`). A bare alias would otherwise inherit the parent session's variant, and under a 1M-context parent every subagent dispatch then hits the usage-credit gate (#1442, #2563). Source frontmatter stays provider-neutral; already-pinned ids, `inherit`, and explicit `sonnet[1m]` / `opus[1m]` opt-ins are deployed unchanged, and the coding-model option / the reasoning-model option / the efficiency-model option overrides still win.

How AIWG applies model choices per harness

You set model choices once, in AIWG: the role ladder and `models.json` above, the `defaults.workerSelection` settings, and per-task overrides. AIWG then does the per-harness work:

  • Deploying wrappers. the agent-owned use operation compiles each worker wrapper (efficiency, coding, reasoning, verifier, explorer) into the harness's own agent format, and pins the model and effort wherever that harness can enforce a per-agent choice.
  • Resolving a worker. the agent-owned models operation picks the model for a role and task from the catalog and your policy, and renders the exact launch command for the harness, so you never assemble harness flags yourself.
  • Reporting enforcement. the agent-owned doctor operation states, per harness and wrapper, whether the model and effort are `pinned`, `inherited`, `global-only` (one model for every worker in a run) or `unsupported`, and warns when a wrapper would land on a flagship or premium model you did not elect.

Harnesses differ in what they can enforce, so when the agent-owned doctor operation reports `global-only` or `inherited`, follow the remediation it prints for that harness rather than editing harness settings by hand. AIWG never rewrites a harness's global settings for you.

ProviderPer-worker supportNative model setting
Claude CodePinned agents and skillsAgent/skill frontmatter `model`; agent invocation `model` overrides frontmatter, then `CLAUDE_CODE_SUBAGENT_MODEL`, then the parent session. `CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1` overrides agent pins. Use AIWG wrappers or an explicit invocation model instead of unpinned `general-purpose`.
CodexPinned custom agents; skills inherit`.codex/agents/*.toml`: `model` and `model_reasoning_effort`; omission inherits. Unknown explicit model IDs are preserved rather than reclassified as coding.
AntigravityGlobal-only; per-skill model controls unsupportedSession `agy the model option`; deployed wrapper mirrors do not select a session model or effort.
HermesGlobal-only; per-worker tier not enforceable`~/.hermes/config.yaml` (or `$HERMES_HOME/config.yaml`): `delegation.model` / `delegation.effort`. Select one cost-effective standard model supported by the configured backend; the catalog has no concrete standard binding.
MuseGlobal-only; per-worker tier not enforceableSession the model option / the reasoning-effort option; `$XDG_CONFIG_HOME/muse/settings.json` (default `~/.config/muse/settings.json`): `model` fallback. Per-agent pins are unverified.
WarpRun/profile selection; per-worker tier not enforceable`warp agent run the model option <MODEL_ID>`; effort unavailable. Select one cost-effective standard model available to that run; `profile-selected` is not a concrete model.
GrokbotGlobal-only; per-worker tier not enforceableNo verified native delegation-model setting or concrete standard binding in the bundled catalog; AIWG reports this gap rather than supplying a setting name.
Windsurf / Devin DesktopInherited; per-worker tier not enforceableNo supported portable native model field; the UI session selects the model.
Grok BuildDegraded: agent frontmatter is ignoredWorker CLI the m option selects the session model; see the deferred agent-translation acceptance item in #2577.

the agent-owned doctor operation reports offline model diagnostics in `checks`. Its `delegation.flagship-inheritance` check scans deployed agents, wrappers, and both kernel and indexed skills. It warns on unelected flagship resolutions and missing/unresolved effective models where native per-artifact model controls exist, since an unrecorded parent session may be flagship. Providers with only global/session controls or unsupported artifact controls report their support class instead of speculative per-artifact warnings when the session model is unknown. A resolved unelected flagship still warns; a recorded safe fallback clears that inheritance risk. `commandHint.modelTier` expresses dispatch intent and is not itself a native skill model pin. Claude's subagent fallback does not select an inline skill's model. Existing operator `models.json` overrides exempt only matching resolved models; the shared `flagshipAllowlist` API exempts exact agent, wrapper, and skill names, never globs. This audit observes files, not live subagent model resolution. It never sets `CLAUDE_CODE_SUBAGENT_MODEL`; any optional fallback configuration must use `update-config` with operator consent.

Follow-up for #2577: agent model translation must either produce a verified native per-agent selector or report degraded inheritance explicitly, with an offline translator regression. This documentation does not update the tracker.

For Muse, an explicit `model` in `$XDG_CONFIG_HOME/muse/settings.json` (default `~/.config/muse/settings.json`) counts as an election when it matches the catalog's sole model across all roles and the catalog has no tier ladder. This clears the premium-inheritance warning for `muse-spark-1.3` without changing Claude or Codex wrapper pins. Flagship models still require an election. the agent-owned models operation prints the concrete catalog model even in a kernel-only workspace. Muse has no native agent-scoped model control, so resolution reports that surface as `unsupported`; select the model through the Muse session settings or the model option.

Model management CLI

Use the typed the agent-owned models operation command family to inspect effective policy before changing canonical files:

Use AIWG to complete this documented outcome: Use the typed the agent-owned models operation command family to inspect effective policy before changing canonical files
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Selectors support exact agents/skills, globs, role, current tier, framework, provider compilation, and the all option. Project configuration resolves under `the target option/models.json`; user defaults resolve under `~/.config/aiwg/models.json`. Writes use same-directory temporary files and atomic rename, preserve unrelated JSON or frontmatter content, and validate the full requested change set before writing.

Skill policy lives under `commandHint` as `modelRole`, `modelTier`, and optional `modelEffort`; premium policy also requires `modelRationale`. During migration, legacy `commandHint.model` remains readable: `opus` maps to reasoning/premium, `sonnet` to coding/standard, and `haiku` to efficiency/economy. Claude deployment compiles requested skill intent to its native turn-scoped fields. Other providers retain canonical intent but only report the capability outcome; they do not receive a fabricated native pin.

Canonical agents use `model-role`, `model-tier`, and, for premium defaults, `model-rationale`. Economy is the corpus default. Premium is an allowlisted exception whose rationale names the quality or risk reason. The compatibility `model` aliases remain for one migration window and must not contain pinned provider IDs.

Reasoning (opus)

Use for: Complex analysis, critical decisions, strategic planning

Agents using this role:

  • architecture-designer
  • requirements-analyst
  • security-architect
  • executive-orchestrator
  • system-analyst

Coding (sonnet)

Use for: Code generation, implementation, debugging, code review

Agents using this role:

  • software-implementer
  • code-reviewer
  • devops-engineer
  • test-engineer
  • debugger

Efficiency (haiku)

Use for: Quick tasks, file operations, simple edits, summaries

Agents using this role:

  • documentation-synthesizer
  • technical-writer
  • configuration-manager

User and project customization

“Make this project's coding role use my approved model, preserve the other

roles, and show the proposed change before applying it.”

Use project-root `models.json` for team policy and `~/.config/aiwg/models.json` for user preferences. Omitted provider roles inherit; change only the required role. Review model-owned worker selection changes through the existing proposal/apply path in the CLI reference. Role and effort floors, user ceilings, and flagship election still apply.

The orchestration guide contains a policy fragment and explains per-task overrides through `roleGuidance`, `taskClasses`, and explicit invocation intent.

Command-Line Overrides

You can override models on the command line (takes precedence over config files):

Use AIWG to complete this documented outcome: You can override models on the command line (takes precedence over config files)
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Selective Deployment with Filters

Apply model changes to specific agents using filters:

Use AIWG to complete this documented outcome: Apply model changes to specific agents using filters
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Persisting Model Selection

Save your model choices for future deployments:

Use AIWG to complete this documented outcome: Save your model choices for future deployments
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Preview Changes

Use the dry-run option to see what would be deployed without making changes:

Use AIWG to complete this documented outcome: Use the dry-run option to see what would be deployed without making changes
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Precedence Order

When deploying agents, models are determined in this order (highest to lowest priority):

1. Command-line flags (the reasoning-model option, the coding-model option, the efficiency-model option) 2. Project `models.json` (in current directory) 3. User `~/.config/aiwg/models.json` 4. AIWG defaults (`agentic/code/frameworks/sdlc-complete/config/models.json`) 5. Bundled model catalog (if shipped defaults are unavailable)

Verifying Configuration

To see which model configuration is being used:

Use AIWG to complete this documented outcome: To see which model configuration is being used
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

The source lists the merged configuration files in application order:

  • `project (./models.json)`
  • `user (~/.config/aiwg/models.json)`
  • `AIWG defaults (...)`

Updating Models

Updating AIWG Defaults

To update the default models for all users:

1. Edit `agentic/code/frameworks/sdlc-complete/config/models.json` 2. Update model identifiers 3. Commit and push changes 4. Users run the agent-owned -update operation to get latest defaults

Updating Project Models

Use AIWG to complete this documented outcome: Updating Project Models
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Updating User Models

Use AIWG to complete this documented outcome: Updating User Models
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Troubleshooting

Config File Not Loaded

Symptom: Models.json exists but isn't being used

Solution: 1. Check file format (must be valid JSON) 2. Verify file location (use absolute paths to debug) 3. Check permissions (file must be readable)

Validation:

# Check JSON syntax
jq . models.json

# If error, fix JSON formatting

Wrong Models Being Used

Symptom: Different models deployed than expected

Solution: 1. Check precedence order (command-line > project > user > defaults) 2. Verify model configuration with the dry-run option:

Use AIWG to complete this documented outcome: Solution: 1. Check precedence order (command-line project user defaults) 2. Verify model configuration with the dry-run option
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Model Not Available

Symptom: Deployment fails with "model not found"

Solution: 1. Verify model identifier is correct for your platform 2. Check API access/permissions 3. Use a known working model for testing

Best Practices

1. Use project-level configs for production - Check into version control 2. Use user-level configs for development - Personal preferences 3. Document model choices - Add comments in `_comments` section 4. Test model changes - Use the dry-run option before deploying 5. Version model configs - Tag when changing models significantly

Schema Validation

The configuration file includes a JSON schema reference for validation. To validate:

# Using ajv-cli
npm install -g ajv-cli
ajv validate -s models.schema.json -d models.json

# Using jq (basic check)
jq empty models.json && echo "Valid JSON" || echo "Invalid JSON"

Supported harnesses

AIWG deploys to every harness in the provider inventory, which lists each one's status and deployment scope and links its quickstart. What each harness can enforce for models and effort is reported live by the agent-owned doctor operation; the per-harness matrix is in Wrapper tier enforcement.

See Also