
Token Router is built on one simple rule: never pay for tokens that a cheaper solver can earn for free. Every task flows down a four-step ladder, cheapest first. Pure arithmetic gets parsed and solved exactly by deterministic Python, costing zero tokens. Sentiment, NER, factual Q&A, summarization and math word problems run on a Qwen2.5-3B model on CPU inside the container via llama.cpp, still zero Fireworks tokens. Only the genuinely hard work escalates: logic puzzles and low-confidence local answers go to minimax-m3, while code generation and debugging go to kimi-k2p7-code, both at temperature 0 with tight token caps. Accuracy is protected by design, not hope. The math solver only fires on pure arithmetic prompts, never on word problems that just happen to contain numbers. The reasoning budget for minimax-m3 is sized so answers never come back empty. If Fireworks fails for any reason, the agent falls back to its local answer, so no single task can sink the run. Nothing is cached or hardcoded, every task is solved live. The results back it up: 9 out of 9 sample tasks correct with only 596 Fireworks tokens, 6 of them solved completely free. The full container run scored 6 out of 6 in 30 seconds end to end on CPU alone. The image is linux/amd64, 5.08 GB against the 10 GB cap, publicly pullable, and all secrets come in through runtime env vars with nothing baked into the image.
13 Jul 2026