All Questions
Llm Inference Serving hard

Responses stream to clients over SSE. A replica crashes after sending 400 of about 1,000 tokens. The client library automatically retries the original request on disconnect, and users now see duplicated paragraphs. What is the best fix?

  1. A Rely on the SSE Last-Event-ID header so the reconnected stream resumes at token 401 on whichever replica happens to receive the retry.
  2. B Buffer the full response on the server and send it only when generation completes, so a crash never exposes partial output to clients.
  3. C Have the client resend the prompt plus the 400 received tokens as a prefix to a healthy replica, which re-prefills them and continues generating.
  4. D Switch from SSE to WebSocket, whose bidirectional acknowledgments let a new replica replay exactly the tokens the client never acknowledged.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions