19 June 2023
mkdir heroku-proxy-server cd heroku-proxy-server
python3 -m venv venv source venv/bin/activate
pip install Flask gunicorn
app.pywith the content from the GitHub repository.
API_KEYwithin Heroku to your actual OpenAI API key. You can configure this at the dashboard of your Heroku app under Config Vars
Procfile(make sure you save it without any file extension). Add the following content to the
web: gunicorn app:app
requirements.txtfile with the following content to specify the project's dependencies:
click==8.1.3 Flask==2.1.1 requests==2.26.0 gunicorn==20.1.0 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.2 Werkzeug==2.2.3
.gitignorefile to exclude unnecessary files from being uploaded:
venv/ __pycache__/ *.pyc *.pyo *.pyd *.pyc *.egg-info/ dist/ build/ *.egg
git add . git commit -m "Initial commit"
your-app-namewith a name for your Heroku proxy server:
heroku create your-app-name
git push heroku master
After the deployment, and subsequent build on Heroku is complete, your proxy server will be live on Heroku at:
After confirming your proxy server URL is correct, you can enter this into LegacyAI and test the functionality of your server.
Logging Server Activity
To log activity on your server, run the following command in your terminal:
heroku logs --app your-app-name --tail
Whenever you make changes to your application, you need to commit and deploy these changes to Heroku. The following commands stage your changes, commits them, and pushes them to the remote repository. Whenever you push any changes your server application will be redeployed on Heroku. Note that this restarts your server which will result in temporary down-time.
git add . git commit -m "" git push heroku master
Feel free to add PR requests to the public example server's repository.