WhoBuilt

AI SDK v5: A Crash Course

Sep 9, 2025· 23 min· 17K views·Watch on YouTube

Speaker

Matt Pocock, who teaches TypeScript and AI, presents an AI SDK v5 crash course at React Universe Conf 2025, hosted by Callstack.

Learn AI through its behavior

Pocock describes AI as a black box and argues developers can learn more by using it than by trying to understand its internals. He recommends building AI-powered apps to see how models behave in practice.

Use one SDK across models

He introduces the AI SDK’s Core for server-side work and UI libraries for connecting front ends, including React, Svelte, Vue, and Angular. Its unified API supports providers such as Google and Anthropic, so switching models can take a small code change.

Generate and stream useful results

Pocock demonstrates `generateText` for a complete response and `generateObject` with a Zod schema to produce validated structured data. He then shows `streamText` and `streamObject`, which deliver text or partial objects as they are generated, improving time to first token for interactive interfaces.

Connect chat interfaces to models

The React example uses `useChat` to manage messages and send them to an API route. On the server, the route converts UI messages into model messages, streams a response, and sends it back to the client as text deltas.

Build type-safe tools and agent loops

Pocock defines file system tools with Zod input schemas and execution functions, then shows a model reading a to-do file and summarizing its contents. AI SDK v5 can carry tool types through to UI message rendering, while a step limit lets the model call a tool, receive its result, and continue.

Takeaways

  • Start learning model behavior by building small applications that use AI.
  • Use a provider-agnostic SDK interface to make model comparisons and switches easier.
  • Use Zod schemas to validate structured model output at runtime.
  • Stream responses for interfaces where time to first token matters.
  • Set an explicit step limit when giving an agent control over tool-calling loops.

Mentioned in this talk

Search inside this talk

What was claimed 12

  • built
    Verified10 sources· Talk, Web, Job posting· archived
  • feature
    AI SDK: Core and UI parts; Core runs wherever JavaScript runs, and UI connects frontend frameworks to Core
    “The AI SDK comes in two main parts. You've got the Core ... Then you've got the UI part, which links up to the Core.”
    YouTube
    Unverified1 source· Talk
  • feature
    AI SDK: GenerateText generates text from a model and prompt
    “We have a generateText call.”
    YouTube
    Unverified1 source· Talk
  • integrates with
    AI SDK integrates with Google
    “a model, which we're importing from the Google AI SDK”
    YouTube
    Unverified1 source· Talk
  • feature
    AI SDK: GenerateObject returns structured JSON validated against a Zod schema
    “we can guarantee at runtime that object.result.object is an object with an array of fact strings”
    YouTube
    Unverified1 source· Talk
  • feature
    AI SDK: StreamText and streamObject stream generated text and partial structured objects
    “What if we could stream it in as the LLM generates it? We can, with streamText.”
    YouTube
    Unverified1 source· Talk
  • integrates with
    AI SDK integrates with Anthropic
    “How do I swap it to an Anthropic model? Well, I do this”
    YouTube
    Unverified1 source· Talk
  • feature
    subagents: An agent takes multiple steps and can react to feedback from the world
    “All you need is to get the LLM to take multiple steps and, at each step, receive some feedback from the world it's in.”
    YouTube
    Unverified1 source· Talk
Show all 12 facts

Related talks