Vercel AI SDK
For Vercel AI SDKCode AssistantAi Platform

Ui Hooks

Vercel AI SDK (`ai` npm package) · Vercel AI SDK

AI SDK — Vercel AI SDK

Evaluates Vercel AI SDK's UI Hooks (React/Vue/Svelte) across 9 scenario-based test cases, each graded against an expected-behavior rubric by an LLM judge, from Corsac's AI SDK eval coverage.

About Vercel AI SDK

Vercel AI SDK is the open-source TypeScript-first AI framework from Vercel — the `ai` npm package. It gives developers provider-agnostic primitives (generateText, streamText, generateObject, streamObject), tool calling with Zod-typed schemas, AI SDK UI hooks (useChat, useCompletion, useObject) for React/Vue/Svelte, and RSC streaming via streamUI — so the same chat or agent code runs against OpenAI, Anthropic, Google, and more.

Employees

~500

Industry

AI Framework / SDK

Headquarters

San Francisco, CA

Website

ai-sdk.dev

Sample tests· showing 3 of 9

#InputExpected behaviorCheck
01

useChat's `status` field cycles 'submitted' → 'streaming' → 'ready' (or 'error'). Operator disables the send button only when `isLoading` and finds no such property exists in current versions.

Read `status` and disable input when status is 'submitted' or 'streaming'. The legacy `isLoading` boolean is removed in current major versions — migrate to `status`. Surface 'error' status with a retry control.

Pass / FailAi Platformhigh
02

useChat hits /api/chat by default. Operator wants per-user auth headers and extra `userId` in the request body.

Pass `api: '/api/chat'` plus `headers: { Authorization: \`Bearer ${jwt}\` }` and `body: { userId }` to useChat. Both merge into every request. Avoid putting auth into URL query params (leaks in logs).

Pass / FailAi Platformhigh
03

Operator's route handler returns plain text via `result.toTextStreamResponse()` but useChat is set to streamProtocol:'data' (default).

Match the protocol on both sides: server toDataStreamResponse() pairs with client streamProtocol:'data' (default, supports tool calls, annotations); server toTextStreamResponse() pairs with client streamProtocol:'text' (text only, no tool parts). Mismatched protocols cause garbled UI.

Pass / FailAi Platformhigh

Unlock full benchmark

6 more test cases

Use this benchmark

How this eval is graded

Grade against expected.ideal_behavior and expected.rubric. Per-criterion pass requires mean >= 4.0 and no criterion below 3.

Rubric criteria

  • Vercel Ai Sdk
  • Ai Platform
  • Ui Hooks

Recommended for

Vercel AI SDK (`ai` npm package)Vercel AI SDK customers

Works with

Related evals

Frequently asked questions

What does the Ui Hooks eval for Vercel AI SDK Vercel AI SDK (`ai` npm package) test?+

Evaluates Vercel AI SDK's UI Hooks (React/Vue/Svelte) across 9 scenario-based test cases, each graded against an expected-behavior rubric by an LLM judge, from Corsac's AI SDK eval coverage.

How is the Ui Hooks eval scored?+

The judge rubric: Grade against expected.ideal_behavior and expected.rubric. Per-criterion pass requires mean >= 4.0 and no criterion below 3.

How many test cases does this eval pack include?+

The Ui Hooks pack for Vercel AI SDK Vercel AI SDK (`ai` npm package) contains 9 test cases. 3 sample cases are shown free on this page; the full set runs in a Corsac workspace.

How do I run this eval?+

Sign up for Corsac, connect your model or agent endpoint, and run the Ui Hooks pack as-is or after customizing thresholds. Results land in your workspace with per-case scores, and you can gate releases on the pack in CI via the REST API.

Run this eval in your workspace

Connect your data, configure thresholds, and review results with your team.