working again ; ) I am very busy at the moment so I would be very thankful for contributions and PR's
- Double confirm when deleting conversation
- remember user preferences
- theme changer
- loading / exporting a conversation
- speech output and input (elevenlabs; ex: https://github.com/cogentapps/chat-with-gpt)
- load files, ex: https://github.com/mayooear/gpt4-pdf-chatbot-langchain
- better documentation
- use react / faster backend language ? (newbies may be more confused and discouraged to use it)
feel free to improve the code / suggest improvements
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.
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/
Run the following command to clone the repository:
git clone https://github.com/xtekky/chatgpt-clone.git
To set up a virtual environment, follow these steps:
- Navigate to the root directory of your project.
cd chatgpt-clone
- Run the following command to create a new virtual environment:
python -m venv venv
- 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
- Install the required dependencies by running the following command:
pip install -r requirements.txt
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_key | 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 )
To run the application, make sure the virtual environment is active and run the following command:
python run.py
The easiest way to run ChatGPT Clone is by using docker
docker-compose up
- Run
kubectl apply -f kubernetes/
. It will create a deployment and ClusterIP Ingress in the namespace "chatgpt-clone" - Create a secret containing your OPENAI-API-TOKEN with:
kubectl create secret generic openai-api-key --from-literal=openai-api-key=[YOUR_OPENAI_TOKEN] -n chatgpt-clone
- Either change the service to load balancer or ingress (don't forget to password protect it!!), or port-forward it to your local machine:
kubectl port-forward deployment/chatgpt-clone 1338:1338 -n chatgpt-clone
If you want to host the app at a domain follow these steps:
- Install - if you haven't already - the nginx ingress
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx
--namespace ingress-nginx
--create-namespace
- Create a basic auth secret which will password protect the app
htpasswd -c auth user
(you might need apt-get install apache2-utils)- Enter your password
- This creates a file "auth"
- "Submit" the password as secret to Kubernetes with:
kubectl create secret generic basic-auth --from-file=auth -n chatgpt-clone
- Insert your domain in the "kubernetes/nginxingress/chatgpt-clone-ingress.yaml" file.
- Point your matching domain to your K8s IP
kubectl apply -f kubernetes/nginxingress/