Droughter

Created by team LuaRouter on July 08, 2026
Hybrid Token-Efficient Routing Agent

The core challenge of this hackathon is a delicate balancing act: achieving maximum accuracy across 8 distinct NLP domains while rigorously minimizing API token spend, all within a highly constrained 4GB RAM and 2 vCPU hardware envelope. To solve this, we engineered a hyper-efficient, three-tiered Hybrid Routing Engine driven by our intelligent TaskRouterAgent and a declarative `router.yml` algorithm. Incoming tasks are first optimized by our LexicalCompressor and TokenOptimizer—stripping stopwords to minimize prompt tokens—before being categorized by intent (e.g., CODE, SUMMARIZATION, NER, MATH) and assigned a lexical complexity score (EASY, LESS_COMPLEX, COMPLEX). This allows the router to dynamically assign tasks to the most optimal computational layer: * **Tier 1 (Local LLMs):** For foundational tasks, we leverage highly optimized local models running via llama.cpp directly on the constrained 2 vCPU and 4GB RAM hardware. We utilize IBM Granite for robust code generation and debugging, while deploying Google Gemma 3 for summarization, factual queries, and sentiment analysis. * **Tier 2 (Offline Extraction):** To completely eliminate LLM hallucination and dramatically increase speed for extraction tasks, we utilize an offline GLiNER model dedicated entirely to zero-shot Named Entity Recognition (NER). * **Tier 3 (Cloud Fallback):** For the most demanding workloads (like complex reasoning or advanced math), we dynamically parse the `ALLOWED_MODELS` environment variable to selectively route tasks to the premium Fireworks API. Furthermore, we integrated a robust 120-second timeout cascade system: should any local execution experience an Out-of-Memory (OOM) error or crash, the system gracefully falls back to the Cloud Engine to guarantee 100% reliability.

Category tags: