Why OpenAI-Compatible Endpoints Hang for 180 Seconds Before Failing
A chat request that repeatedly stalls for about three minutes is a debugging clue rather than a diagnosis, since client deadlines, gateway timeouts, upstream delays, buffering, or retries can each contribute. The article notes that no universal OpenAI-compatible SDK setting called transport: sse exists, and that keys like streamIdleTimeoutMs belong to specific wrappers, so developers should rely on their client's documented options and request logs. It explains that read timeouts measure gaps between incoming data rather than whole-response duration, so a long-running stream can outlast them. Proxies such as nginx may buffer streamed chunks, and disabling buffering there is only a partial fix because other layers can still delay delivery. The piece also advises classifying failures by transport exceptions and HTTP status codes instead of matching error strings, and it includes a Python HTTPX example with retry handling.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in