Jump to section
Cheat sheet
Commands, the API changes that break old tutorials, the habits that mattered, and a primary-source reference index.
Cheat sheet
Commands worth memorising
vercel env pull .env.local # sync env vars from the linked project
vercel --prod # deploy to production
npx @ai-sdk/devtools@latest # inspect every LLM call → localhost:4983
npx @ai-sdk/codemod upgrade v7 # migrate an older AI SDK project
API changes that break old tutorials
| Old (pre-v5) | Current (AI SDK v7) |
|---|---|
useCompletion from 'ai/react' | useChat from '@ai-sdk/react' |
toDataStreamResponse() | createUIMessageStreamResponse({ stream: toUIMessageStream(...) }) |
openai('gpt-4o-mini') | 'provider/model' via AI Gateway |
generateObject() | Output.object() on generateText / an agent |
| hand-rolled tool loop | ToolLoopAgent |
stopWhen: stepCountIs(n) | stopWhen: isStepCount(n) |
useChat({ api }) | useChat({ transport: new DefaultChatTransport({ api }) }) |
@vercel/postgres | Neon via the Vercel Marketplace |
runtime = 'edge' for speed | Node by default; both on Fluid compute |
The six habits that made the difference
- Six-block prompts — data, layout, components, states, constraints, done-when. Every time.
- Context layer first —
AGENTS.mdand skills before code. It's why the prompts stayed short. - Contracts before code — one Zod schema per boundary. The form, the DB, and the model cannot disagree.
toModelOutputalways — rich data to your app, cheap tokens to the model.- Design the failure — every external call: timeout, retry, documented degraded path. Then test it.
- Deterministic in code — the model decides what to do. Never what a number is.
Reference index
Primary sources only. The ecosystem changed enough between 2024 and 2026 that secondary material is often confidently out of date — when something here disagrees with a blog post, trust these.
Generation — v0
Context layer — instructions and skills
Application layer — AI SDK v7
- AI SDK introduction — the current release and its core surfaces.
- Agents · Building agents
- Tools and tool calling
- Generating structured data
- MCP tools
- DevTools · Middleware
- Migration guides
Platform — routing, runtime, execution
- AI Gateway · model list
- Fluid compute · Active CPU pricing
- Runtimes · Edge runtime
- Sandbox
- Workflows · durable agents
- Functions usage and pricing
Data, protection, operations
- Postgres on Vercel · Neon · transition guide
- Storage overview
- BotID · get started · bot management
- Deployment protection · environment variables
- Vercel Agent · code review · investigations
Correctness and security
- OWASP Top 10 for LLM Applications
- OWASP ASVS
- Advanced tool use
- Next.js caching · Zod · OpenTelemetry
Progress in the original lab was stored per-browser. Every block above is copy-pasteable.