Repository navigation
feat(queen): route bees to the best-measured worker model - #496
Merged
Merged
Conversation
At ten lanes nemotron-3-super-120b answered 1,369 requests in twenty minutes with 429/503; every one of ten keys drew 503s, so the model was overloaded, not the keys. Five of seven fallback models the same afternoon answered 410 or 404 - a fixed fallback list goes stale unnoticed. lib/model-ranking.ts scores each candidate by expected seconds per 500-token step, (500 / tokens per second) / success rate, from probes every five minutes (speed, tool calling, 404/410) and every live answer the retry wrapper sees. The retry wrapper rewrites the request's model to the ranked best, per attempt. A model is chosen only after it has called a tool; a challenger must be 20% cheaper to take over. /queen/status shows the ranking. Off unless TRIOS_QUEEN_WORKER_MODEL_CANDIDATES is set. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
❌ Tests failed — 11/2436 failed
Failed tests
|
dmitrii-f-t27
pushed a commit
to dmitrii-f-t27/BrowserOS
that referenced
this pull request
Oct 10, 2026
feat(queen): route bees to the best-measured worker model
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.
Why
At 10 lanes
nemotron-3-super-120banswered 1,369 requests in 20 minutes with 429/503 and bees finished 4 turns. Probing all 10 keys showed 503s spread across every key: the model is overloaded, not our keys. Five of seven would-be fallback models answered 410/404 the same afternoon.What
lib/model-ranking.ts: per-candidate score = expected seconds per 500-token step =(500 / tok/s) / successRate. Inputs: probes every 5 min (speed, tool calling, 404/410) and every live answer. Only models that called a tool are eligible; a challenger must be 20% cheaper (no flapping); gone models re-probed after an hour.overload-retry-fetch.ts:routeModelrewrites the request model per attempt;onOutcomefeeds the ranking./queen/statusgainsmodels.chosen+models.ranking.TRIOS_QUEEN_WORKER_MODEL_CANDIDATESis set.Tests
bun test src/lib/model-ranking.test.ts src/lib/overload-retry-fetch.test.ts24 pass; dispatch/tick/status/round suites 140 pass;tsc --noEmitclean.🤖 Generated with Claude Code