This template scaffolds a simple LangChain.js + Next.js starter template. It has one endpoint, POST /api/chat
, that streams back a model call to
the frontend. It uses Vercel's ai
SDK to pipe the stream back to the client as well as display the incoming messages.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
To learn more about what you can do with LangChain.js, check out the docs here:
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out the Next.js deployment documentation for more details.