A Next.js-based AI chatbot that provides helpful assistance using DeepSeek's language models. The chatbot acts as a friendly and professional assistant, offering concise and safe responses to your queries.
- π€ AI-powered assistance using DeepSeek models
- π¬ General-purpose conversational capabilities
- β‘ Real-time streaming responses
- π¨ Clean, responsive UI built with Tailwind CSS
- π± Markdown rendering for formatted responses
- π‘οΈ Safe and helpful responses
This application currently supports the following DeepSeek models:
- DeepSeek Chat (
deepseek-chat) - The primary model used for general assistance
Before running this application, ensure you have:
- Node.js 18+ installed
- A DeepSeek API key (get one from DeepSeek's platform)
- pnpm package manager (recommended) or npm/yarn
-
Clone the repository
git clone <your-repo-url> cd ai-chatbot
-
Install dependencies
pnpm install # or npm install # or yarn install
-
Set up environment variables
cp .env.example .env.local
Edit
.env.localand add your DeepSeek API key:DEEPSEEK_API_KEY=your_actual_deepseek_api_key_here
pnpm dev
# or
npm run dev
# or
yarn devOpen http://localhost:3000 in your browser to see the application.
pnpm build
pnpm start
# or
npm run build
npm start
# or
yarn build
yarn start- Start the application using the commands above
- Open your browser to
http://localhost:3000 - Enter your questions or requests in the chat input field
- Get helpful responses - The AI assistant will provide concise and useful answers
- Input: "Can you help me with a coding problem?"
- Output: The AI will provide assistance with your coding question
- Input: "What's the weather like today?"
- Output: The AI will respond with weather information or guidance
- Framework: Next.js 15.5.2 with App Router
- AI SDK: Vercel AI SDK with DeepSeek integration
- Frontend: React 19 with TypeScript
- Styling: Tailwind CSS
- Markdown: React Markdown for formatted responses
- State Management: React Query for efficient data handling
The chatbot uses a system prompt that configures the AI to:
- Respond politely and professionally
- Provide concise answers
- Avoid unnecessary repetition
- Always provide safe and helpful responses
- Be friendly and approachable
| Variable | Description | Required |
|---|---|---|
DEEPSEEK_API_KEY |
Your DeepSeek API key for model access | Yes |
ai-chatbot/
βββ src/
β βββ app/
β β βββ api/
β β β βββ chat/
β β β βββ route.ts # API endpoint for chat
β β βββ components/
β β β βββ DeepSeekChat.tsx # Main chat component
β β β βββ MemoisedMarkdown.tsx # Markdown renderer
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β β βββ globals.css # Global styles
βββ .env.example # Environment template
βββ package.json # Dependencies
βββ README.md # This file
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the DeepSeek documentation for API-related issues
- Review the Next.js documentation for framework questions
- Open an issue in this repository for application-specific problems