Welcome to ChatLLama, a modern real-time chat application that leverages local Ollama models for an interactive AI-based messaging experience. ChatLLama provides secure user authentication, a responsive UI styled with Tailwind CSS, and seamless communication through Socket.io. Whether you're looking to chat with an intelligent AI or interact with friends, ChatLLama offers a robust and dynamic platform for real-time conversations.
- Real-Time Messaging: Engage in dynamic, live conversations enabled by Socket.io with smooth, streaming chat responses.
- Local AI Integration: Interact with local Ollama models that process your messages and deliver intelligent, streamed responses.
- Secure User Authentication: Register and log in safely with bcrypt-based password hashing and Gmail address verification.
- Responsive & Modern UI: Experience a sleek interface built with Tailwind CSS and enhanced with FontAwesome icons.
- Robust Database Integration: All user data is securely stored in a MongoDB database.
- Dynamic Environment Configuration: Automatically configures environment variables such as FRONTEND_ORIGIN based on your local IP.
- Model Selection: Users can select from various AI models for personalized interactions.
- Frontend: HTML, Tailwind CSS, JavaScript (ES6+), EJS, Socket.io client
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: bcrypt
- Real-Time Communication: Socket.io
- AI Integration: Local Ollama Models
- Node.js (v14 or above)
- MongoDB (running instance)
- npm
- Local Ollama API (e.g., running at http://localhost:11434)
To set up MongoDB for ChatLLama:
-
Install and Start MongoDB:
- Download and install MongoDB from the MongoDB Download Center.
- Start the MongoDB service on your machine.
-
Create the Database and Collection:
- Open your terminal and run the Mongo shell:
mongo
- Switch to (or create) the
ChatLLama
database:use ChatLLama
- Create the
users
collection:db.createCollection("users")
- Verify that the collection was created:
show collections
- Open your terminal and run the Mongo shell:
-
Clone the Repository:
git clone https://github.com/GitCoder052023/ChatLLama.git cd ChatLLama
-
Install Dependencies:
npm install
-
Set Up Environment Variables:
- Create a
.env
file in the root directory. - Add at least the following variable (the app auto-updates additional variables on startup):
OLLAMA_API_URL=http://localhost:11434
- Create a
-
Run the Application:
To start the frontend, backend, and Tailwind CSS build concurrently, run:
npm run dev
- The frontend server runs at http://localhost:3001.
- The backend server runs at http://localhost:5000.
-
User Registration:
- Navigate to the Sign-Up page.
- Register a new account (please ensure your email ends with
@gmail.com
as required).
-
Login:
- Sign into your account to access the chat interface.
-
Chat:
- Use the intuitive chat interface to send messages and receive streaming responses from the local AI.
- Select your preferred AI model from the dropdown menu for personalized interactions.
- Enjoy real-time updates via Socket.io.
-
Logout:
- Log out securely using the profile menu.
We welcome contributions to make ChatLLama even better! To contribute:
- Fork the repository and create a feature or bugfix branch.
- Adhere to the existing code style and conventions.
- Ensure your changes do not break existing functionality.
- Submit a pull request with clear commit messages and reference any related issues.
For further details, please review CONTRIBUTING.md and CODE_OF_CONDUCT.md.
This project is licensed under the MIT License. See LICENSE for more information.
For questions, support, or further inquiries, please contact us at contact.khub.dev@gmail.com.