AI Chat Assistant is a web application that allows users to interact with an AI-powered chatbot. The application uses the Llama 2 model via Replicate API for generating responses.
- Real-time chat interface
- AI-powered responses using Llama 2 model
- Server-side streaming for smooth conversation flow
- Responsive design
Before you begin, ensure you have met the following requirements:
- Node.js (v14 or later)
- npm (comes with Node.js)
- A Replicate API key
-
Clone the repository:
git clone https://github.com/your-username/ai-chat-assistant.git cd ai-chat-assistant
-
Install server dependencies:
cd server npm install
-
Install client dependencies:
cd ../client npm install
-
Create a
.env
file in theserver
directory and add your Replicate API key:REPLICATE_API_TOKEN=your_api_key_here
-
Start the server:
cd server npm run server
-
In a new terminal, start the client:
cd client npm run dev
-
Open your browser and navigate to
http://localhost:5173
(or the port specified by Vite). -
Start chatting with the AI assistant!
client/
: Frontend code (HTML, CSS, JavaScript)server/
: Backend code (Node.js, Express)server/server.js
: Main server fileclient/script.js
: Main client-side JavaScript fileclient/index.html
: Main HTML fileclient/style.css
: CSS styles
Contributions to the AI Chat Assistant project are welcome. Please feel free to submit a Pull Request.
This project is licensed under the ISC License.
- Replicate for providing the AI model API
- Express.js for the server framework
- Vite for the frontend build tool