Apollo

Created by team Trafalgar on July 07, 2026
Hybrid Token-Efficient Routing Agent

Token-Efficient Routing Agent - AMD Developer Hackathon ACT II, Track 1. Completes all 8 required task categories (factual knowledge, math, sentiment, summarization, NER, code debugging, logical reasoning, code generation) while minimizing Fireworks AI token spend without sacrificing accuracy. Every routing decision - task category, difficulty, which model answers it - is made by plain rule-based code before any API call. Zero cost, zero latency, nothing hardcoded: models are read fresh from ALLOWED_MODELS every time. Routing is category- and difficulty-aware, not just cheapest-overall: - Code tasks go to a code-specialized model, scaling from cheapest to strongest with difficulty. - Hard math/logic (difficulty >= 0.7) escalates to the most capable model rather than risk the 80% accuracy gate to save tokens. - Everything else - including easy math/logic - prefers the cheapest reachable Gemma model, else a difficulty-proportional pick. Every Fireworks call passes reasoning_effort: "none", suppressing hidden "thinking" tokens some models emit even for trivial tasks - measured to cut one sentiment call from 36 to 2 completion tokens, same correct answer. Each task gets a shared 26-second budget across up to three attempts (selected model, same-model retry, cross-model fallback), with an asymmetric retry policy: fast failures retry immediately, slow failures skip to a different model, so retries can't exceed the 30-second per-request limit. A local-model variant was prototyped for zero-token answers, then deliberately removed after testing showed inconsistent performance under simulated constrained resources - favoring a smaller (195MB), fully-verified submission over an unproven gain this close to the deadline. Verified against hand-written samples, 24 paraphrased variants, and the official practice tasks from the participant guide, run against the actual image pulled fresh from the public registry under the documented 4GB RAM / 2 vCPU grading constraints.

Category tags: