简介
ChatGPT是一个由OpenAI开发的强大自然语言处理模型,它使用了海量的语料库进行训练,能够自动理解和生成人类语言。可处理各种任务,如问答、文本生成、翻译、摘要和对话等。不过今天我们先教大家在vps上如何部署搭建自己的ChatGPT!
ChatGPT演示站点
ai.jinqians.com:点击使用
准备工作
-
申请你的openAI的API key,如果你还没有openai的账户,请先免费注册点击注册
-
需要一台VPS,低配的足够使用,如果你没有,推荐:每月6元,便宜但速度还行的美国VPS(6机房可选)低至$10.18/年,RackNerd
-
SSH连接工具,参考Putty、 Terminus等
开始部署
-
获取API Key
获取API Key,详见这篇文章,点击查看 -
用Terminus工具连接VPS服务器,你也可以用其他的工具连接
配置环境
- 一键安装 Docker,一键安装命令如下:
curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
- 查看docker运行状态
systemctl status docker
如果现实未运行,使用下面命令进行启动
sudo systemctl enable docker sudo systemctl start docker
安装ChatGPT
docker run \
--name chatgpt-web \
-p 3002:3002 \
--env OPENAI_API_KEY=Your key \
--restart always \
-d chenzhaoyu94/chatgpt-web:latest
将Your key 替换成你自己的openai key
到这一步,属于你自己的ChatGPT 网页版就是已经完成部署了,然后直接访问你VPS的ip: http://xxx.xx.xx.xx:3002 即可打开ChtaGPT,不用科学上网也能在国内正常使用。
Nginx反代
-
安装aapanel
ubuntu/debianwget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && bash install.sh aapanel
-
进入aapanel面板,安装nginx
-
添加站点
-
添加反向代理
反代网站填写,格式为域名:端口
配置反代文件#PROXY-START/ location ^~ / { proxy_pass http://127.0.0.1:3002; proxy_set_header Host $http_host; proxy_set_header Upgrade $http_upgrade; } location ~ ^/(ws|terminal/.+)$ { proxy_pass http://127.0.0.1:3002; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $http_host; } #PROXY-END/
I have been surfing online more than three hours today,
yet I never found any interesting article like yours. It is pretty
worth enough for me. In my view, if all website owners and bloggers made good
content as you did, the internet will be a lot more useful than ever before.