
This example demonstrates how to use the Vercel AI SDK with Next.js, Feature Flags, and Edge Config to create a flexible AI-powered application with dynamic model switching capabilities.
Run create-next-app with npm, Yarn, or pnpm to bootstrap the example:
To run the example locally you need to:
.env.example file, but in a new file called .env.npm install to install the required dependencies.npm run dev to launch the development server.Note: you can generate the value for the FLAGS_SECRET by running the following code in your terminal:
To run the node-example.ts file run the following command in your terminal
To learn more about Vercel AI SDK, Next.js, Feature Flags, and Edge Config, take a look at the following resources: