
Implementing the Token-Efficient Router required a fundamental shift in how LLM pipelines are traditionally built: prioritizing deterministic machine verification over model self-confidence. The implementation starts with a lightweight, priority-ordered regex classifier. Rather than wasting API tokens on an LLM-based router, we categorized incoming natural-language tasks into eight buckets at zero cost. Once categorized, tasks enter the local lane powered by a heavily quantized Qwen3-4B model running on a llama-server background process. The heavy lifting of the implementation lies within the "gates"—the verification layer that prevents hallucinations from slipping through. We implemented category-specific, host-side checks: Execution Sandboxes: For code generation and debugging, we built a Python subprocess environment that dynamically executes the model's output against the prompt’s worked examples and assertions. Procedural Math/Logic: Instead of trusting the model's in-head arithmetic, the agent forces the model to write scripts to calculate numbers or brute-force logic puzzles using itertools. ONNX-Powered NLP Verification: We baked local, offline models directly into the pipeline. A DeBERTa-v3 NLI model handles entailment checking to verify summarization accuracy sentence-by-sentence, while a MiniLM embedder enables precise few-shot sentiment voting. Finally, the remote fallback implementation optimizes API usage through aggressive batching. When a task legitimately fails the local gates, it is grouped into category-specific batch lanes. This ensures heavy instruction headers are billed once per lane rather than once per task. A strict 540-second deadline guard watches over the entire single-process architecture, ensuring valid JSON results always cleanly write to disk before the system terminates.
13 Jul 2026

GEM² Audit OS is an AI governance system for enterprises that need autonomous agents to act safely, explainably, and within auditable boundaries. In most AI workflows, humans are asked to manually review outputs after the fact. GEM² changes the control model: humans define the contract edge, and the system audits AI behavior at that edge. Each agent action becomes a contract-bounded transformation: `F: A → B | P`. Before execution, an input audit checks whether the runtime input satisfies the contract. After execution, an output audit verifies whether the result is grounded, compliant, and safe to continue. For security, GEM² integrates Lobster Trap as a governance gate: suspicious, unsafe, or policy-breaking behavior is trapped before it propagates through the workflow. For contract-based governance, Gemini is used as an audit intelligence layer, evaluating whether each step satisfies the declared contract, evidence, and postconditions. The result is not just an AI answer, but a regulator-readable audit record. The demo shows a four-layer audit page: contract definition, execution trace, security/governance gate, and evidence-backed audit verdict. GEM² is built for AI governance at the edge: AI can act autonomously, but every action must cross a verifiable boundary. Humans do not manually audit every decision; they define the rules, and GEM² produces reusable evidence for trust, compliance, and accountability.
19 May 2026