B14 - Provider Failover
| Group | Technology | Status | Service | Roadmap phase | Contracts |
|---|---|---|---|---|---|
| B - LLM management and Model Gateway | LiteLLM fallbacks + Router | to develop | llm | 3 | - |
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/simulatePOST /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_eventsrow. - Secrets never returned by the API; TLS everywhere; Cilium network policies restrict who can reach the service.
| Control | Enforcement |
|---|---|
| Provider / model / region allowlists | Per tenant and project in eai.policies; the Router only selects allowed triples (provider, model, region) |
| Data classification | Request eai.data_classification must be <= model data_classification_max; very sensitive (restricted, secret) data stays on local models (vLLM) |
| DLP | DLP Gateway (E02) inspects and masks or tokenizes prompts before any remote call |
| Secret isolation | Credentials write-only, stored in OpenBao, injected into LiteLLM at sync, never returned by the API or logged |
| TLS | TLS 1.2+ to every provider, mTLS SPIFFE inside the cluster |
| Provider retention | Registry records the provider retention / zero data retention terms; models without acceptable terms are restricted |
| Fallback policy | Fallback chains are filtered with the same allowlists: never a forbidden region, model or classification |
| Cost guardrails | Estimate 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 exposure | Prompts and completions logged only according to policy, redacted, never with credentials |
| Kill switch | POST /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 W3Ctraceparentpropagation, 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
- A tenant cannot read or modify another tenant's resources (RLS test).
- Every mutation produces an audit event verifiable by
GET /v1/audit/verify. - Errors are returned in English and French according to
Accept-Language.