部署和使用FastGPT

一、部署FastGPT

1.1 安装docker

安装docker和docker compose,参见docker安装。

1.2 Docker部署FastGPT

mkdir fastgpt
cd fastgpt

curl -O https://raw.githubusercontent.com/labring/FastGPT/main/projects/app/data/config.json

# pgvector 版本(测试推荐,简单快捷)
curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-pgvector.yml

# oceanbase 版本(需要将init.sql和docker-compose.yml放在同一个文件夹,方便挂载)
# curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-oceanbase/docker-compose.yml
# curl -o init.sql https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-oceanbase/init.sql

# milvus 版本
# curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-milvus.yml

# zilliz 版本
# curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-zilliz.yml

启动:

sudo docker compose up -d
sudo docker ps

访问: 通过 ip:3000 直接访问(注意开放防火墙)。登录用户名为 root,密码为docker-compose.yml环境变量里设置的 DEFAULT_ROOT_PSW。初次密码是1234。

1.3 非容器化部署

安装nodejs、mongodb、pg数据库及pgvector插件。

克隆fastGPT源码。

git clone https://github.com/labring/FastGPT.git

cd FastGPT
pnpm install

cd projects/app
cp .env.template .env.local

// 修改.env.local中的参数:oneapi,mongodb,pg连接信息

pnpm dev

也可以编译打包后运行

pnpm build
pnpm start

二、使用FastGPT

  • 配置2个模型。
  • 配置知识库。
  • 创建应用。
  • 进行对话。