Vercel AI SDK
useChat Runtime
Overview
Integration with the Vercel AI SDK UI's useChat
hook.
It allows integration with OpenAI, Anthropic, Mistral, Perplexity, AWS Bedrock, Azure, Google Gemini, Hugging Face, Fireworks, Cohere, LangChain, Replicate, Ollama, and more.
Getting Started
Setup a backend route under /api/chat
@/app/api/chat/route.ts
Define a MyRuntimeProvider
component
@/app/MyRuntimeProvider.tsx
Wrap your app in MyRuntimeProvider
@/app/layout.tsx