Case 19 · Flagship

AI Runtime Platform

An AI runtime execution plane makes model calls behave like production infrastructure: governed, observable, scalable, and owned by platform contracts rather than scattered application code.

01

How it works

From request to a runtime decision.

AI Runtime Platform by Andrey Lesnikov — an OpenAI-compatible execution plane that routes to vLLM and KServe on Kubernetes using health, cost, and canary policy.

Architecture diagram of the AI Runtime Platform: FastAPI gateway, serving plane, and GitOps delivery
Execution plane first: gateway decision loop, serving backends, then observe and GitOps delivery.
Animation of the AI Runtime Platform decision loop from request to gateway routing and observability
Lifecycle — Request → Gateway decision → Health / cost / canary → Serve → Observe
  1. 01

    Ingress the request

    Clients hit an OpenAI-compatible FastAPI gateway — one boundary for apps and agents instead of scattered provider SDKs.

  2. 02

    Decide the runtime path

    Health, latency, cost, canary weights, and fallback policy select the backend; the decision is visible on every completion response.

  3. 03

    Serve on Kubernetes

    vLLM and KServe paths run with probes, ServiceMonitors, and KEDA queue autoscaling — GPU or local CPU compose for demos.

  4. 04

    Observe and deliver

    OpenTelemetry traces the intent-to-model path; Argo CD ships the plane with SBOM, cosign, and supply-chain gates.

02

Evidence

From problem to proof.

How the system is framed, operated, and proven — not a slide deck summary.

01
Problem

AI systems often begin as direct provider API calls. In production that leaves gaps around identity, policy, MCP tool governance, scaling, telemetry, cost visibility, and auditability. Every team reinvents rate limits, fallback, and audit trails in application code.

02
Architecture

The runtime plane combines an OpenAI-compatible gateway, MCP governance, intent proxying, KServe/vLLM serving paths, KEDA scaling, Redis state, OIDC identity, and OpenTelemetry traces. Policy and quotas sit in front of model execution; traces follow the request from client intent to provider response.

03
Operating model

Platform owns the contracts: who can call which tools, which models are allowed, which budgets apply, and which SLOs burn when latency or error rates climb. Application teams consume a stable interface instead of wiring providers ad hoc.

04
Trade-offs

A runtime plane introduces more platform responsibility than direct SDK usage. The payoff is consistent governance, reusable observability, clearer failure isolation, and a better path from prototype to production.

05
Evidence

Useful signals include policy decision logs, token and cost metrics, provider fallback counts, KEDA scale events, and end-to-end traces that name the intent, tool, and model path.

06
Latest evidence

