TokenSaver, Track 1

replit
application badge
Created by team TARDIS on July 07, 2026
Hybrid Token-Efficient Routing Agent

TokenSaver is a hybrid token-efficient routing agent built for AMD Hackathon Track 1. Since only inference routed through Fireworks AI is scored, the winning move isn't a bigger model — it's not calling one. TokenSaver stacks several free layers in front of the scored remote call. Every task first passes through a pre-flight optimizer that strips filler and normalizes the prompt, then a semantic cache that serves near-duplicate queries from memory at zero cost. A classifier scores difficulty, and a regex Intrusion Detection System catches heavy-compute signatures — SQL, code, proofs, dense math — that the classifier alone would under-call. The key layer is a deterministic executor: math is solved with sympy and code is generated then actually executed against checks, so those tasks are guaranteed correct at zero Fireworks tokens. Easy factual questions are answered by a free local Qwen2.5 model, gated by a self-consistency check that escalates rather than trusting a confidently-wrong answer. Only genuinely hard tasks reach the paid remote tier, and bidirectional failover means a dead model degrades gracefully instead of crashing the request. It ships as a container that reads /input/tasks.json, routes each task, and writes /output/results.json — grader-ready. Backed by 104 passing tests.

Category tags: