This project is a general-purpose AI agent built for Track 1, designed to handle eight distinct task categories — factual knowledge, mathematical reasoning, sentiment classification, text summarization, named entity recognition, code debugging, logical/deductive reasoning, and code generation — through a single containerized pipeline. At its core is a lightweight, regex-based heuristic classifier that identifies each incoming task's category in microseconds, with zero model calls and zero token cost. Once classified, tasks are routed to a specific Fireworks-hosted model chosen for that category's needs, using a role-based routing table resolved dynamically at startup: the pipeline probes every candidate model with a minimal health check before the run begins, so it adapts automatically if a particular model isn't servable, rather than hardcoding assumptions. For math and logic-puzzle tasks, the agent takes a hybrid approach — instead of asking the model to reason through arithmetic or constraint-satisfaction purely in natural language, it prompts the model to generate a short, self-contained Python script, then executes that script locally in an isolated, timeout-bounded subprocess. This trades expensive "thinking" tokens for exact, deterministic computation, improving both accuracy and token efficiency. If code generation or execution fails for any reason, the agent falls back gracefully to a direct natural-language answer from the same model, so no task is ever left unanswered. All requests are processed concurrently via a thread pool, with a strict runtime budget enforced well under the platform's limits, and every call is logged with detailed latency and token metrics for post-run analysis. The result is a robust, self-adapting agent that balances correctness, speed, and cost across a genuinely broad range of task types.
Category tags: