Skip to content

Quantum-Leap-Labs/chatgpt-clone

 
 

Repository files navigation

working again ; ) I am very busy at the moment so I would be very thankful for contributions and PR's

To do

ChatGPT Clone

feel free to improve the code / suggest improvements

image

Getting Started

To get started with this project, you'll need to clone the repository and set up a virtual environment. This will allow you to install the required dependencies without affecting your system-wide Python installation.

Prequisites

Before you can set up a virtual environment, you'll need to have Python installed on your system. You can download Python from the official website: https://www.python.org/downloads/

Cloning the Repository

Run the following command to clone the repository:

git clone https://github.com/xtekky/chatgpt-clone.git

Setting up a Virtual Environment

To set up a virtual environment, follow these steps:

  1. Navigate to the root directory of your project.
cd chatgpt-clone
  1. Run the following command to create a new virtual environment:
python -m venv venv
  1. Activate the virtual environment by running the following command:
source venv/bin/activate

If you are using fish shell, the command will be slightly different:

source venv/bin/activate.fish

If you're on Windows, the command will be slightly different:

venv\Scripts\activate
  1. Install the required dependencies by running the following command:
pip install -r requirements.txt

Configure the Application

To configure the application, there are a few properties that can be set either via the environment or via config.json. The environment variable takes priority.

Field Env Variable config.json examples
The OpenAI Api Key OPENAI_API_KEY openai_key sk-...
The OpenAI Base URL OPENAI_API_BASE openai_api_base https://api.openai.com
http://my-reverse-proxy/

Use the Base URL if you need to run your queries through a reverse proxy (like this one which will run your queries through Azure's OpenAI endpoints )

Running the Application

To run the application, make sure the virtual environment is active and run the following command:

python run.py

Docker

The easiest way to run ChatGPT Clone is by using docker

docker-compose up

This is ER diagram for Quantum Leap Chatbot

In this diagram there are 4 table

Database Design:

User Table:

    user_id (Primary Key) 
    first_name 
    last_name 
    username 
    password (Stored as a hash)
    affiliation 
    account_type

ChatSession Table:

    session_id (Primary Key) 
    user_id (Foreign Key referencing User Table) 
    start_timestamp (Timestamp of session start) 
    end_timestamp (Timestamp of session end, can be NULL if session is ongoing)

Message Table:

    message_id (Primary Key) 
    session_id (Foreign Key referencing ChatSession Table) 
    content (Message content) 
    is_bot (bool) 
    timestamp (Timestamp of the message) 

UserPicture Table:

    picture_id (Primary Key) 
    message_id (Foreign Key referencing Message Table) 
    picture_data (Binary data of the picture) 
    upload_timestamp (Timestamp of when the picture was uploaded) 




ERD

About

ChatGPT interface with better UI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 37.5%
  • JavaScript 24.6%
  • CSS 23.8%
  • HTML 12.2%
  • Other 1.9%