One matrix routes every agent
Instead of hardcoding a provider and model, an agent declares a semantic role like coding or fast. A curated per-provider matrix resolves that role to a concrete model.
The catch: every agent still has to land on the right model. So is this real?
The routing-matrix bundle ships as amplifier-module-hooks-routing v0.1.1 with a green suite — and eight curated matrices ready to switch between.
It works today. So why not just hardcode the model names?
The curator guide flags fake names like claude-opus-4.6-fast ("Not a real model"). And a broad claude-* glob crosses class boundaries.
Opus and Haiku both match claude-* — a premium role silently swaps to budget.
Agents declare a single semantic role. The balanced matrix defines 13 roles; every matrix must include the required general and fast roles or loading fails.
One indirection layer sits between agents and models. Now, how does it go live?
The routing-resolve hook (priority 5) reads each agent's model_role, resolves it, and patches provider_preferences — every agent resolved in parallel via asyncio.gather.
Update one matrix row and every agent using that role benefits. But does it go stale?
Version-aware glob sorting strips date suffixes and natural-sorts so the highest clean version wins within a class. Copilot candidates stay pinned — its list_models() has no static fallback.
copilot.yaml notes it "avoids the 30x claude-opus-fast trap. Uses Haiku (0.33x)."
One command switches every agent's routing. And v2 (b559b10, 2026-07-16) added a keyword-only limit=N that draws an N-diverse reviewer pool, deduped on (provider, resolved_model).
Default stays limit=1 first-match; limit>1 opens the diverse pool. So what's the pattern?
In amplifier-foundation, 16 of 16 agent definition files already declare a model_role. Semantic roles are the durable interface to a shifting model landscape.
Status: Shipping — v0.1.1
Data as of: 2026-07-16 (latest commit b559b10)
Primary source: ramparte/amplifier-bundle-routing-matrix (upstream microsoft/amplifier-bundle-routing-matrix); agent counts from amplifier-foundation.
Commands run:
git log --oneline | wc -l — 53 commits (0741a1d 2026-02-28 → b559b10 2026-07-16)pytest tests/ -q — 270 passed in 0.46s across 7 test filesls routing/*.yaml — 8 matrices (anthropic, balanced, copilot, economy, gemini, ollama, openai, quality)python3 -c "yaml.safe_load('routing/balanced.yaml')['roles']" — 13 roles; ollama 12 (missing image-gen)grep -n 'required_role' matrix_loader.py — 'general' and 'fast' required (lines 110-113)grep -n 'limit' resolver.py — default limit=1 (l.176); break-on-limit (l.268); dedupe (l.254)grep -n 'routing-resolve...asyncio.gather' __init__.py — hook priority 5, parallel resolution (l.165, 178, 189, 236-239)ls agents/*.md; grep -l 'model_role:' agents/*.md — 16 of 16 declare model_role (amplifier-foundation)Gaps: Cost multipliers 30x and 0.33x are quoted from copilot.yaml/README documentation, not independently benchmarked. No source found for any "66 agents" figure — omitted.
Primary contributors: Brian Krabach (38 commits); v2 limit=N commit authored by Sam Schillace (1).