This project implements an intelligent, cost-aware task-routing system that dispatches a diverse set of natural language prompts to multiple large language models (LLMs) hosted on Fireworks AI's inference platform. The system is designed to process eight distinct evaluation categories — including text summarization, sentiment analysis, mathematical reasoning, factual knowledge queries, named entity recognition (NER), code generation, code debugging, and logical/deductive reasoning puzzles — each routed to the most cost-effective model capable of handling it well. At its core, the system uses a **zero-token routing heuristic** ([route_task](cci:1://file:///home/palash/AMD_Track1/main.py:131:0-200:31)) that performs pure keyword-based classification on each incoming prompt without consuming any LLM tokens. This classifier maps prompts to one of three model tiers — **cheap**, **mid**, and **expensive** — based on the task's complexity profile. For example, sentiment and summarization tasks are routed to cheaper, smaller models, while code generation and logic puzzles are directed to larger, more capable (and more expensive) models. Mathematical reasoning and factual queries land in the mid-tier. The **model tiering logic** ([assign_model_tiers](cci:1://file:///home/palash/AMD_Track1/main.py:38:0-101:16)) dynamically scores and ranks all models provided via the `ALLOWED_MODELS` environment variable, using heuristics based on model family names (e.g., code-specialized variants, parameter counts like 70B/31B/8B, and families like GLM, Kimi, and MiniMax) to estimate relative capability and cost. Code-specialized models are always pinned to the expensive tier regardless of overall score.
Category tags: