InferenceHow Routing Works

How Routing Works

Every request passes through up to two routing tiers. The gateway tries each tier in order and returns the first successful response.

The two tiers

Request → Tier 1: Operators → Tier 2: Direct Provider → Response

Tier 1: Operator routing

Operators run Blueprints: service templates like the LLM Inference Blueprint. They stake tokens, serve models, and compete on price, latency, and reputation.

When it’s used: Default for auto routing mode, required for SpendAuth (on-chain payments).

When it’s skipped: Only in two cases. When a compliance flag is set (ZDR, no-train, or data residency), because operators can’t verify compliance. And when providerOptions.gateway.order is supplied.

Tier 2: Direct provider

The gateway calls the provider API directly using platform credentials (or BYOK credentials).

When it’s used: Default for standard requests, and the fallback when tier 1 fails. Only tier used when compliance routing is active.

Always used for: ZDR requests, no-train requests, BYOK with compliance flags.

Compliance mode

When zeroDataRetention or disallowPromptTraining is set:

Request → Tier 2: Direct Provider (verified only) → Response

Tier 1 is bypassed. The gateway routes only to providers with verified compliance agreements. See Zero Data Retention for the trust model.

Routing control

MethodEffect
routing: "auto"Try both tiers (default)
routing: "operator"Operators only. Fails if no operator available.
X-Tangle-Blueprint: <id>Pin to operators under this Blueprint.
X-Tangle-Operator: <slug>Pin to a specific operator.
providerOptions.gateway.orderControl which providers are tried and in what order. Also skips operators.
providerOptions.gateway.onlyRestrict to these providers only.