AI Reliability Gateway & Control Plane

Aegis

An OpenAI-compatible reverse proxy that sits in front of your LLM providers and adds what a raw API call doesn't have: cost-aware routing, automatic failover, rate limits that survive a restart, prompt experimentation, and a regression suite that tells you exactly what broke.

Thirteen capabilities, each graded honestly below — not a page claiming uniform completeness. 58 automated tests. Try it live at the bottom of this page.

58/58 tests passing 0 TypeScript errors Dockerized API keys + rate limits Spend survives restarts

The Problem

A direct call to an LLM provider is a single point of failure with no cost discipline. One 429 or 503 halts every downstream workflow. Every prompt defaults to the most expensive model regardless of how simple the question is. Nobody can say which prompt version is actually better, or whether last week's change quietly made outputs worse.

The Gateway

Aegis sits between your app and every provider. It routes on complexity, fails over on outage, enforces budgets per team, runs prompt variants against each other with real statistics, and keeps a golden-case suite that catches regressions the moment they happen — all wired into one request path, not five disconnected demos.

Architecture

Two independent paths, one control plane

A chat completion runs the full pipeline on the left. The four applied spokes on the right are separate endpoints — they don't route through it. Click any box for what it actually does.

Click any box for exactly what it does — this is the real request flow, not an illustration of it.

Client / Your AppCHAT COMPLETIONS PIPELINE · POST /v1/chat/completions#11 · SERVICE LAYERAuth & Rate Limit#2Cost Autopilot#9 + #12 · OPTIONALA/B Variant + Canary#11Circuit BreakerINFRASTRUCTUREProvider Dispatch#5 · OPTIONALMulti-Critic Arbitration#3 + #7Forensics TracingAPPLIED SPOKES · independent endpoints#6Hybrid RAG#8Text-to-SQL Guardrails#4Self-Healing Docs#10LoRA Fine-Tuning PipelineResponse + gateway_metadataJSON response (per spoke)#1 + #13 · CONTROL PLANE MANAGERNot in the request path. Reads circuit-breaker state, rate limits, and trace anomalies from thepipeline on the left — and on demand, re-runs 8 golden test cases against the pipeline andevery spoke on the right, reporting exactly what regressed, not just “something broke.”Click for the proof — a real regression was triggered and caught live this session.reads stateruns golden cases →
Honest Grading

13 capabilities, graded the way I'd want a vendor to grade themselves

REAL means wired, tested, and live-verified. REAL (heuristic) means the same, with a specific, named simplification instead of a hidden one.

#1 Model Regression DetectionREAL

Golden-case harness diffs pass/fail against the last run — flags exactly which case regressed.

Slack alerts log-only unless a webhook is configured.

#2 Cost Autopilot RouterREAL

Routes simple prompts to cheap models, complex ones to reasoning-tier models, by real content analysis.

#3 Failure Forensics & TracingREAL

Full per-hop span waterfall, fetchable by trace ID.

OTel-shaped, not OTel-protocol-compatible.

#4 Self-Healing Technical DocsREAL

Real Python AST parsing; CI opens an actual correction PR on drift.

Only catches drift in already-documented functions.

#5 Output Arbitration SystemREAL HEURISTIC

Weighted confidence score from 3 independent checks, wired into every arbitrated request.

Critics are pattern heuristics, not separate model calls.

#6 Hybrid RAG with CitationsREAL

Real BM25 scoring plus real ingestion of markdown files with genuine line-number citations.

“Dense” score is lexical trigram overlap, not embeddings.

#7 Observability TelemetryREAL

Real computed latency, cost, and savings on every response.

#8 Text-to-SQL with GuardrailsREAL

Plain-English → SQL translation, structurally incapable of emitting destructive statements, plus AST-ish execution guardrails.

Rules-based translator, not an LLM call.

#9 Prompt A/B TestingREAL

Live-wired weighted variant selection with a real two-sample z-test for significance.

No multiple-testing correction across many variants yet.

#10 LoRA Fine-Tuning PipelineREAL

Exact parameter math; benchmark accuracy is a real function of rank, verified strictly increasing.

Estimates a training run — doesn't perform one.

#11 LLM Gateway & Circuit BreakerREAL

Real CLOSED/OPEN/HALF_OPEN state machine and token-bucket limiter, now aware of per-team limits.

Single-process — a fleet needs Redis for shared counters.

#12 Canary AI Feature FlagsREAL

Percentage rollout with moving-average auto-rollback — verified tripping live.

#13 Automated Eval Dataset MinerREAL

Every failed trace is auto-mined into a growing golden eval dataset.

No dedup/clustering of similar failures yet.

Beyond The 13

What makes this service-shaped, not just clever

This is an engineering demonstration, not a product for sale or rent — the multi-tenant primitives below are real and tested, with nothing behind a paywall.

API Keys

SHA-256 hashed at rest, shown once on issuance, revocable — verified end to end, including rejecting a revoked key.

Per-Tenant Rate Limits

Configurable requests/min, tokens/min, and spend budget per team — auth is opt-in, off by default, so the demo below needs no key.

Durable Spend

Cumulative spend is SQLite-backed and survives a process restart — proven by actually killing the process and checking the number again.

AI Reliability Control Plane & Gateway

Aegis AI Reliability Engine

An open-architecture AI Gateway and Control Plane featuring circuit-breaker failovers, semantic cost routing, AST-based SQL guardrails, and hybrid retrieval with citation grounding.

Using simulated fixtures