.png&w=828&q=75)
AMD Developer Hackathon — Cost-Minimizing AI Routing Agent An intelligent task router that minimizes API costs by classifying each task and routing it to the cheapest model capable of handling it. The system uses a 4-tier strategy: - Tier 0 (Local): Qwen2.5-1.5B GGUF model — zero token cost. Handles simple tasks like sentiment analysis, NER, factual recall, and short summaries. - Tier 1 (Cheapest Fireworks): For simple reasoning, basic code, and straightforward questions. - Tier 2 (Mid-range Fireworks): Math, code debugging, logic puzzles, and moderate complexity tasks. - Tier 3 (Best Fireworks): Complex multi-step reasoning, detailed explanations, and high-complexity tasks. How it works: 1. Classification: Each task is classified using the cheapest available model (agentic classification, ~80 tokens) with automatic fallback to keyword-based classification (zero tokens) if the LLM call fails. 2. Model selection: Based on category and complexity score (1–5), the router picks the cheapest adequate model. Simple factual questions go to the local model; complex math problems escalate to a capable Fireworks model. 3. Fallback chain: If the selected model returns a low-quality answer (refusal, empty, or too short), the system automatically escalates through progressively more capable models until a satisfactory answer is produced. 4. Output styling: Low-complexity tasks use concise "ponytail/caveman" output styles to avoid verbose markdown, while complex tasks retain full explanatory output.
13 Jul 2026