TokenRouter is a token-efficient hybrid routing agent built for AMD Developer Hackathon Track 1, where submissions are ranked by the fewest total Fireworks tokens above an accuracy gate. Its strategy: answer as much as possible for free, and pay the API only for what genuinely needs it. Every task falls through a four-layer ladder. A zero-cost regex classifier assigns one of eight categories; deterministic Python solvers settle logic puzzles and arithmetic with certainty; a bundled Gemma-4-E2B GGUF (llama.cpp, CPU-only) answers math, sentiment, NER, and summarization entirely inside the container at zero scored tokens; only factual, code, and logic escalate to Fireworks — with terse prompts, tight token caps, runtime-inferred model tiers, and same-category batching so a system prompt is paid once, not per task. The local model was chosen by benchmarking 16 small models for the 4 GB / 2 vCPU judging box, where Gemma-4-E2B proved Pareto-optimal: fast enough to finish locally, accurate enough to pass. A bounded local-time budget sheds overflow work to the API so the container never times out, and skeleton-first output with incremental flushing guarantees a valid results.json no matter what. Latest scored run: 100% accuracy.
Category tags: