Skip to content
EN DE

Level 7: Streaming — Briefing

Advanced Streaming — Custom Data Parts, Message Metadata, Stream Transforms, and Error Handling for production apps. You’ll learn how to transport structured data alongside text in the stream, cleanly separate metadata from LLM content, smooth out stuttering streams, and catch errors without crashing your app.

Skill Tree — Level 7 Streaming is the current level
  • Custom Data Parts — transport structured data alongside text in the stream (progress bars, status updates, sources)
  • Message Metadata — attach additional information to messages that the LLM doesn’t see
  • Stream Transforms — smooth out stuttering streams with smoothStream and write custom transforms
  • Error Handling — catch errors in the stream, user-friendly messages, and retry strategies

In Level 1 you learned about streamText — writing tokens to the terminal one by one. That’s enough for prototypes. In production you need more: structured data alongside the text, clean metadata separation, smooth output, and robust error handling.

The concrete problem: your stream delivers only raw text. But your UI needs progress indicators, source citations, and status updates — and when the provider crashes mid-stream, your user sees a blank page.

  • Level 1: AI SDK Basics — specifically streamText, textStream, and fullStream (Challenge 1.4)
  • TypeScript — async/await, AsyncIterable, Generics
  • Basic understanding of Web StreamsTransformStream, ReadableStream (helpful but not required)

Working directory: Create a new folder level-7-streaming/ (or work in your existing project directory). No new packages needed — ai and @ai-sdk/anthropic from Level 1 are sufficient.

Skip hint: You’re already using smoothStream, Custom Data Parts, and onError in production? Jump straight to the Boss Fight and test your knowledge.

Build a Real-Time Dashboard: A streaming system that sends Custom Data Parts for status updates, uses Message Metadata for session tracking, applies smoothStream for smooth output, and catches errors gracefully — all in one project.

Part of AI Learning — free courses from prompt to production. Jan on LinkedIn