--- title: AI Chatbot emoji: 💬 colorFrom: blue colorTo: green sdk: docker app_port: 7860 pinned: false license: mit --- # AI Chatbot on Hugging Face Spaces This is a deployment of the Next.js AI Chatbot on Hugging Face Spaces. It's a powerful, open-source chatbot template built with Next.js and the AI SDK. ## Features - **Next.js App Router**: Advanced routing with React Server Components - **AI SDK**: Unified API for generating text with multiple LLM providers - **Modern UI**: Built with shadcn/ui and Tailwind CSS - **Data Persistence**: Supports PostgreSQL and file storage - **Authentication**: Secure authentication with Auth.js ## Configuration To run this application, you'll need to set up the following environment variables in your Hugging Face Space settings: ### Required Environment Variables ``` AUTH_SECRET=your_auth_secret_here ``` ### AI Provider Configuration Choose one or more AI providers: #### xAI (Default) ``` XAI_API_KEY=your_xai_api_key_here ``` #### OpenAI ``` OPENAI_API_KEY=your_openai_api_key_here ``` #### Other Providers Refer to the [AI SDK documentation](https://sdk.vercel.ai/providers/ai-sdk-providers) for configuration details. ### Database Configuration (Optional) For persistent chat history: ``` POSTGRES_URL=your_postgres_connection_string ``` ### Storage Configuration (Optional) For file uploads: ``` BLOB_READ_WRITE_TOKEN=your_blob_token ``` ## Local Development To run this locally: 1. Clone the repository 2. Copy `.env.example` to `.env` and fill in your API keys 3. Install dependencies: `pnpm install` 4. Run the development server: `pnpm dev` ## Deployment Notes This Space runs on port 7860 as required by Hugging Face Spaces. The application is containerized using Docker for consistent deployment. ## License MIT License ## Links - [GitHub Repository](https://github.com/vercel/ai-chatbot) - [Documentation](https://chat-sdk.dev) - [AI SDK](https://sdk.vercel.ai/docs)