Repository navigation
feat: auto model routing from SynthBench routing.json (--model auto) - #597
Merged
Merged
Conversation
Add `--model auto` (CLI), `model="auto"` (MCP run_panel / run_quick_poll) and `run_panel(model="auto")` (SDK). All three call althing.model_routing.route_models, which: - infers the slice (us-general / us-subgroups / cross-national) from --population and the persona pack, unless --use-case / use_case is given; - infers the topic by whole-word keyword match against the routing.json taxonomy, taking a topic only when more than half the questions match it, unless --topic / topic is given; - uses the route's best_althing system, falling back to the slice's all-topics route and then the default model when a route is not confident; - maps model ids to openrouter/<model_id> (or a direct alias when the provider key is set), drops members that cannot run, renormalizes, and collapses a one-member blend to a single model. Blends run as a weighted per-persona split (shared largest-remainder split, moved to althing.model_split). The CLI prints the decision to stderr and records it in metadata.model_routing; MCP returns it as model_routing. Also: - synthbench.load_routing: routing.json client with its own cache, URL override (ALTHING_SYNTHBENCH_ROUTING_URL) and bundled snapshot, sharing the leaderboard fetch/ETag/offline machinery. - recommend() is blend-aware (members + model_spec()), skips baseline rows, and maps model_id through openrouter/ instead of stamping a bare id. - Bundle a routing snapshot from a local SynthBench build and refresh the leaderboard snapshot from the live leaderboard, trimmed. - Docs: new docs/model-routing.md; fix the weighted-split description, --blend examples on multi-round instruments, the MCP blend/convergence claims, a nonexistent --topic example, and April-era model claims. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route that is not confident has a best system that is close to the runner-up, not a poor one. Falling back to the surface default (Sonnet on the CLI, Haiku on MCP) picked a model SynthBench ranks well below the slice's top Althing-conditioned system, or never measured. The chain is now: confident topic route, confident all-topics route, the all-topics route's top system with confident=false (fallback="slice-top"), and the default model only when the slice has no routes or nothing can run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying synthpanel with
|
| Latest commit: |
9e1581a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c5d09ded.synthpanel.pages.dev |
| Branch Preview URL: | https://feat-auto-model-routing.synthpanel.pages.dev |
Collaborator
Author
|
Changed the fallback chain in 9e1581a. When neither the topic route nor the all-topics route has a clear lead, auto now uses the all-topics route's top Althing-conditioned system with |
the-data-viking
added a commit
that referenced
this pull request
Oct 14, 2026
) actions/checkout persists GITHUB_TOKEN as an http extraheader, and git sends that header instead of the x-access-token credentials in the push URL. The bump commit therefore went out as github-actions[bot], which is not a ruleset bypass actor, and main rejected it with GH013 (v1.9.0 after #597). The ruleset itself is right: Integration 3967952 is a bypass actor. Reset the header for the bump push only; the tag push keeps GITHUB_TOKEN so it still does not trigger publish.yml. Co-authored-by: the-data-viking <wesley@thedataviking.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
Step 1 of the SynthBench → Althing routing contract (v1): Althing reads SynthBench's
routing.jsonand picks a model or weighted blend for a panel.--model autoonpanel run,model="auto"on MCPrun_panel/run_quick_poll, andrun_panel(model="auto")in the SDK. All three callalthing.model_routing.route_models.--use-case, else--population(non-US country →cross-national; US demographic attributes →us-subgroups) and the persona pack (global-respondents→cross-national), elseus-general.--topic, else whole-word keyword match of the question text against the routing.json taxonomy; a topic is used only when more than half the questions match it, otherwiseall.best_althing. Not confident → the slice'sallroute → the default model. Model ids run asopenrouter/<model_id>, or a direct alias when Althing has one and the provider key is set. Members that cannot run are dropped and the blend is renormalized; a one-member blend becomes a single model; at most 4 members.althing.model_splitso CLI, MCP and SDK share it). This works on multi-round instruments.--blendwith a routed blend uses the blend path on single-round instruments.metadata.model_routing. MCP returnsmodel_routing(also inmetadata). SDK:panel.metadata["model_routing"].synthbench.load_routing(): same fetch / 24h cache / ETag / offline / bundled-snapshot machinery as the leaderboard, with its own cache file andALTHING_SYNTHBENCH_ROUTING_URL.recommend(): ensemble rows producememberswith weights andmodel_spec(). Baseline rows are skipped.--best-model-forkeeps working (first runnable member of a blend) and its help points at--model auto.Snapshots
data/synthbench-routing-snapshot.json: copied from a local SynthBench build of the routing builder (routing-local.json, generated 2026-10-14), sincehttps://synthbench.org/data/routing.jsonis not published yet. Replace it with the published file on the next refresh.data/synthbench-snapshot.json: refreshed from the live leaderboard (2026-10-14), baselines andtopic_metricsremoved, one entry per line.Behavior change
--best-model-forused to stamp bare upstream ids likegoogle/gemini-2.5-flash-liteonto--model, which no provider accepts. It now usesopenrouter/google/gemini-2.5-flash-lite. Two existing tests were updated for this.Docs
docs/model-routing.md.ensemble.mdand the--modelshelp now describe the split as largest remainder with at least one persona per model.model-packs.md/task-recommendations.mdno longer pair--blend(or--max-cost) with multi-round instruments, and no longer claim MCP returns ablendblock or aconvergencescore.synthbench-integration.mdno longer shows a--topicexample.Test plan
tests/test_model_routing.py(60 tests): slice and topic inference, word-boundary matching, the confident fallback chain, ensemble → members, dropping and renormalizing members, max members, the routing client (live/cache/offline/404/bundled), snapshot shape, CLI--model autowith a fake runner (metadata recorded, split applied, invalid combinations), MCPmodel="auto"forrun_panelandrun_quick_poll, SDK.origin/main, 62 more passing tests.ruff check,ruff format --check,mypy --platform linux src/althing/.🤖 Generated with Claude Code