Multi-Model Routing
Routing policies, fallback chains, model pinning, and private provider URLs.
No single model is perfect for every financial workflow. Eridian's routing engine dynamically selects the optimal model for each request based on cost, latency, and quality constraints you define - without pushing routing logic into application code.
Powered primarily by OpenAI and Gemini. A routing policy may also include a private hop when you point Eridian at a URL you host.
Routing Policies
| Policy | Behavior |
|---|---|
cost_optimized | Select lowest-cost model meeting quality floor |
latency_optimized | Select fastest model meeting quality floor |
quality_optimized | Select highest-quality model within cost ceiling |
| Custom policy ID | Project-defined weights and constraints |
Set the default policy at project level or override per request with routing_policy.
Per-Request Example
{
"model": "auto",
"routing_policy": "quality_optimized",
"fallback_chain": ["gpt", "gemini"],
"timeout_ms": 30000,
"project_id": "prj_legal_001"
}
Create Custom Policy
POST /v1/routing/policies
Authorization: Bearer eridian_sk_...
Content-Type: application/json
{
"policy_id": "legal_strict_v2",
"weights": { "quality": 0.6, "latency": 0.2, "cost": 0.2 },
"allowed_models": ["gpt", "gemini"],
"quality_floor": 0.92,
"max_cost_usd": 0.05,
"fallback_chain": ["gpt", "gemini"]
}
Reference custom policies by ID: "routing_policy": "legal_strict_v2". Policy writes that change allowed_models or residency require dual control on Enterprise.
List and Retrieve Policies
GET /v1/routing/policies?project_id=prj_legal_001
GET /v1/routing/policies/legal_strict_v2
Authorization: Bearer eridian_sk_...
List responses are cursor-paginated. See Pagination.
Required scope: governance:manage to write, models:read to read.
Fallback Chains
If the primary model times out or returns HTTP 503, traffic fails over to the next model in the chain automatically. Your application receives a single response with eridian.route_fallback: true indicating fallback was triggered. Each hop is traced separately in OpenTelemetry spans.
Model Pinning
Enterprise customers pin specific workflows to specific models for compliance or evaluation requirements:
{
"model": "gpt",
"routing_policy": "quality_optimized"
}
Pinning overrides "auto" selection but still runs the full orchestration pipeline (caching, PII, observability).
Private provider hops
A routing policy may include a private hop when the project has a customer-configured base URL. Use it when the desk must call a model you host (local, private provider, or bare metal). Eridian does not operate those GPUs. If the private hop is unhealthy, fallback continues to GPT or Gemini when those families are in allowed_models.
{
"policy_id": "desk_private_first",
"allowed_models": ["private", "gpt", "gemini"],
"fallback_chain": ["private", "gpt", "gemini"]
}
Provider Health Signals
The routing engine ingests provider latency, error rate, and budget utilization signals every 30 seconds. Models exceeding error thresholds are temporarily removed from the active pool until recovery. Dashboard alerts fire when pool size drops below configured minimums.
Observability Fields
Each routed request records:
| Field | Description |
|---|---|
eridian.route | Selected model ID |
eridian.route_fallback | Whether fallback chain was used |
eridian.routing_policy | Policy applied |
eridian.routing_latency_ms | Time spent in routing decision |
Use these fields to tune policies without guessing from aggregate spend alone.
Error Codes
| HTTP | Code | Meaning |
|---|---|---|
| 503 | model_unavailable | No healthy GPT, Gemini, or private hop in the pool meets constraints |
| 408 | routing_timeout | All fallback hops exceeded timeout_ms |
| 403 | policy_dual_control_required | Policy mutation pending second approver |
Python
response = client.inference.create(
model="auto",
project_id="prj_legal_001",
routing_policy="legal_strict_v2",
messages=[{"role": "user", "content": "Score this clause."}],
)
assert response.eridian.route in ("gpt", "gemini", "private")
See Inference for per-request overrides and Models for pool availability by region.
Production API credentials are issued with an institution workspace. Contact sales if you need access.