This project implements a Hybrid Token-Efficient Routing Agent that autonomously decides which Fireworks AI model is the cheapest one capable of answering each task accurately. Rather than routing every task to a single powerful model, the agent classifies each incoming prompt by difficulty — easy, medium, or hard — using keyword detection and routes it to the appropriate model tier. Easy tasks are handled by a lightweight cheap model, while medium and hard tasks escalate to a stronger model. If the cheap model produces an invalid or insufficient output, the agent automatically escalates and retries. This approach minimizes total Fireworks token consumption while maintaining 100% accuracy across all tasks, directly optimizing for the hackathon scoring criteria of lowest tokens with highest accuracy.
Category tags: