Skip to main content

Model Route

This page is auto-generated from the formations OpenAPI spec. Do not edit manually — run pnpm generate-formations-resource-docs to regenerate.

Declares a model route within the formation's project: a named, ordered list of provider+model failover targets with retry and circuit-breaker configuration. Consumers reference it through their own model_route_id, or inherit it as the project's default_model_route_id.

Syntax

type: model_route
properties:
name: String
targets: Object[]
retry_on: String[]
failure_threshold: Integer
cooldown_seconds: Integer

Output

The physical resource ID is the public ID of the created resource. Reference it from other resources with a ref expression:

some_field:
ref: MyModelRoute

Properties

name

Route name, unique within the project

Required: Yes Type: String


targets

Ordered failover targets, tried in array order. Each entry is { ai_provider_id, model, timeout_seconds?, max_retries? }; every provider must belong to this project, and the total attempt budget (sum of 1 + max_retries) is capped at 10.

Required: Yes Type: Array of Object


retry_on

Which failure classes fail over: any of provider_error, timeout, rate_limited. Defaults to all three. Deterministic rejections (400-class, auth, content policy) never fail over.

Required: No Type: Array of String


failure_threshold

Consecutive retryable failures before a target is skipped (default 3)

Required: No Type: Integer Nullable: Yes


cooldown_seconds

How long a tripped target is skipped before being probed again (default 60)

Required: No Type: Integer Nullable: Yes