Streaming Fundamentals
How a streamed answer really arrives: bytes, text, Server-Sent Events and the chunk format, then rendering and scrolling it smoothly. Mitra learns to stream.
Phase 0 read a stream with a few lines and trusted them. This phase opens the box. You will see what a response body really is (a ReadableStream of bytes), why bytes must be turned into text with care (an emoji can arrive cut in half), what a Server-Sent Events message looks like on the wire, and how to read the OpenAI-compatible chunk format that most providers speak.
Then the screen side: how to show hundreds of tokens without making the page stutter, and how to scroll while text arrives without fighting a reader who has scrolled up to re-read something.
Everything here uses plain fetch, with no SDK, against a scripted stand-in model inside the page. In Phase 5 an SDK will do this work for you. You will then know exactly what it is doing, and what to look at when something breaks. By the end, Mitra streams its answers with a parser that survives every split.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.