Skip to content

OpenAI ChatGPT Application Deployment

There are many applications available in practice. Choose the one you prefer.

1. chatgpt-web-midjourney-proxy

Installation

shell
docker pull ydlhero/chatgpt-web-midjourney-proxy #not needed on first install, needed for updates
docker rm -f chatgpt-web-midjourney-proxy #not needed on first install, needed for updates
docker run --name chatgpt-web-midjourney-proxy  -d -p 6015:3002 \
-e OPENAI_API_KEY=hk-your-apiKey \
-e OPENAI_API_BASE_URL=https://api.openai-hk.com  \
-e MJ_SERVER=https://api.openai-hk.com  \
-e AUTH_SECRET_KEY=access-password-letters-and-numbers  \
-e MJ_API_SECRET=hk-your-apiKey  ydlhero/chatgpt-web-midjourney-proxy
docker pull ydlhero/chatgpt-web-midjourney-proxy #not needed on first install, needed for updates
docker rm -f chatgpt-web-midjourney-proxy #not needed on first install, needed for updates
docker run --name chatgpt-web-midjourney-proxy  -d -p 6015:3002 \
-e OPENAI_API_KEY=hk-your-apiKey \
-e OPENAI_API_BASE_URL=https://api.openai-hk.com  \
-e MJ_SERVER=https://api.openai-hk.com  \
-e AUTH_SECRET_KEY=access-password-letters-and-numbers  \
-e MJ_API_SECRET=hk-your-apiKey  ydlhero/chatgpt-web-midjourney-proxy

Then visit http://127.0.0.1:6015

Screenshots

Input box for chat cover

GPTs cover

Image generation cover

Supports model switching and custom model definitions cover

2. chatgpt-web

Docker startup — default model is gpt-3.5

shell
docker run --name chatgpt-web -d -p 6011:3002 \
--env OPENAI_API_KEY=hk-replace-with-your-key \
--env TIMEOUT_MS=600000  --env OPENAI_MAX_TOKEN=1000 \
--env OPENAI_API_BASE_URL=https://api.openai-hk.com  chenzhaoyu94/chatgpt-web
docker run --name chatgpt-web -d -p 6011:3002 \
--env OPENAI_API_KEY=hk-replace-with-your-key \
--env TIMEOUT_MS=600000  --env OPENAI_MAX_TOKEN=1000 \
--env OPENAI_API_BASE_URL=https://api.openai-hk.com  chenzhaoyu94/chatgpt-web

Then visit http://127.0.0.1:6011

chatgpt-web gpt-4

  • The default model is gpt-3.5. To start with gpt-4.0 as the default, use the environment variable OPENAI_API_MODEL
shell
docker run --name chatgpt-web -d -p 6040:3002 \
--env OPENAI_API_KEY=hk-replace-with-your-key \
--env TIMEOUT_MS=600000  --env OPENAI_MAX_TOKEN=1000 \
--env OPENAI_API_MODEL=gpt-4-0613 \
--env OPENAI_API_BASE_URL=https://api.openai-hk.com  chenzhaoyu94/chatgpt-web
docker run --name chatgpt-web -d -p 6040:3002 \
--env OPENAI_API_KEY=hk-replace-with-your-key \
--env TIMEOUT_MS=600000  --env OPENAI_MAX_TOKEN=1000 \
--env OPENAI_API_MODEL=gpt-4-0613 \
--env OPENAI_API_BASE_URL=https://api.openai-hk.com  chenzhaoyu94/chatgpt-web

Then visit http://127.0.0.1:6040

Preview cover

3. chatgpt-next-web

Supports multiple models with a high degree of customization

shell
docker run  --name chatgpt-next-web   -d -p 6013:3000 \
   -e OPENAI_API_KEY="hk-replace-with-your-key" \
   -e BASE_URL=https://api.openai-hk.com   yidadaa/chatgpt-next-web
docker run  --name chatgpt-next-web   -d -p 6013:3000 \
   -e OPENAI_API_KEY="hk-replace-with-your-key" \
   -e BASE_URL=https://api.openai-hk.com   yidadaa/chatgpt-next-web

Then visit http://127.0.0.1:6013

Preview

cover

4. Lobehub lobe-chat — Academic writing, formulas, and charts

Great support for math formulas, includes various prompt templates packaged as apps

shell

docker run   --name lobe-chat  -d -p 6021:3210 \
  -e OPENAI_API_KEY=hk-replace-with-your-key \
  -e OPENAI_PROXY_URL=https://api.openai-hk.com/v1 \
  lobehub/lobe-chat

docker run   --name lobe-chat  -d -p 6021:3210 \
  -e OPENAI_API_KEY=hk-replace-with-your-key \
  -e OPENAI_PROXY_URL=https://api.openai-hk.com/v1 \
  lobehub/lobe-chat

Then visit http://127.0.0.1:6021

Preview

cover

5. gpt_academic

  • Project repository
  • Clone and enter the project, then modify the config.py configuration file
shell
git clone --depth=1 https://github.com/binary-husky/gpt_academic.git
cd gpt_academic
git clone --depth=1 https://github.com/binary-husky/gpt_academic.git
cd gpt_academic

Modify the config.py file

py
# Your key starts with hk-, but the system also supports sk- prefix (just replace hk with sk)
API_KEY = "sk-your-key" 
# The important part is modifying this
API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://api.openai-hk.com/v1/chat/completions"}
# Your key starts with hk-, but the system also supports sk- prefix (just replace hk with sk)
API_KEY = "sk-your-key" 
# The important part is modifying this
API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://api.openai-hk.com/v1/chat/completions"}

Then follow the official documentation to run it.

6. screenshot-to-code

  • Project repository
  • At the GPT-4 product launch, OpenAI's CTO casually swapped in an image and GPT-4 turned it into a webpage. This open-source project currently has the best support for that.
  • Requires gpt-4-vision-preview support
shell
git clone --depth=1 https://github.com/abi/screenshot-to-code.git
cd screenshot-to-code
git clone --depth=1 https://github.com/abi/screenshot-to-code.git
cd screenshot-to-code

Add the following to the .env file (create it if it doesn't exist)

OPENAI_API_KEY=hk-your-key
OPEN_AI_BASE=https://api.openai-hk.com
OPENAI_API_BASE=https://api.openai-hk.com
OPENAI_API_KEY=hk-your-key
OPEN_AI_BASE=https://api.openai-hk.com
OPENAI_API_BASE=https://api.openai-hk.com

The important part is modifying one line of code

shell
#Go to  backend/llm.py
#Find line 14
client = AsyncOpenAI(api_key=api_key, base_url=base_url)
#Change it to
client = AsyncOpenAI(api_key=api_key, base_url="https://api.openai-hk.com/v1")
#Go to  backend/llm.py
#Find line 14
client = AsyncOpenAI(api_key=api_key, base_url=base_url)
#Change it to
client = AsyncOpenAI(api_key=api_key, base_url="https://api.openai-hk.com/v1")

Docker build

shell
docker-compose up -d --build 
#If the above command doesn't work, try
docker compose up -d --build
docker-compose up -d --build 
#If the above command doesn't work, try
docker compose up -d --build

Visit http://localhost:5173 to see the result. Note that it only supports local access by default; remote access requires modifying the configuration or code yourself.

Try uploading a webpage screenshot and it will generate the code for you.

screenshot-to-code

7. FastGPT

Download the deployment and configuration files

shell
mkdir fastgpt
cd fastgpt
curl -O https://raw.githubusercontent.com/labring/FastGPT/main/files/deploy/fastgpt/docker-compose.yml
curl -O https://raw.githubusercontent.com/labring/FastGPT/main/projects/app/data/config.json
mkdir fastgpt
cd fastgpt
curl -O https://raw.githubusercontent.com/labring/FastGPT/main/files/deploy/fastgpt/docker-compose.yml
curl -O https://raw.githubusercontent.com/labring/FastGPT/main/projects/app/data/config.json

Modify the deployment configuration file docker-compose.yml

yml
#Find lines 51-52
     - OPENAI_BASE_URL=https://api.openai-hk.com/v1
     - CHAT_API_KEY=hk-your-key
#Find lines 51-52
     - OPENAI_BASE_URL=https://api.openai-hk.com/v1
     - CHAT_API_KEY=hk-your-key

Run the installation and startup commands

shell
# Enter the project directory
cd fastgpt
# Create the mongo key
openssl rand -base64 756 > ./mongodb.key
# If 600 doesn't work, try chmod 999
chmod 600 ./mongodb.key
chown 999:root ./mongodb.key
# Start the containers
docker-compose pull
docker-compose up -d
# Enter the project directory
cd fastgpt
# Create the mongo key
openssl rand -base64 756 > ./mongodb.key
# If 600 doesn't work, try chmod 999
chmod 600 ./mongodb.key
chown 999:root ./mongodb.key
# Start the containers
docker-compose pull
docker-compose up -d

Initialize the Mongo replica set

shell
# Check if the mongo container is running normally
docker ps
# Enter the container
docker exec -it mongo bash

# Connect to the database
mongo -u myname -p mypassword --authenticationDatabase admin

# Initialize the replica set. If you need external access, change mongo:27017 to ip:27017.
# You also need to update the FastGPT connection parameter accordingly
# (MONGODB_URI=mongodb://myname:mypassword@mongo:27017/fastgpt?authSource=admin => MONGODB_URI=mongodb://myname:mypassword@ip:27017/fastgpt?authSource=admin)
rs.initiate({
  _id: "rs0",
  members: [
    { _id: 0, host: "mongo:27017" }
  ]
})
# Check status. If it shows rs0 status, the replica set is running successfully
rs.status()
# Check if the mongo container is running normally
docker ps
# Enter the container
docker exec -it mongo bash

# Connect to the database
mongo -u myname -p mypassword --authenticationDatabase admin

# Initialize the replica set. If you need external access, change mongo:27017 to ip:27017.
# You also need to update the FastGPT connection parameter accordingly
# (MONGODB_URI=mongodb://myname:mypassword@mongo:27017/fastgpt?authSource=admin => MONGODB_URI=mongodb://myname:mypassword@ip:27017/fastgpt?authSource=admin)
rs.initiate({
  _id: "rs0",
  members: [
    { _id: 0, host: "mongo:27017" }
  ]
})
# Check status. If it shows rs0 status, the replica set is running successfully
rs.status()

Visit http://ip:3000 — the default username and password are root 1234. To change them, modify DEFAULT_ROOT_PSW in docker-compose.yml.

FastGPT

For personal use, go to Account -> Personal Info -> openai/oneapi account settings FastGPT

8. chatgpt-on-wechat

Modify the config.json configuration file: cp config.example.json config.json

json
{
 "open_ai_api_key": "hk-your-key",
 "open_ai_api_base": "https://api.openai-hk.com/v1", //add this if it doesn't exist
}
{
 "open_ai_api_key": "hk-your-key",
 "open_ai_api_base": "https://api.openai-hk.com/v1", //add this if it doesn't exist
}

Then follow the official documentation to run it. chatgpt-on-wechatchatgpt-on-wechat

9. Flowise

shell
docker pull flowiseai/flowise #not needed on first install, needed for updates
docker rm -f flowise #not needed on first install, needed for updates
docker run --name flowise  -d -p 3070:3070  --restart=always \
-e PORT=3070  \
-e DATABASE_PATH=/root/.flowise \
-e APIKEY_PATH=/root/.flowise \
-e SECRETKEY_PATH=/root/.flowise \
-e LOG_PATH=/root/.flowise/logs \
-v ~/.flowise:/root/.flowise \
-e FLOWISE_USERNAME=hk \
-e FLOWISE_PASSWORD=hk123456 \
flowiseai/flowise /bin/sh -c "sleep 3; flowise start"
docker pull flowiseai/flowise #not needed on first install, needed for updates
docker rm -f flowise #not needed on first install, needed for updates
docker run --name flowise  -d -p 3070:3070  --restart=always \
-e PORT=3070  \
-e DATABASE_PATH=/root/.flowise \
-e APIKEY_PATH=/root/.flowise \
-e SECRETKEY_PATH=/root/.flowise \
-e LOG_PATH=/root/.flowise/logs \
-v ~/.flowise:/root/.flowise \
-e FLOWISE_USERNAME=hk \
-e FLOWISE_PASSWORD=hk123456 \
flowiseai/flowise /bin/sh -c "sleep 3; flowise start"
  • Visit http://yourip:3070
  • Configure Credentials

Create a new Credentialsflowise Set the key to your hk-your-keyflowise After saving, create a new chatFlow flowise When configuring OpenAI-related settings, select the openai-hk key you just created flowise Set basePath to https://api.openai-hk.com/v1flowise Final running result flowise

10. Other

If you have other applications, please contact our customer support for assistance.