Long Requests and Timeouts
A large language model can take minutes to answer. A very long prompt can take minutes before the first word appears, and a reasoning model can pause for a long time between parts of its answer. The platform keeps such a request alive, and it tells the client clearly when it gives up.
How Long a Request May Take
| Limit | Value | What the client sees |
|---|---|---|
| Whole request | 10 minutes for the answer to start | 502 with the reason |
| First part of a streamed answer | grows with the prompt: 10 seconds for a short prompt, about 5 minutes for a half-megabyte prompt, never more than 10 minutes | 503 with Retry-After: 2 and the code ttft_deadline_exceeded; an error event inside the stream when the stream had already started |
| Silence between two parts of a streamed answer | 2 minutes | an error event inside the stream: the model has stalled |
When the platform gives up on a request, it also stops the model working on it, so a stopped request does not keep a GPU busy.
What a Streaming Client Sees
- Within 2 seconds the response starts: status
200, the headers, and a first line: stream-open. - Every 15 seconds while the model is silent, before the first word and between parts, a line
: keepalive. - Lines that start with
:are comments in the event-stream format. Every client library ignores them; they exist so that nothing between the client and the platform mistakes a thinking model for a dead connection. - A fast error (a bad parameter, for example) still arrives with the model's own status code and reason, because it happens before the stream starts.
- An error after the stream started arrives as an error event inside the stream, never as a stream that just stops. A stream that ends without an error or its normal end marker was cut by something between the client and the platform.
Non-Streamed Requests
A non-streamed request receives its whole answer at the end and nothing before it. If anything between the client and the platform closes connections that stay silent (see below), use streaming for long answers.
When a Client Gives Up
A client that closes its connection before the answer starts stops the model's work on that request at once. Set the client's own timeout to at least 10 minutes for long answers; a shorter client timeout wastes the work done so far.
When the Platform Restarts
A restart or update of the API gateway lets requests that are already running finish, for up to 10 minutes, before it stops. New requests are not accepted during that time.
A Proxy or Load Balancer in Front of the API Gateway
Anything placed between clients and the API gateway (a reverse proxy, a load balancer, an ingress) must allow what the platform allows, or it cuts long requests off itself:
| Setting | At least |
|---|---|
| Request timeout (the whole request) | 600 seconds |
| Idle or read timeout (time between two bytes) | 60 seconds. Streams send a byte at least every 15 seconds; a non-streamed request sends nothing until its answer is complete, so it needs the full 600 seconds here |
| Response buffering | off for text/event-stream responses. The platform sends X-Accel-Buffering: no and Cache-Control: no-cache, no-transform on every stream |
| Compression | off for text/event-stream responses |
Defaults that are too short and have cut requests off in practice:
| Product | Setting | Default |
|---|---|---|
| Envoy, Envoy Gateway | route request timeout | 15 seconds |
| nginx | proxy_read_timeout | 60 seconds |
| Cloud load balancers | idle timeout | often 60 seconds |
The symptom of a proxy limit that is too short: requests fail after exactly the same number of seconds every time, with 504 or a closed connection, while the same request sent straight to the API gateway succeeds.
Which Alert Points at a Connection Problem
These alerts appear on the Alerts page. Each names the inference node or model it is about.
| Alert | What it means | What to do |
|---|---|---|
| Inference node keeps losing its connection to the API gateway | The connection between an inference node and the API gateway ended at least twice in 30 minutes; requests to that node's models failed each time. | A fixed rhythm points at a setting on the node or the gateway; an irregular one points at the network between them. Check both logs for the reason given at each end. |
| Inference node's connection to the API gateway is stalled | The connection is open, but nothing answers over it; requests hang. | If it recovers on its own, the connection was failing. If it persists, check the inference node's log and restart the model from the Servers page. |
| Inference node has no connection to the API gateway | The node is up but none of its models can be reached by clients. | Check that the API gateway is running and that the node can reach the API gateway address under Configuration. |
| Requests to a model failed because a connection dropped | Clients got errors because the connection ended during their requests. | Look at the connection alerts for the same inference node: they name the cause. |
| Model is running but the API gateway does not route to it | The Servers page shows the model running, but clients cannot reach it. | Check the node's connection to the API gateway; restarting the model registers it again. |
| Model's engine answers its health check slowly | The model still works, but slowly; requests are likely stalling. | Check the model's console log on the Servers page; a restart clears a hung engine. |
| Requests to a model keep failing | More than 10% of real client requests failed over 10 minutes. | Check the model's console log for the engine's errors, and the connection alerts for its inference node. |