A GPT 4.0 Mini-powered chatbot that processes and summarizes resumes, integrated with WildApricot to pull and manage member data. It is deployed on an AWS EC2 Ubuntu instance with a Flask web server, managed using Gunicorn and Nginx.
- Summarizes resumes from WildApricot.
- Deployable on AWS / Azure / Heroku with an iframe embed to WildApricot as custom HTML.
- Fully managed on AWS EC2 Ubuntu with Nginx and Gunicorn.
Run these commands in the root folder:
git clone https://github.com/mixtapeo/ResumeGPT
cd ResumeGPT
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Create a new file named
.env
in the root directory. - Add the following environment variables:
wildapiricot_api_key=<YOUR_WILDAPRICOOT_API_KEY>
openai_api_key=<YOUR_OPENAI_API_KEY>
account_id=<YOUR_ACCOUNT_ID>
Run app.py
:
python3 app.py
Then go to the IP program is running at (usually 127.0.0.1).
- Make an Instance: Ubuntu, type t3a.medium recommended, select a key pair, allow HTTP / S trafic.
- Once made, under security, add inbound rule for port 5000, on 0.0.0.0
- Connect to Amazon Elastic IP to get a public IP
-
Update the system and install Python virtual environment:
sudo apt-get update sudo apt-get install python3-venv
-
Clone the repository and set up the environment:
cd /home/ubuntu git clone https://github.com/mixtapeo/ResumeGPT cd ResumeGPT python3 -m venv venv source venv/bin/activate pip install -r requirements.txt pip install gunicorn
-
Create
.env
File:cat >> .env # Add the 3 environment variables, then Ctrl+C to exit
-
Test Gunicorn:
gunicorn -b 0.0.0.0:5000 app:app # Ctrl+C to exit
-
Set up Gunicorn as a systemd service:
sudo vi /etc/systemd/system/app.service
Edit the file with the following content:
[Unit] Description=Gunicorn instance for a resume gpt app After=network.target [Service] User=ubuntu Group=www-data WorkingDirectory=/home/ubuntu/ResumeGPT ExecStart=/home/ubuntu/ResumeGPT/venv/bin/gunicorn -b localhost:5000 wsgi:app Restart=always [Install] WantedBy=multi-user.target
Save by pressing
Esc
->:
->wq!
-
Start and enable the service:
sudo systemctl daemon-reload sudo systemctl start app sudo systemctl enable app
-
Check if it's working:
curl localhost:5000
-
Install and configure Nginx:
sudo apt-get install nginx sudo systemctl start nginx sudo systemctl enable nginx
-
Edit the Nginx server configuration:
sudo vi /etc/nginx/sites-available/default
Modify it to include:
upstream flaskapp{ server localhost:5000; } location / { proxy_pass http://flaskapp; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; }
Save by pressing
Esc
->:
->wq!
-
Check Nginx configuration validity:
sudo nginx -t
-
Restart Nginx and Gunicorn to apply changes:
sudo systemctl restart nginx pkill gunicorn
-
Allow port 5000 through the firewall:
sudo ufw allow 5000/tcp
Your EC2 virtual machine web app should now be accessible and working!
To maintain routine tasks:
-
Download resumes, delete invalid/corrupt files, and summarize:
Make sure the
Members.xml
file is in the root directory (/home/ResumeGPT
).Example command to upload from Windows:
scp -i newkey.pem Members.xml [email protected]:/home/ubuntu/ Or just use WinSCP (easy, recommended).
-
Set up the cron job:
crontab -e
Add the following line:
* 6 * * * cd /home/ubuntu/ResumeGPT; source venv/bin/activate; python3 routine.py
Check status with:
systemctl status cron And should be working when you run this: crontab -l | grep -v '^#' | cut -f 6- -d ' ' | while read CMD; do eval $CMD; done
To update the application with the latest code from the repository:
-
Deactivate the virtual environment:
deactivate
-
Remove the existing directory:
cd .. rm -rf ResumeGPT
-
Clone the repository again:
git clone https://github.com/mixtapeo/ResumeGPT cd ResumeGPT
-
Set up the environment:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt pip install gunicorn
-
Run the application:
python3 app.py
To collect running logs:
sudo tail -f /var/log/nginx/error.log
sudo tail -f /var/log/nginx/access.log
- nginx: Nginx is used as a reverse proxy to handle client connections, manage static files, and forward dynamic requests to Gunicorn. This improves the security, performance, and scalability.
- gunicorn: Gunicorn serves as the WSGI HTTP server that handles incoming requests to your Flask application. It forks multiple worker processes to manage these requests concurrently, making it a critical component in a production environment.
- CORS
- CRON
- Ubuntu
- AWS EC2
- AWS Elastic IP Addresses
- HTML
- JavaScript
- Python
- ChatGPT API
- WildApricot API
- Amazon Machine Images (AMI)
- SSH
- Batch Translating: Investigate batch translating as some members are missing when using ChatGPT completions for summarizing. Average tokens sent for summary are ~220K, so batch processing may be more efficient.
- HTTPS / iframe embed: (TLDR; HTTPS setup required) Cannot iframe embed into wildapricot, as currently without SSL cerificate, can't make site HTTPS, which is required to be embeded according to WildApricot. Suggestions: install SSL certificate by buying a domain or investigate hosting code on Amaazon AppRunner or Google equivalent (google run seems to be easier).
Look at older flow below if using in local environment.
Drawback: Look into batch translating. Some people are missing when using multithreading chat completions GPT for summarising. Also chat completions will be unreliable in the future. Avg tokens sent for summary are ~220K. Batch will be better.
Automating resumeCache and downloading resumes. Currently doesnt do this, have to manually run gpt.py.