ZeroToken_Router_[H][I]

Created by team Team Shaheen on July 09, 2026
Hybrid Token-Efficient Routing Agent

The Challenge: Track 1 demanded an agent that could clear a strict 80% accuracy gate across 8 complex categories while burning the absolute minimum number of Fireworks API tokens. The catch? The agent had to run in a heavily restricted AMD environment (4GB RAM, 2 vCPUs, no GPU) with a strict 10-minute timeout. Our Solution & Architecture: We built a battle-tested, 3-tier hybrid routing architecture designed to squeeze maximum performance out of the constrained hardware while weaponizing the scoring formula. 1. Smart Categorization: The agent intercepts prompts and uses regex-based heuristics to instantly classify tasks (Math, Code, NER, Sentiment, etc.), applying category-specific token limits to prevent context overflow. 2. The Zero-Cost Local Engine: To minimize API costs, simple tasks (like factual QA and Sentiment) are aggressively shunted to a local Qwen2.5-3B-Instruct 4-bit GGUF model running on CPU. Because local tokens aren't penalized by the judging proxy, this handles the bulk of the workload for exactly 0 tokens. To prevent the 2 vCPUs from hanging, local inference is guarded by strict asyncio timeouts and thread-locking. 3. Dynamic Fireworks Fallback: When the local model detects a highly complex problem (like advanced Code or Logic), or if it hits a timeout, the router seamlessly fails over to the Fireworks API. It dynamically parses the ALLOWED_MODELS environment variable and routes the prompt to the most cost-efficient capable model. Our Results: By intelligently offloading easy tasks to a local engine and saving the API strictly for heavy lifting, we achieved an incredible ~100% accuracy rate during testing while radically dropping API token consumption well below the leaderboard averages. We proved that production-grade LLM routing can be fast, mathematically accurate, and remarkably cost-efficient on standard CPU hardware

Category tags: