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.
- Advanced Authentication:
- Bcrypt password hashing
- Session-based authentication
- Gmail address validation
- Secure logout handling
- Session timeout protection
- Profile Management:
- Auto-generated profile icons
- Dynamic initials display
- Unique color generation per user
- Hover animations and effects
- Responsive Design:
- Custom mobile-friendly sidebar
- Adaptive scrollbar styling
- Smooth transition animations
- Keyboard shortcut support
- Message Handling:
- Streaming control (pause/stop)
- Markdown formatting support
- Code syntax highlighting
- Expandable thinking sections
- Auto-scroll functionality
- Timestamp integration
- Model-specific labeling
- Management Tools:
- Session persistence
- Real-time synchronization
- Smart conversation naming
- Advanced search capabilities
- Secure deletion with confirmation
- Empty conversation prevention
- System Integration:
- WebSocket reconnection handling
- Automatic IP configuration
- CORS security setup
- MongoDB connection management
- Environment auto-configuration
- Concurrent development support
-
Theme Customization:
- Light, Dark, and System theme options
- Persistent theme preferences
- Automatic system theme detection
-
Conversation Management:
- Searchable conversation history
- Auto-generated conversation titles
- Real-time conversation updates
- One-click conversation deletion
-
Enhanced AI Interactions:
- Live streaming responses with thinking indicators
- Ability to stop ongoing AI responses
- Expandable reasoning sections for AI explanations
- Model-specific response tracking
-
UI Enhancements:
- Smooth animations and transitions
- Collapsible mobile-friendly sidebar
- Custom-styled scrollbars
- Message bubble animations
- Real-time typing indicators
- 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 i
-
Run the Application:
To start the application, run:
npm run dev
-
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.