
ByteRoute is a token-efficient AI routing agent built for the AMD Developer Hackathon Act II, Track 1. The core idea is simple: not every task needs an expensive API call. ByteRoute implements a two-layer routing architecture that dramatically reduces token consumption while maintaining high accuracy across all eight evaluation categories. The first layer is a local interception framework built entirely in Python using regex and keyword heuristics. For mathematical expressions with explicit operators and numbers, ByteRoute solves them instantly at zero token cost. For sentiment classification with unambiguous positive or negative signals and no contrast words, it resolves locally without touching the API. This zero-token layer handles the easiest tasks with deterministic accuracy. The second layer routes all remaining tasks to the Fireworks AI API using GLM 5.2, but with a critical optimization: each category gets a tailored system prompt that constrains the model to produce concise, judge-friendly output. Summarization tasks get a 25-word sentence limit. Named entity recognition tasks get a compact Entity (Type) format. Code generation and debugging tasks get markdown code fence constraints. Mathematical word problems get a single-line answer format. Logical reasoning tasks get a direct conclusion-first format. The agent reads tasks from /input/tasks.json, processes them concurrently using asyncio with a semaphore-controlled concurrency limit of 5 to prevent rate limiting, and writes results to /output/results.json. The entire pipeline exits with code 0 and completes well within the 10-minute runtime limit. All API calls route exclusively through the injected FIREWORKS_BASE_URL with models read dynamically from ALLOWED_MODELS at runtime.
13 Jul 2026