Skip to main content

B14 - Provider Failover

GroupTechnologyStatusServiceRoadmap phaseContracts
B - LLM management and Model GatewayLiteLLM fallbacks + Routerto developllm3-

Back to index - Français

Role and responsibilities​

Fallback chains that never cross forbidden regions, models or classifications.

Data model​

Tables (schema eai, every tenant table carries tenant_id uuid NOT NULL with an RLS policy on current_setting('app.tenant_id', true)::uuid): eai.llm_routes, eai.audit_events.

API endpoints​

  • POST /v1/routes/simulate
  • POST /v1/providers/{id}/disable
POST /v1/routes/simulate HTTP/1.1
Host: <control-plane-host>
X-API-Key: eai_xxx_secret
Accept-Language: en
Content-Type: application/json

{"purpose": "support", "data_classification": "confidential", "region_allow": ["eu"]}
{"selected": "fake-gpt", "fallbacks": [], "strategy": "priority", "rejected": [], "route_id": "417d22b5-f725-4a5c-a6fe-128310c3d083"}

Errors use the common envelope {"error": {"code", "message", "message_i18n", "details", "request_id"}}; lists are paginated with limit and cursor.

SDK usage​

Python (enterprise_ai):

from enterprise_ai import EnterpriseAI

client = EnterpriseAI(base_url="<control-plane-url>", api_key="eai_xxx_secret")
items = client.routes.list()

TypeScript (@enterprise-ai/sdk):

import { EnterpriseAI } from "@enterprise-ai/sdk";

const eai = new EnterpriseAI({ baseUrl: "<control-plane-url>", apiKey: process.env.EAI_API_KEY });
const items = await eai.routes.list();

Java (enterprise-ai-java):

EnterpriseAIClient client = EnterpriseAIClient.builder()
.baseUrl("<control-plane-url>")
.apiKey(System.getenv("EAI_API_KEY"))
.build();
var items = client.routes().list();

Go (enterprise-ai-go):

client, _ := eai.NewClient(eai.WithBaseURL("<control-plane-url>"), eai.WithAPIKey(os.Getenv("EAI_API_KEY")))
items, err := client.Routes.List(ctx)

Configuration​

  • Environment: EAI_DATABASE_URL, EAI_OTEL_EXPORTER_OTLP_ENDPOINT.
  • Helm values: controlPlane.enabled, controlPlane.replicas, controlPlane.resources, controlPlane.config, litellm.enabled, litellm.config.

Security controls​

  • Authentication by OIDC JWT, tenant API key with scopes, or SPIFFE mTLS; tenant resolved from the credential, never from the body.
  • Authorization through OpenFGA and OPA decisions; every mutation and decision writes a hash-chained eai.audit_events row.
  • Secrets never returned by the API; TLS everywhere; Cilium network policies restrict who can reach the service.
ControlEnforcement
Provider / model / region allowlistsPer tenant and project in eai.policies; the Router only selects allowed triples (provider, model, region)
Data classificationRequest eai.data_classification must be <= model data_classification_max; very sensitive (restricted, secret) data stays on local models (vLLM)
DLPDLP Gateway (E02) inspects and masks or tokenizes prompts before any remote call
Secret isolationCredentials write-only, stored in OpenBao, injected into LiteLLM at sync, never returned by the API or logged
TLSTLS 1.2+ to every provider, mTLS SPIFFE inside the cluster
Provider retentionRegistry records the provider retention / zero data retention terms; models without acceptable terms are restricted
Fallback policyFallback chains are filtered with the same allowlists: never a forbidden region, model or classification
Cost guardrailsEstimate and quota reservation before execution (POST /v1/gateway/estimate, POST /v1/quotas/reserve), streaming cut-off during execution when the budget is reached
Logging without exposurePrompts and completions logged only according to policy, redacted, never with credentials
Kill switchPOST /v1/providers/{id}/disable and POST /v1/models/{model_id}/disable take effect at the next call

Remote models are allowed for some uses (public or internal data, approved purposes) while very sensitive data stays on local models.

Observability​

  • Metrics: eai_provider_failover_requests_total, eai_provider_failover_errors_total, eai_provider_failover_latency_seconds (Prometheus).
  • Traces: OpenTelemetry spans eai.routes.* with W3C traceparent propagation, AI spans forwarded to Opik.
  • Audit actions: route.create, route.update, route.delete, policy.evaluate.

FinOps aspects​

Operating cost is allocated per tenant and project through labels on Usage Events and Kubernetes resource requests; no direct per-call cost.

Failure modes and resilience​

  • Failover triggers: 429, 5xx, timeout, provider disabled.
  • Each candidate is re-checked against allowlists and classification; if none remains, the call fails with no_allowed_route, never a silent downgrade to a forbidden region.

Standalone adoption (client of a client)​

A client of a client can adopt this brick alone with the Python SDK sub-client client.routes (TS eai.routes, Java client.routes(), Go client.Routes). Minimal deployment: Control Plane API + PostgreSQL + Keycloak (or API keys), the Control Plane loads every domain of services/control-plane/src/eai/domains; the optional chart components are switched off in deploy/helm/enterprise-ai/values.yaml (vllm.enabled, qdrant.enabled, nats.enabled, workers.enabled).

Acceptance tests​

  1. A tenant cannot read or modify another tenant's resources (RLS test).
  2. Every mutation produces an audit event verifiable by GET /v1/audit/verify.
  3. Errors are returned in English and French according to Accept-Language.