自部署GPT3.5-API免费调用

作者 : noise 发布时间: 2024-04-6

介绍

第一个服务基于 https://github.com/aurora-develop/aurora 通过部署该项目你可以得到一个可以随时调用的GPT-API

第二个服务基于https://github.com/missuo/FreeGPT35 利用免登录 ChatGPT Web 提供的无限制免费 GPT-3.5-Turbo API 服务

注意:请使用可正常访问gpt的服务器ip部署服务,不要频繁请求,不要共享和滥用你的API以避免被 ban 掉

Docker部署aurora

您需要安装Docker和Docker Compose。

docker run -d \
  --name aurora \
  -p 8080:8080 \
  ghcr.io/aurora-develop/aurora:latest
1712339284396
1712339284396

Curl使用

curl --location 'http://127.0.0.1:8080/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
     "model": "gpt-3.5-turbo",
     "messages": [{"role": "user", "content": "Say this is a test!"}],
     "stream": true
   }'

ChatGPT-Next-Web使用

注意⚠️:需要https,所以如果你是服务器部署请正确开启反代

Docker Compose部署aurora

创建一个新的目录,例如aurora-app,并进入该目录:

mkdir aurora
cd aurora

在此目录中下载库中的docker-compose.yml文件:

docker-compose up -d

render部署aurora 示例

1、登录 https://dashboard.render.com , 选择“new”- “web service”

S1j
S1j

2、选择从镜像安装

3、填入仓库地址:ghcr.io/aurora-develop/aurora:latest

4)完成创建,获得服务地址

最后,使用创建的api 服务地址

ChatGPT-Next-Web中仅填写render中部署的地址即可:

其它:

GKZuHa_aAAAw9gN
GKZuHa_aAAAw9gN

FreeGPT35部署

Docker

docker run -p 3040:3040 ghcr.io/missuo/freegpt35
docker run -p 3040:3040 missuo/freegpt35

Docker Compose

只有 FreeGPT35 服务

mkdir freegpt35 && cd freegpt35
wget -O compose.yaml https://raw.githubusercontent.com/missuo/FreeGPT35/main/compose.yaml
docker compose up -d

使用 ChatGPT-Next-Web 的 FreeGPT35 服务:

mkdir freegpt35 && cd freegpt35
wget -O compose.yaml https://raw.githubusercontent.com/missuo/FreeGPT35/main/compose_with_next_chat.yaml
docker compose up -d

部署完成后,您可以直接访问以使用 API。或者直接使用ChatGPT-Next-Webhttp://[IP]:3040/v1/chat/completions``http://[IP]:3000

请求示例

你不必传递授权,当然,你也可以随机传递任何字符串。

curl http://127.0.0.1:3040/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer any_string_you_like" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
    "stream": true
    }'

兼容性

您可以在任何应用程序中使用它,例如 OpenCat、Next-Chat、Lobe-Chat、Bob 等。随意使用任何字符串填充 API 密钥

Bob

    来自NOISE资源阁-noisevip.cn
    NOISE宝藏阁 » 自部署GPT3.5-API免费调用

    发表回复

    微信
    我会尽快回复。
    取消