Skip to main content
cascadeflow integrates with the Vercel AI SDK as middleware, providing cascade routing for server-side AI applications with streaming support. The goal is still runtime intelligence inside the application loop: maintain streaming UX, keep tool execution server-side, and avoid a proxy hop on every model step.

Install

Quick Start

Features

  • AI SDK v4 data stream and AI SDK v5/v6 UI streams
  • useChat multi-turn support — conversation history preserved
  • parts message format (AI SDK v6)
  • Tool call streaming visibility — see tool calls as they happen
  • Server-side tool execution via toolExecutor or toolHandlers
  • Multi-step controls: maxSteps, forceDirect
  • Cascade decision stream parts — optional metadata in the stream
  • Request-level overrides with allowlist + shared-secret guard

Why This Integration Matters

  • Preserves fast real-time UX while adding runtime control
  • Keeps governance logic close to tool loops and streaming responses
  • Avoids the compounded latency cost of external proxy mediation

Multi-Turn Chat

Request Overrides

Override cascade behavior per request (protected by shared secret):

Result

40-85% cost savings for Vercel AI SDK applications with streaming support and zero client-side changes.