Open sourceModel routingEvals in CI

ConduitOne gateway for every model call, routed by complexity and guarded both ways.

When every team calls models directly, nobody controls cost, PII, or vendor lock-in. Conduit puts every call through one OpenAI-compatible process with an order the code enforces.

50.8%Lower model cost than sending everything to the frontier tier (target was 40%)
88.6%Router tier agreement on the labeled set
0%Prompt-injection false positives
941Tests passing, with mypy --strict and an 80% coverage gate

An enforced pipeline

auth→ingress guard→router→provider adapter→egress guard→telemetry
  1. Auth. API key to team, quota, and policy.
  2. Ingress guard. PII redaction and prompt-injection detection before any model sees the request.
  3. Router. Complexity to tier to a model chain, with fallback down the chain instead of failing.
  4. Provider adapters. Vendor SDKs live only here, and a CI test enforces it, so swapping providers is a config change.
  5. Egress guard. Re-scans the response and restores tokens.
  6. Telemetry. Tokens, cost, latency, trace, and verdict for every call.

The stages are an enum, and running one out of order raises PipelineOrderError, so the router can't jump ahead of the ingress guard.

Routing that pays for itself

A two-stage router sends most traffic to cheap models. A zero-cost heuristic resolves 80%+ of requests, and a cached LLM tie-break handles the ones with no lexical evidence either way. One fix separated the instruction from pasted material: a quote pasted under a short question used to push a trivial request up to the complex tier.

Evals as a merge gate

Reading the numbers honestly

The 88.6% routing figure and the 100% injection detection rate are upper bounds: both were reached by fixing rules after reading the failing cases. A held-out probe caught one over-broad and one too-narrow injection rule before shipping. The unfitted check is the held-out property test.

Stack

Links

Case studypiiguardA PII leak guard for sandboxed AI agents that hardens itself.Case studyAgentShieldA guardrail that learns new PII rules from its misses, and unlearns the ones that misfire.