We built a highly competitive, multi-tier routing agent designed to perfectly balance high accuracy with minimal API costs. Our architecture categorizes incoming tasks in under 1ms based on complexity features like math, logic, and code generation. Easy tasks (like sentiment analysis, NER, and summarization) are immediately handled by a highly optimized baseline tier that operates at near-zero token cost. Only the most difficult tasks escalate to the premium Fireworks API, where a dynamic selection of allowed models (starting with the smallest first) ensures we never waste tokens on unnecessarily large LLMs. To guarantee a passing score, we built a strict 'Verifier Safety Net' that continuously validates outputs. If an answer fails structural validation, the task is instantly retried with a stronger premium model. We also engineered a Time-Limit evasion system that ensures the container respects the strict 10-minute timeout limit without crashing.
Category tags: