Skip to content

This is a Django-based Chatgpt clone, designed to help developers create their own custom LLM Chat Interface

License

Notifications You must be signed in to change notification settings

HasanAbdelhady/Chatgpt-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modern ChatGPT Clone

A fully-functional LLM Interface built with Django and Groq API. This project serves as a starting point for developers looking to create their own AI chat applications with customized features.

chatgpt_clone_demo.mp4

image image image image image image

Features

  • 🚀 Real-time streaming responses
  • 🎨 Modern, responsive UI with cyberpunk theme
  • 📁 File upload and processing capabilities
  • 👤 User authentication and profile management
  • 💾 Chat history and management

Tech Stack

  • Django 5.1.7
  • Groq API
  • TailwindCSS
  • JavaScript (Vanilla)
  • SQLite (can be configured for other databases)

Installation

  1. Clone the repository:
git clone https://github.com/HasanAbdelhady/Chatgpt-clone.git
  1. Create and activate virtual environment:
python -m venv venv
# On Windows:
venv\Scripts\activate
# On Unix or MacOS:
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a file and name it .env in the root directory:
GROQ_API_KEY=your_groq_api_key_here
JWT_SECRET=your_jwt_secret_key_here
JWT_ACCESS_TOKEN_EXPIRE_MINUTES=1440 (or your desired number)
JWT_REFRESH_TOKEN_EXPIRE_MINUTES=30

Get your GROQ API Key from here ( it's free ): https://console.groq.com/keys

  1. Run migrations:
python manage.py makemigrations
python manage.py migrate
  1. You can create a superuser (admin) via: ( You don't have to; you can just register from the registration page.)
python manage.py createsuperuser
  1. Run the development server:
python manage.py runserver

Visit http://127.0.0.1:8000 to see the application in action!

Customization

Changing the AI Model

  • You can update the SYSTEM_PROMPT in chat/views.py
  • Or Change the self.default_model in chat/ai_models.py to your desired model from GROQ

Adding Features

  1. Create new models in models.py
  2. Add views in views.py
  3. Create templates in templates/
  4. Update URLs in urls.py

Contributing

The current version still needs some improvement, so feel free to make your own version.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/SomeFeature)
  3. Commit your changes (git commit -m 'Add SomeFeature')
  4. Push to the branch (git push origin feature/SomeFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you find this project helpful, please give it a ⭐️!

For issues, questions, or contributions, please open an issue or PR.


About

This is a Django-based Chatgpt clone, designed to help developers create their own custom LLM Chat Interface

Topics

Resources

License

Stars

Watchers

Forks