shc 发表于 2024-12-8 13:06:58

【教程】黑五的吃灰小鸡怎么办?搭建多模型一站式AI平台

大家好呀!距离上一次在loc和博客发布教程已经3年多了。

今天介绍一下如何利用吃灰小鸡搭建自己的多模型一站式AI平台,分享给身边朋友们家人们用还是相当方便的。

详细全文戳博客https://qing.su/article/linux-ai-platform-with-coai.html

用到的程序是免费开源版的COAI/ChatNIO,支持GPT/Claude/Dalle/Midjourney/等等各种模型,也支持新的gpt-o1-preview和gpt-o1-mini.文中使用的是Ubuntu 24.04系统,其它系统也类似。


https://pic.img.wang/img/2024/12/08/67552484ba9da.png


https://pic.img.wang/img/2024/12/08/67552484e379c.png


我也不知道为啥,加上代码就直接403,于是把教程写在楼下吧


static/image/smiley/yct/020.gif

static/image/smiley/yct/020.gif

static/image/smiley/yct/020.gif

shc 发表于 2024-12-8 13:08:06

本帖最后由 shc 于 2024-12-8 13:10 编辑

1. 安装MySQL + Redis

[*]apt install redis-server复制代码[*]apt-get install npm golang-go mysql-server
[*]mysql -u root -p
[*]ALTER USERER 'root'@'localhost' IDENTIFIED BY 'password';
[*]CREATE DATABASE coaidb;
[*]CREATE USER 'coaiuser'@'localhost' IDENTIFIED BY 'password2';
[*]GRANT ALL ON coaidb.* TO 'coaiuser'@'localhost';
[*]FLUSH PRIVILEGES;
[*]QUIT;复制代码

shc 发表于 2024-12-8 13:09:15

2. 编译安装COAI

[*]cd /opt
[*]git clone https://github.com/coaidev/coai.git
[*]cd coai
[*]cp config.example.yaml config.yaml复制代码

在config.yaml中填好数据库信息,然后编译安装。

[*]cd app
[*]npm install -g pnpm
[*]pnpm install
[*]pnpm build
[*]cd ..
[*]go build -o coai复制代码

建好systemD服务 /etc/systemd/system/coai.service

[*]
[*]Description=COAI Service
[*]
[*]
[*]Type=simple
[*]User=root
[*]WorkingDirectory=/opt/coai
[*]ExecStart=/opt/coai/coai
[*]Restart=always
[*]
[*]
[*]WantedBy=multi-user.target复制代码
[*]systemctl daemon-reload
[*]systemctl start coai.service
[*]systemctl enable coai.service复制代码

3. 设置Nginx反代

[*]apt-get install nginx certbot python3-certbot-nginx -y
[*]cp /opt/coai/nginx.conf /etc/nginx/conf.d/coai.conf复制代码

编辑/etc/nginx/conf.d/coai.conf,加一行
[*]server_name example.com复制代码

重新加载Nginx

[*]nginx -t
[*]service nginx reload复制代码

配置Let's Encrypt

[*]certbot --nginx --redirect --hsts --staple-ocsp -d example.com复制代码


安装完毕后,在后台配置好API就可以了。具体的图文可以参考我的博客文章

https://qing.su/article/linux-ai-platform-with-coai.html

如果有任何疑问,欢迎留言讨论哈~


static/image/smiley/yct/008.gif

static/image/smiley/yct/008.gif

tomcb 发表于 2024-12-8 13:28:55

这种是搭建了直接能用还是要填其他平台的API进行中转?

shc 发表于 2024-12-8 13:40:37


tomcb 发表于 2024-12-8 13:28

这种是搭建了直接能用还是要填其他平台的API进行中转?
要填API, 可以填官方的,也可以填第三方的。我就注册的坛子里之前老哥做的中转API,送的几块钱能用好久…

clak 发表于 2024-12-8 13:28:00


tomcb 发表于 2024-12-8 13:28

这种是搭建了直接能用还是要填其他平台的API进行中转?
还得中转
页: [1]
查看完整版本: 【教程】黑五的吃灰小鸡怎么办?搭建多模型一站式AI平台