Streaming
Sending the answer out token by token as it is generated, so text types itself onto the screen instead of landing all at once.
See it
What it is
A model generates one token at a time anyway. Streaming just refuses to hold them back: the server forwards each token the moment it exists, usually over Server-Sent Events or a chunked HTTP response, and the UI appends it. The full answer takes exactly as long either way. It only feels four times faster because the wait is filled.
Reach for it any time a response takes more than about a second, which is most of them. It also buys you real features: a stop button that drops the request the moment the user asks, partial output you can keep when a request dies halfway, and tool calls you can show as they happen instead of after the fact.
Gotchas: streamed markdown is broken markdown for most of its life, so a naive renderer will flash half-open code fences and stray asterisks. Streaming also fights caching, JSON parsing (a partial object is not valid JSON), and buffering proxies that hold your chunks hostage until the response ends. And autoscrolling on every chunk will trap a user who scrolled up to read. One more: aborting the connection reliably stops your client from waiting, but whether the provider stops generating (and stops charging you) is up to the provider, so read their cancellation docs before you promise anyone it saves money.
Ask AI for it
Add token streaming to this chat feature. On the server, call the model with streaming enabled and pipe the deltas to the client over Server-Sent Events with no response buffering. On the client, append each chunk to the in-progress message, render markdown incrementally (tolerate unclosed code fences and half-written links), and autoscroll only while the user is already pinned to the bottom. Wire a stop button to an AbortController that cancels the request, and check the provider's documented cancellation behaviour before claiming anything about it in the UI, since aborting the stream does not necessarily halt server-side generation or billing. On a mid-stream error, keep the text received so far plus a retry affordance.