Skip to main content
Middleware integration for the Vercel AI SDK. Adds cascade routing to AI SDK applications with streaming support.

Install

createChatHandler

Creates a request handler for AI SDK chat endpoints.

Options

Features

  • AI SDK v4 data stream and v5/v6 UI streams
  • useChat multi-turn support
  • parts message format (AI SDK v6)
  • Tool call streaming visibility
  • Server-side tool execution loops
  • Multi-step controls
  • Cascade decision stream parts
  • Request-level overrides with allowlist