Fleet-wide Redis admission: tenant × model concurrency is a Redis-backed distributed semaphore (atomic Lua acquire, TTL leases with fencing tokens, renewal during streams), so the limit holds across gateway replicas and capacity returns after a pod dies. Redis unavailable → 503 admission_store_unavailable by default (fail_closed). Platform e2e covers two replicas sharing one limit and SIGKILL mid-stream (CI run 38121712037). GOVERNANCE_MODE defaults to enforce (PR #100): enforce without CONTROL_PLANE_URL fails readiness (503) and chat returns 503 governance_misconfigured — governance is never silently skipped; disabled must be set explicitly. Golden path: block → 403, approval → 409 then 200, Redis down → /readyz 503; suite 21.5 s on Compose (run 38060436977, docs/results.md).

07
Inference Budget Guard

v2.5.0 adds an opt-in Inference Budget Guard on the gateway chat path (INFERENCE_BUDGET_ENABLED): reserve estimated spend → execute → settle actual usage, with atomic Redis Lua reservation (shared across replicas) or an in-process lock when Redis is unset. Money is integer micro-USD. Fail-closed: 503 when the store is down, times out, or returns corrupt data (and on malformed policy); 429 when over budget — the backend is not called. On this test suite, real Redis with 8 OS processes × 25 concurrent reserves × 10 rounds held the invariant (allows/round=[142], expected 142; max reserved 994000 of 1000000 micro-USD; overspend_events=0); concurrent settle was exact in 10/10 rounds with leaked_reserved_micros=0; legitimate within-budget false_deny_count=0 (80 tests passed; docs/EVIDENCE.md, docs/results.json, docs/budget-guard.md). Documented limits on this test suite: the pre-request estimate uses the budget policy's prices while settlement uses the gateway's model prices; if Redis fails after the upstream call, that spend is lost (reservation held until TTL, then released); without Redis the budget is per gateway process.

Constraints

OpenAI-compatible interfaces, MCP tool boundaries, model-serving latency, Kubernetes autoscaling, OIDC, audit trails, cost visibility, and opt-in inference budget admission (integer micro-USD).

03

Deep dive

Model calls as infrastructure, not SDK litter.

AI Runtime Platform turns inference into a governed execution plane: one OpenAI-compatible boundary, a visible routing decision, Kubernetes serving paths, and traces from intent to model response.

Plain answer

Applications and agents call an OpenAI-compatible gateway. The gateway evaluates health, latency, cost, canary weights, and fallback policy, then routes to vLLM or KServe on Kubernetes. Every completion can expose why that backend was chosen. OpenTelemetry follows the path; GitOps (Argo CD) delivers the plane with supply-chain gates. Platform owns contracts; apps consume a stable interface.

Direct provider SDKs feel fast on day one. By week six every team has its own retries, keys, rate limits, and a Slack thread titled “which model are we on?”. Cost shows up as a surprise. Incidents show up as guesswork.

The execution plane exists so model access behaves like any other production dependency: identity at the edge, policy before work, scale designed not improvised, and telemetry that names the intent — not just the HTTP 200.

Request path

  1. 01
    Ingress

    Clients hit a FastAPI gateway — one boundary for services and agents instead of scattered provider SDKs.

  2. 02
    Decide

    Health, latency, cost, canary weights, and fallback policy select the backend. The decision is part of the response path.

  3. 03
    Serve

    vLLM and KServe paths run with probes and ServiceMonitors; KEDA scales on queue depth so GPU capacity follows demand.

  4. 04
    Observe

    OpenTelemetry ties intent → tool/policy → model path. Argo CD ships the plane with SBOM and signing gates.

What platform owns vs what apps own

Platform

Contracts and capacity

Identity (OIDC), backend catalog, canary and fallback rules, budgets, SLOs, traces, GitOps delivery, GPU/CPU serving paths.

Apps

Intent and product logic

Prompts, product workflows, agent graphs, and business retries that are truly domain-specific — not reinvented provider plumbing.

Shared

Error semantics

Rate limits, overloaded backends, and policy denies must be stable codes apps can handle without scraping HTML error pages.

Failure modes the plane is meant to absorb

Failure mode

Hot backend

Latency or error burn on primary → canary/fallback shifts traffic without every client shipping a new SDK config.

Failure mode

Cost spike

Token and spend metrics are first-class. Budgets fail closed or warn with ownership — not a month-end invoice autopsy.

Failure mode

Agent tool sprawl

MCP tools without identity become shadow APIs. Governance at the plane keeps allow-lists and audit in one place.

Failure mode

Demo-only serving

Local CPU compose exists for demos; production paths assume probes, autoscaling, and GitOps. Mixing those modes silently is how outages hide.

Signals on the operating dashboard

Decision mix
route %

Share of traffic per backend / canary lane — sudden flips should correlate with health, not mystery.

Fallback rate
per min

Rising fallback is an early incident signal even when user-facing error rate still looks calm.

Token & cost
$ / 1k

Cost per intent class beats average token price for finding the workload that actually burns money.

SLO burn
latency / 5xx

Gateway SLOs should page before GPU utilization dashboards become archaeology.

How to carry this

Trade-off

Platform hop

You accept a hop and platform ownership. Direct SDKs feel lighter in a prototype. The plane wins when more than one team consumes models or incidents need an explainable route.

Pair with

Architecture Rehearsal

Use rehearsal when the change is new serving topology, tool surface, or fallback graph — not just a prompt tweak.

Adoption

Ingress first

Start with one OpenAI-compatible ingress, decision headers, and cost metrics. Add canary/fallback once the golden path is trusted.

04

Guides

Read the guide.

05

Related

Nearby systems.

Case 26 · Flagship

AI Infra Control Plane

  • Python
  • Kubernetes
  • Terraform

Private AI platforms need shared governance across identity, policy, audit, cost, and SLO signals — not scattered service configs

Private AI with explicit platform contracts

Case 02 · Flagship

Cloud-Native AI Gateway

  • Gateway
  • Providers
  • OpenTelemetry

AI usage needs routing, policy, budget awareness, and provider resilience

One boundary: rate, budget, fallback, OTel

Case 07

LLM Infrastructure Runtime

  • Queue
  • vLLM
  • KServe

LLM workloads move faster than traditional platform controls and can quickly become expensive, opaque, and hard to operate

LLM serving with operability signals

06

FAQ

Questions operators ask.

Why not call the provider SDK directly?

Direct SDKs scatter identity, retries, budgets, and fallback across every app. The execution plane centralizes those contracts behind an OpenAI-compatible gateway with visible routing decisions.

What does the gateway decide?

Health, latency, cost, canary weights, and fallback policy select vLLM or KServe backends. The decision is part of the completion path so incidents are explainable.

Where does MCP fit?

When agents call tools, allow-lists and identity belong in the same plane as model I/O — otherwise every agent reinvents shadow APIs.

How do I know it is working in production?

Watch decision mix, fallback rate, token/cost by intent, and gateway SLO burn — not only GPU utilization charts.

Available for meaningful infrastructure conversations

Build systems that stay calm under pressure.

Available for conversations

Talk infrastructure

Book a working session

Meet ↗

Evidence first

For deep dives

Explore the systems

All cases ↗