HydraRoute is a token-efficient routing agent for the AMD Developer Hackathon ACT II Track 1 that radically minimizes API token consumption while maximizing accuracy. The core insight: most tasks don't need an LLM at all. Architecture: • Tier 0 — 11 local Python solvers (arithmetic, SymPy equations, percentages, date math, string ops, unit conversion, regex extraction, factual lookup, number conversion, word analysis, sentiment classification). These 11 modules solve ~93% of all tasks at ZERO token cost with 100% deterministic accuracy. • Tier Local (optional) — Qwen2.5-1.5B GGUF model bundled via llama.cpp for zero-token local inference on simple NER and sentiment tasks. • Tier 1 — Gemma 4 26B MoE for language tasks (NER, factual knowledge, summarization). Only 3.8B active parameters for fast, efficient inference. • Tier 2 — Gemma 4 31B for complex reasoning and code generation/ debugging with self-consistency voting (3 parallel calls with majority consensus). Our key innovations: • SymPy-LLM Symbiosis: LLM only generates equation strings from word problems — SymPy solves them locally with 100% accuracy, zero hallucination risk. • Session Dedup: Tasks sharing >80 character context are batched into a single API call. • Relevance Compression: TF-IDF sentence scoring keeps top 60% of content (disabled for reasoning/math to preserve logical structure). • RTK Stack Trace Compression: Truncates tracebacks to 10 lines for code debugging. • FrugalGPT Cascade + YES/NO Judge: Self-validates Tier 1 output before acceptance, auto-escalates to Tier 2 on failure. • Temperature Scaling + Prompt Mutation: Different temperature and prompt phrasing on same-model retry for increased robustness. • Prompt caching: Common prefix "HydraRoute |<category> |" for Fireworks/OpenRouter cache hits. Benchmark: 67 tasks across all 8 categories → 97% official / 100% real accuracy, avg 3.4s per task.
Category tags: