Design a ChatGPT-style streaming chat UI: token streaming, stop and retry, errors mid-stream and minimal re-renders

hardAbout 55 minutesUpdated System designProsystem-designaistreamingsseabortcontrollerre-renderserror-handlingaccessibility
Not solved

Share this question

Problem

Design the part of an AI assistant's web client (ChatGPT, Claude, Gemini) that turns a streamed model response into a smooth, reliable reply on screen. A user types a message and presses Send. Then:

  • the answer starts to appear within about a second and grows a few characters at a time, at 50 to 200 tokens per second, for answers of several thousand tokens with markdown and code;
  • a Stop button ends the answer early and keeps what has already appeared;
  • if anything fails part way (the network drops, the server reports an error, the stream goes silent, the user hits a rate limit), the partial answer stays on screen with a clear reason and a way to retry;
  • the conversation may already hold a hundred long messages, and typing, scrolling and the Stop button must stay responsive while text arrives;
  • the view follows new text, unless the user has scrolled up to read something;
  • screen reader users know when an answer starts and ends without hearing every token.

Ref. UR-1471 · © UIRound · uiround.com/questions/design-a-chatgpt-style-streaming-chat-ui-token-streaming-stop-and-retry-errors-mid-stream-and-minimal-re-renders

Stuck? Take a hint

Practise this round first

Work through the steps of a design framework on a 45-minute clock, writing notes as you would say them out loud. The model answer stays hidden until you finish, then you check your design against 10 checkpoints.

Requirements, Architecture, Data model, Interface, Optimizations. The common choice for frontend rounds. How it works

Private, and saved in this browser as you type. All your notes are on My lists.

Every question and answer7 days, one payment