Chat SDK is a free, open-source template built with TanStack Start and the AI SDK that helps you quickly build powerful chatbot applications.
This project is a fork of vercel/ai-chatbot, adapted for the TanStack ecosystem.
Features · Planned Features · Model Providers · Deploy Your Own · Running locally
- TanStack Start
- Full-stack React framework with server-side rendering and streaming
- TanStack Router
- 100% type-safe routing for React
- TanStack Query
- Powerful asynchronous state management
- TanStack Form
- Headless, type-safe form management
- AI SDK
- Unified API for generating text, structured objects, and tool calls with LLMs
- Hooks for building dynamic chat and generative user interfaces
- Supports xAI (default), OpenAI, Fireworks, and other model providers
- shadcn/ui
- Styling with Tailwind CSS
- Component primitives from Radix UI for accessibility and flexibility
- Data Persistence
- Drizzle ORM with Postgres (e.g., Neon) for saving chat history and user data
- Vercel Blob for efficient file storage
- Better Auth
- Comprehensive and secure authentication
- Migrate to TanStack AI: When the TanStack AI package becomes stable enough, we plan to migrate from the Vercel AI SDK to maintain consistency with the TanStack ecosystem.
This template uses the Vercel AI Gateway to access multiple AI models through a unified interface. The default configuration includes xAI models (grok-2-vision-1212, grok-3-mini) routed through the gateway.
For Vercel deployments: Authentication is handled automatically via OIDC tokens.
For non-Vercel deployments: You need to provide an AI Gateway API key by setting the AI_GATEWAY_API_KEY environment variable in your .env file.
With the AI SDK, you can also switch to direct LLM providers like OpenAI, Anthropic, Cohere, and many more with just a few lines of code.
You can deploy your own version of this Chatbot to Vercel.
You will need to use the environment variables defined in .env.example to run the chatbot.
Note: You should not commit your
.envfile or it will expose secrets that will allow others to control access to your various AI and authentication provider accounts.
- Install dependencies:
pnpm install- Setup the database:
pnpm run db:migrate- Start the development server:
pnpm run devYour app template should now be running on localhost:3000.
