GPT-Port: a Flask-based Tool for GPT Port Building with External Jump Server.
pip install -r requirements.txt
Change "your openai api key
" in openai.api_key="your openai api key"
to your own openai api key in the 2nd line of "GPT_USE.py".
You can build GPT-Port in External Jump Server which can access to openai service.
nohup python main.py &
After successful start, remember the Process Id [PID] for end the service by kill [PID] later.
You need to check what your public IP address [PublicIP] is in case you want to use GPT-Port service on other servers later.
curl ipinfo.io/ip
You can use your GPT service on your internal servers that have access to your Flask-based GPT-Port but not to the OpenAI service with "use_route.py".
Change "yourip
" in url = 'http://yourip:80/'
to your public IP address ([PublicIP] in Step 2.3) in the 3rd line of "use_route.py".
You can use the function "GPT" in "use_route.py" to get the equivalent OpenAI api service by simply entering the "input" and "model" name.
For example:
ChatGPT Service:
output = GPT(input="What is ChatGPT", model='gpt-3.5-turbo')