Fine-grained model control: skill routing, budget fallbacks, and dedicated dedupe/verification models#795
Draft
kusonooyasumi wants to merge 4 commits into
Draft
Conversation
Deduplication is a cheap, structured classification task that previously always ran on the orchestrator model. Add STRIX_DEDUPE_MODEL (with optional DEDUPE_LLM_API_KEY and STRIX_DEDUPE_REASONING_EFFORT) so it can be routed to a smaller/cheaper model, mirroring the finding-verification model pattern. Falls back to the orchestrator model when unset. The dedupe model is added to startup warm-up and its usage still counts toward --max-budget-usd.
Merge test_model_routing, test_budget_fallbacks, test_finding_verification, and test_dedupe_model into a single test_model_control module grouped by feature area. Also add the runtime.max_context_images field to the runner prompt test's settings mock so it works with the current runner.
kusonooyasumi
force-pushed
the
feat/model-routing-budget-dedupe
branch
from
July 17, 2026 03:55
dba242f to
56f370e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds fine-grained, per-task model control so operators can route different work to different models instead of running everything on one model.
Skill-based routing + expanded model config
llm.skill_model_routesselects a child model from its injected skills —skillshorthand for a single skill, oroperator(AND/OR/ANY) +skillsfor sets, with optional per-routereasoning_effort. Rules evaluate in config order (first match wins); an explicitmodel=fromcreate_agentshort-circuits routing.STRIX_ORCHESTRATOR_MODEL(alias forSTRIX_LLM),STRIX_SUBAGENT_MODEL,STRIX_SUBAGENT_REASONING_EFFORT,SUBAGENT_LLM_API_KEY.RunConfig.model/model_settingsset toNone) so per-agent routes are respected instead of being overridden by the run default. Resolved models are persisted per child so resume reuses the exact model each child had.Independent finding verification
STRIX_VERIFY_FINDINGS+STRIX_VERIFICATION_MODEL(+VERIFICATION_LLM_API_KEY,STRIX_VERIFICATION_REASONING_EFFORT) run an adversarial refutation pass on every candidate before it is persisted. Fail-closed: malformed responses and provider errors never let an unconfirmed finding through.Per-model budget fallback chains
model_budgets_usd+model_fallbackslet a model fall back to a cheaper alternative once its spend cap is reached, with cycle and validation checks on the fallback graph.Dedicated deduplication model
STRIX_DEDUPE_MODEL(+DEDUPE_LLM_API_KEY,STRIX_DEDUPE_REASONING_EFFORT) routes the dedupe classification call off the orchestrator model. Deduplication is a cheap, structured classification task that previously always ran on the (expensive) orchestrator model. Falls back to the orchestrator model when unset.--max-budget-usd.All non-agent LLM calls (verification, dedupe) are recorded in the same
llm_usageledger and count toward the budget, alongside root and child calls.Test plan
pytest— full suite passes, including newtests/test_dedupe_model.py,tests/test_model_routing.py,tests/test_budget_fallbacks.py, andtests/test_finding_verification.py.ruff checkclean;mypyclean on changed modules.Notes
STRIX_LLMis preserved as a back-compat alias forSTRIX_ORCHESTRATOR_MODEL, so existing configs keep working.