Skip to content

sergical/ai-chatbot-aws

Repository files navigation

Next.js 14 and App Router-ready AI chatbot.

An Open-Source AI Chatbot Template Built With Next.js and the AI SDK by Vercel. Deployed on AWS using SST. LLM provider: AWS Bedrock.

Features · Model Providers · Deploy Your Own · Running locally


Features

  • Next.js App Router
    • Advanced routing for seamless navigation and performance
    • React Server Components (RSCs) and Server Actions for server-side rendering and increased performance
  • SST
    • SST is a framework for building serverless applications. It provides a set of tools and libraries for building, deploying, and managing serverless applications.
    • SST is used to deploy the application to AWS.
  • AI SDK
    • Unified API for generating text, structured objects, and tool calls with LLMs
    • Hooks for building dynamic chat and generative user interfaces
    • Supports AWS Bedrock
  • shadcn/ui
  • Data Persistence
  • NextAuth.js
    • Simple and secure authentication

Model Providers

This template ships with Nova Pro amazon.nova-pro-v1:0 as the default using AWS Bedrock. However, with the AI SDK, you can switch LLM providers to OpenAI, Anthropic, Cohere, and many more with just a few lines of code.

For AWS Bedrock, you need to create an IAM role with the following user policies: AmazonBedrockFullAccess;

Then in the dashboard you need to enable the amazon.nova-pro-v1:0 model and any other models you want to use.

Make sure you set your Bedrock credentials using SST Secrets. See here.

Deploy Your Own

We're deploying to AWS using SST, read more about how to set up your environment variables here.

sst deploy --stage dev / production

Running locally

  • Configure your AWS credentials and CLI. Follow the instructions here.
  • Configure your AWS Bedrock credentials. Follow Model Provider instructions above.
  • Setup your environment variables (see sst.config.ts)
  • Run pnpm install to install the dependencies
  • Run sst dev to start the development server

Your app template should now be running on localhost:3000.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published