This example shows how to use the Vercel AI SDK with Next.js and Amazon Bedrock to create a ChatGPT-like AI-powered streaming chat bot.
Deploy the example using Vercel:
To run the example locally you need to:
- Create an AWS Account.
- Setup Amazon Bedrock and apply for access to the models that you want to use.
- Setup an access key under "Security Credentials".
- Set the region of the models, your access key and your secret access key as shown in the example env file but in a new file called
.env.local
pnpm install
to install the required dependencies.pnpm dev
to launch the development server.- Go to the browser and try out a chatbot example for one of the following models:
- Anthropic Claude:
anthropic.claude-v2
- Cohere:
cohere.command-light-text-v14
- Llama 2:
meta.llama2-13b-chat-v1
- Anthropic Claude:
To learn more about AWS Bedrock, Next.js, and the Vercel AI SDK take a look at the following resources:
- Vercel AI SDK docs
- Vercel AI Playground
- AWS Bedrock
- Next.js Documentation - learn about Next.js features and API.