ChatGPT私有化部署

125 阅读1分钟

声明:此项目只发布于 GitHub,基于 MIT 协议,免费且作为开源学习使用。并且不会有任何形式的卖号、付费服务、讨论群、讨论组等行为。谨防受骗。

1、下载代码 ChatGPT 的镜像源码,我选择 chatgpt-web` ,github 上也有其他的模板,没有仔细去对比差异,只要能用即可。

使用 git 直接下载 gpt 镜像网站的代码

  git clean https://github.com/ShangGuanYuanLuo/chatgpt-web.git

进入chatgpt-web项目

    cd /root/cahtgpt-web

并新建一个 .env 文件,输入 OPENAI_API_KEY:可以前往 API-Keys platform.openai.com/account/api… 生成

    OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

2、安装依赖

chatgpt-mirror 的运行需要有 nodejs 环境,因此我们要先安装一下nodejs 相关工具

1)安装 Node.js:首先,你需要安装 Node.js。这是因为 pnpm 是一个 Node.js 包管理器。你可以使用以下命令安装 Node.js:

    sudo apt update
    sudo apt install nodejs