Resources

The AI SDK moves quickly (7.x already changed stream helpers, ESM-only, and the default Gateway). Prefer the official docs. Do not treat model IDs in this tutorial as frozen.


Official

When feeding docs to Cursor or Copilot, paste llms.txt instead of 2024–2025 posts that still show toDataStreamResponse.


Coming from 6.x — change these first

Old7.x
Node 18 / 20Node 22+, ESM
toDataStreamResponse()createUIMessageStreamResponse + toUIMessageStream
system:instructions:
message.contentmessage.parts
handleSubmit / hook-owned inputsendMessage({ text }) + your own useState
maxStepsstopWhen: isStepCount(n)

Full list: official Migration Guide 7.0. Optional: npx skills add vercel/ai --skill migrate-ai-sdk-v6-to-v7.


Common npm packages

PackageInstall when
aiAlways (Core + Gateway)
@ai-sdk/reactuseChat
zodTools and Output.object
@ai-sdk/openaiDirect OpenAI, not Gateway strings
@ai-sdk/openai-compatibleOllama and other /v1 servers
@ai-sdk/rscExperimental streamUI
@ai-sdk/harness + an adapterHarnessAgent

Official templates: Chatbot Starter, Multi-Modal Chat, Structured Object Streaming, Generative UI with RSC (experimental). Start from the Templates section on https://sdk.vercel.ai/docs.


Tutorial index

  1. Vercel AI SDK tutorial
  2. Introduction
  3. Installation
  4. Quick start
  5. useChat
  6. Streaming
  7. Tools
  8. RSC and streamUI
  9. Providers
  10. Next.js
  11. Practical examples

TutorialHow it relates
Next.jsApp Router, route handlers, env vars, deploy
React'use client', hooks, useState
TypeScriptTypes and Zod
OllamaLocal /v1 into the OpenAI Compatible provider
LangChainPython agents / RAG; this course is the TS full-stack path
Node.jsRuntime for scripts without Next.js

Contribute

This tutorial lives in Kenhuang Academy. When Gateway strings, the useChat signature, or stream helpers change, open an issue or PR and update docs/zh/ai-sdk/ and docs/en/ai-sdk/ together.

评论