Vigilant-Agent

Created by team Vigilant Labs on July 06, 2026
Hybrid Token-Efficient Routing Agent

This project is an intelligent task-routing pipeline for LLM workloads. Instead of sending every prompt to an expensive remote model, it first classifies each task by type (code generation, math, summarization, sentiment, entity extraction, and more), runs it through a fast local model, and evaluates whether the local answer is trustworthy enough to return as-is. Trust is determined by a lightweight complexity scorer that looks at prompt length, nesting, numeric density, and multi-step language, combined with category-specific validation — checking that code parses, that summaries meet stated length constraints, and that sentiment answers actually contain a sentiment label. Only prompts that fail these checks or exceed a complexity threshold are escalated to a remote model, and the router picks the right remote model tier (cheap, mid, heavy, or code-specialized) based on task type and complexity. The whole system runs under a hard wall-clock budget: it tracks elapsed time throughout, degrades gracefully as a panic threshold approaches by cutting escalations and shortening timeouts, and always writes a best-effort result for every task before the process is forced to exit — using an atomic write (temp file + rename) so a partial write can never corrupt the output file.

Category tags: