About Professional
How I Build How I Build Meet the Team
Technology Homelab App Showcase Case Studies
Maverick & Luke Say Hello

Case study

Building an AI Operations Control Plane for a Multi-App Fleet

I turned a passive usage logger into the mandatory gateway every app's AI traffic flows through (with per-function routing, a central kill switch, privacy-by-architecture provider locks, pre-flight cost caps, automatic cloud-to-local failover, and a recommendations engine), then migrated most of the fleet's AI-calling apps onto it (a couple explicitly deferred) and made "all AI routes through here" an enforced architectural rule rather than a convention.

Context: this runs a self-hosted homelab I operate, a fleet of apps across several machines connected by a private VPN.


The challenge

The earlier version of the AI gateway was a local-model-only usage logger: a proxy fronting the local model runtime that recorded token counts, latency, and electricity cost, tagging traffic by app via a URL path prefix. It never touched hosted-LLM traffic at all.

That left three real gaps. Apps called AI providers directly: each hit the hosted API with its own key, or the local runtime directly, so there was no central chokepoint. There was no cloud cost or usage visibility, because those calls bypassed the gateway entirely. And there was no governance. Model choice was per-app via individual settings dropdowns (changing one meant editing and restarting the app), with no way to lock a sensitive function to local-only inference, cap a per-request cost, or kill a runaway app's spend centrally. The hardware made this matter: the production node has no usable GPU, so real work had to go to paid hosted APIs, which is exactly when cost governance stops being optional.

My objective: elevate it from a logger into the AI operations control plane for the whole fleet, one mandatory gateway proxying both local and hosted traffic, with unified logging, per-function model routing, policy enforcement (including privacy locks), per-request cost capture, and a recommendations engine analyzing real usage. A business goal rode on it too: routing app inference through per-token hosted rates was what made it safe to drop the AI subscription a tier, an estimated $80–180/month saving.

Approach: route on the function, make the routing table the enforcement boundary

Results

Verifying the first migrated consumer end-to-end surfaced a stale auto-deploy, and revealed that every other app still called providers directly, which is what turned a verification step into the trigger for the whole migration batch.

What this demonstrates

A companion piece covers hardening this same system's own attack surface.