Streaming and UX
Show the first words in under a second: server-sent events, assembling a streamed reply, cancelling, partial JSON and streams that break midway.
A model writes one token at a time, and a long answer takes many seconds. A screen that stays blank until the last token arrives feels broken, even when the total time is the same. Streaming sends each piece as soon as it exists, so the reader starts reading after a fraction of a second. This phase teaches the machinery underneath: the server-sent events wire format, a parser built by hand, and the assembler that turns many small chunks back into text, tool calls, a stop reason and a token count.
Streaming also creates new ways to fail. A chunk can end in the middle of a line. A proxy can buffer everything and defeat the point. The user can press Stop and you keep paying for tokens nobody reads. The connection can drop with half a reply on screen. You will build each piece with a fake model (so every example is free, repeatable and runs in Python, Java and JavaScript) and use real-model labs to see the raw lines a real provider sends and the time to first token.
The phase ends with a playbook: an SSE parser, a stream assembler and a cancel-safe consumer that you can copy into a product. It assumes Phase 2 (the HTTP API under every SDK) and Phase 4 (JSON and validation).
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.