ai-sdk

Implement AI SDK features with current APIs and Vercel AI Gateway.

27|16|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/mandor1428/TEAM-LLM --skill ai-sdk-mandor1428
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-sdk
Source: https://github.com/mandor1428/TEAM-LLM/tree/main/skills/use-ai-sdk
Command: npx skills add https://github.com/mandor1428/TEAM-LLM --skill ai-sdk-mandor1428

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps developers build and debug AI-powered features with the AI SDK without relying on outdated memory, by forcing verification against current docs and local source.

Core Features & Use Cases

  • Correct, up-to-date SDK usage: Guides users to install only the core ai package first, then verify APIs by searching node_modules/ai/docs/ and node_modules/ai/src/.
  • Provider-agnostic model selection: Directs users to use Vercel AI Gateway and to fetch the latest model IDs dynamically, then pick the newest model version.
  • Safer React/chat integration: Warns that useChat has changed and provides references for common client mistakes (including streaming and tool calling state handling).
  • Agent/tool workflow patterns: Recommends using ToolLoopAgent and emphasizes type-safe tool rendering via InferAgentUIMessage and typed tool parts.

Quick Start

Ask: "Help me implement generateText or streamText with AI SDK using Vercel AI Gateway, and show how to select the newest model ID for OpenAI, Anthropic, or Google."

Frequently Asked Questions about ai-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement streaming text generation with the AI SDK without using outdated APIs?

To implement streaming text generation safely, install the core `ai` package and verify current `streamText` APIs by searching `node_modules/ai/docs/` and `node_modules/ai/src/` before writing code. This prevents relying on outdated memory and ensures correct usage.

What's the best way to select AI provider models dynamically using Vercel AI Gateway?

The best way to select models is using Vercel AI Gateway to fetch current model IDs dynamically, then picking the newest model version for OpenAI, Anthropic, or Google. This provider-agnostic approach ensures you always use valid, up-to-date models.

How does tool calling work with React useChat in the AI SDK?

Tool calling with `useChat` requires handling updated state and type-safe tool rendering. The Skill warns that `useChat` has changed and provides references for common client mistakes, emphasizing typed tool parts and `InferAgentUIMessage` for safe rendering.

Can I build agents with structured outputs using the AI SDK?

Yes, you can build agents with structured outputs by using the `ToolLoopAgent` pattern. The Skill guides applying type-safe patterns for agents and tool-part rendering, ensuring reliable structured output generation and tool execution.

Why does my AI SDK useChat hook integration have streaming or tool calling errors?

Your `useChat` integration errors likely stem from recent API changes affecting streaming and tool calling state handling. The Skill provides references for common client mistakes to help debug and correct outdated React hook implementations.

Do I need to install provider packages separately to use the AI SDK?

No, you should install only the core `ai` package first. You can then use Vercel AI Gateway for provider-agnostic model selection, fetching current model IDs dynamically without needing separate provider-specific package installations.