TokenRouter: cheapest model that gets it right

Created by team Saberites on July 06, 2026
Hybrid Token-Efficient Routing Agent

TokenRouter answers all eight task categories from the Track 1 spec while spending as few Fireworks tokens as it can get away with. The routing costs nothing. A set of regex rules classifies each task locally (sentiment, NER, summarization, factual knowledge, math, logic, code debugging, code generation), so no classification call ever reaches the judging proxy. Easy categories go to the smallest allowed model, code generation to the middle one, and math, logic, and debugging to the strongest, because failing the accuracy gate is worse than spending a few hundred extra tokens. Model IDs are never hardcoded. At startup the agent reads ALLOWED_MODELS, ranks the names by size hints and known model families, and assigns tiers. If the variable is missing, it refuses to run rather than guess. Each category has a hard output budget, from 90 tokens for sentiment up to 550 for code debugging, with extra headroom when the assigned model is a reasoning model so thinking does not eat the answer. Answers are scrubbed of inline think blocks before being written. Gemma gets its instruction folded into the user turn because some Gemma endpoints reject system messages. If a model fails twice, the task is retried once on another allowed model instead of scoring an empty string. In live testing the agent answered 8/8 sample tasks correctly, and tightening the output instructions cut completion tokens by roughly 60% without losing a single answer.

Category tags: