# Provider Routing & Failover

Requests are not served by a single compute backend. The gateway maintains connections to multiple inference providers and routes each request based on availability, latency, and capacity.

If the primary provider for a given model fails or times out, the gateway automatically retries with the next available provider. This happens transparently, the client receives a response without knowing which backend served it.

The routing layer also handles:

* **Load distribution** across providers to avoid concentration on a single backend
* **Latency optimization** by selecting the fastest responding provider for each request
* **Model availability** — if a model is temporarily unavailable on one provider, the gateway routes to an alternative that serves the same model

The developer does not configure any of this. From the client perspective, there is one endpoint, one model name, and one response.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cluster-protocol.gitbook.io/whitepaper/core-infrastructure/overview/inference-engine/provider-routing-and-failover.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
