Why architecture matters here
Streaming fails on proxies that buffer, missing cancellation, and no idle timeout. Architecture matters because HTTP + serving + client combine.
Advertisement
The architecture: every piece explained
The top strip is the primary path. Client opens SSE. Serving engine token-by-token. Chunked encoding flushes tokens. UI render streams.
The middle row is control. Cancellation. Rate + throttling. Structured output stream. Tool call events.
The lower rows are ops. Timeouts. Observability. Ops — proxies + LB + retry.
Advertisement
End-to-end flow
End-to-end: user asks. Client opens SSE. Server generates + flushes each token. UI appends. User closes tab; server detects; cancellation aborts generation. Tool call event streamed as typed message. Metrics show TTFT p50 250ms.