Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Next.js chatbot using the Vercel AI SDK's streamText function with a provider registry to allow users to switch models.

ShipAny is a development framework for building AI SaaS, with rich built-in functional modules and business components, helping you quickly launch your website.
This example demonstrates how to use the Vercel AI SDK with Next.js and the experimental_createProviderRegistry function. This allows developers to easily handle multiple AI providers and models within their application, enabling users to switch between them seamlessly.
Key Features:
streamText function for efficient text streaming.Use Cases: This template is ideal for building advanced AI chatbots where flexibility in model choice is crucial. It's perfect for:
How to Use:
To get started, you can bootstrap the example using create-next-app:
npx create-next-app --example https://github.com/vercel-labs/ai-sdk-preview-provider-registry ai-sdk-preview-provider-registry-example
# or
yarn create next-app --example https://github.com/vercel-labs/ai-sdk-preview-provider-registry ai-sdk-preview-provider-registry-example
# or
pnpm create next-app --example https://github.com/vercel-labs/ai-sdk-preview-provider-registry ai-sdk-preview-provider-registry-exampleTo run the example locally:
OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY) in a new .env file, based on the .env.example.npm install to install dependencies.npm run dev to launch the development server.Learn More: