ChatGPT-Next-Web 最新部署对接new-api部署方法

new-api

new-api基于one-api

预览:

image-20240720004703872

部署

docker-compose

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
version: '3.9'
services:
    new-api:
        image: 'calciumion/new-api:latest'
        volumes:
            - './data:/data'
        environment:
            - TZ=Asia/Shanghai
        ports:
            - '7016:3000'
        restart: unless-stopped
        container_name: new-api

反向代理

Nginx

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
server {
    listen 80;
    server_name xxxx.com; # 你的域名

    location / {
        proxy_pass http://127.0.0.1:7016;  # 替换为你的应用程序地址
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

ChatGPT-Next-Web

预览:

image-20240720132515712

部署

docker-compose

api 以对接 chatanyweher 为例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
services:
    chatgpt-next-web:
        image: yidadaa/chatgpt-next-web
        container_name: gpt
        environment:
            - CODE=xxxxxx # 网页访问密码,保持复杂性,防止被爆破
            - OPENAI_API_KEY=sk-Y8oxUwG2Qhxxxxxxxxxx # 你的one-api key
            - BASE_URL=https://xxxx.com #你的接口代理地址
            - ENABLE_BALANCE_QUERY=1  # 启用余额查询
            - DEFAULT_MODEL=gpt-4o-mini-2024-07-18 # 网页端首次访问的默认模型,该模型为openai的最新超便宜模型,3.5之上,4o之下
            - CUSTOM_MODELS=-all,+gpt-3.5-turbo-ca,+gpt-4o-ca,+gpt-4-turbo-ca,+gpt-4-turbo-preview-ca,+gpt-4-ca,+gpt-3.5-turbo,+gpt-3.5-turbo-0125,+gpt-3.5-turbo-1106,+gpt-3.5-turbo-0613,+gpt-3.5-turbo-0301,+gpt-3.5-turbo-instruct,+gpt-3.5-turbo-instruct-0914,+gpt-3.5-turbo-16k,+gpt-3.5-turbo-16k-0613,+gpt-4o,+gpt-4o-2024-05-13,+gpt-4o-mini,+gpt-4o-mini-2024-07-18,+gpt-4-turbo,+gpt-4-turbo-2024-04-09,+gpt-4-turbo-preview,+gpt-4-1106-preview,+gpt-4-0125-preview,+gpt-4-vision-preview,+gpt-4-1106-vision-preview,+gpt-4,+gpt-4-0613,+text-embedding-ada-002,+text-embedding-3-small,+text-embedding-3-large,+claude-3-5-sonnet-20240620,+whisper-1,+tts-1,+tts-1-1106,+tts-1-hd,+tts-1-hd-1106,+dall-e-2,+dall-e-3 # chatanyweher支持的模型
        ports:
            - '3550:3000' # 网页访问端口
        restart: unless-stopped

反向代理

Nginx

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
server {
    listen 80;
    server_name xxxxx.com; # 你的域名

    location / {
        proxy_pass http://127.0.0.1:3550;  # 替换为你的应用程序地址
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
使用 Hugo 构建
主题 StackJimmy 设计