mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-18 17:51:24 +00:00
fix: doc path (#5393)
This commit is contained in:
@@ -3,7 +3,7 @@ title: 配置文件介绍
|
||||
description: FastGPT 配置参数介绍
|
||||
---
|
||||
|
||||
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/development/docker/) 来挂载配置文件。
|
||||
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/introduction/development/docker/) 来挂载配置文件。
|
||||
|
||||
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
|
||||
|
||||
@@ -70,4 +70,4 @@ description: FastGPT 配置参数介绍
|
||||
|
||||
### 使用 Marker 解析 PDF 文件
|
||||
|
||||
[点击查看 Marker 接入教程](/docs/development/custom-models/marker)
|
||||
[点击查看 Marker 接入教程](/docs/introduction/development/custom-models/marker)
|
||||
|
@@ -9,9 +9,9 @@ FastGPT 默认使用了 OpenAI 的 LLM 模型和向量模型,如果想要私
|
||||
|
||||
## 部署镜像
|
||||
|
||||
+ 镜像名: `stawky/chatglm2-m3e:latest`
|
||||
+ 国内镜像名: `registry.cn-hangzhou.aliyuncs.com/fastgpt_docker/chatglm2-m3e:latest`
|
||||
+ 端口号: 6006
|
||||
- 镜像名: `stawky/chatglm2-m3e:latest`
|
||||
- 国内镜像名: `registry.cn-hangzhou.aliyuncs.com/fastgpt_docker/chatglm2-m3e:latest`
|
||||
- 端口号: 6006
|
||||
|
||||
```
|
||||
# 设置安全凭证(即oneapi中的渠道密钥)
|
||||
@@ -21,7 +21,7 @@ FastGPT 默认使用了 OpenAI 的 LLM 模型和向量模型,如果想要私
|
||||
|
||||
## 接入 OneAPI
|
||||
|
||||
文档链接:[One API](/docs/development/modelconfig/one-api/)
|
||||
文档链接:[One API](/docs/introduction/development/modelconfig/one-api/)
|
||||
|
||||
为 chatglm2 和 m3e-large 各添加一个渠道,参数如下:
|
||||
|
||||
@@ -97,7 +97,7 @@ M3E 模型的使用方法如下:
|
||||
1. 创建知识库时候选择 M3E 模型。
|
||||
|
||||
注意,一旦选择后,知识库将无法修改向量模型。
|
||||
|
||||
|
||||

|
||||
|
||||
2. 导入数据
|
||||
@@ -108,7 +108,7 @@ M3E 模型的使用方法如下:
|
||||
4. 应用绑定知识库
|
||||
|
||||
注意,应用只能绑定同一个向量模型的知识库,不能跨模型绑定。并且,需要注意调整相似度,不同向量模型的相似度(距离)会有所区别,需要自行测试实验。
|
||||
|
||||
|
||||

|
||||
|
||||
chatglm2 模型的使用方法如下:
|
||||
|
@@ -7,14 +7,14 @@ description: ' 采用 Ollama 部署自己的模型'
|
||||
|
||||
## 安装 Ollama
|
||||
|
||||
Ollama 本身支持多种安装方式,但是推荐使用 Docker 拉取镜像部署。如果是个人设备上安装了 Ollama 后续需要解决如何让 Docker 中 FastGPT 容器访问宿主机 Ollama的问题,较为麻烦。
|
||||
Ollama 本身支持多种安装方式,但是推荐使用 Docker 拉取镜像部署。如果是个人设备上安装了 Ollama 后续需要解决如何让 Docker 中 FastGPT 容器访问宿主机 Ollama的问题,较为麻烦。
|
||||
|
||||
### Docker 安装(推荐)
|
||||
|
||||
你可以使用 Ollama 官方的 Docker 镜像来一键安装和启动 Ollama 服务(确保你的机器上已经安装了 Docker),命令如下:
|
||||
|
||||
```bash
|
||||
docker pull ollama/ollama
|
||||
docker pull ollama/ollama
|
||||
docker run --rm -d --name ollama -p 11434:11434 ollama/ollama
|
||||
```
|
||||
|
||||
@@ -81,7 +81,6 @@ ollama pull [模型名]
|
||||
|
||||

|
||||
|
||||
|
||||
### 测试通信
|
||||
|
||||
在安装完成后,需要进行检测测试,首先进入 FastGPT 所在的容器,尝试访问自己的 Ollama ,命令如下:
|
||||
@@ -108,7 +107,7 @@ ollama ls
|
||||
|
||||
### 2. AI Proxy 接入
|
||||
|
||||
如果你采用的是 FastGPT 中的默认配置文件部署[这里](/docs/development/docker.md),即默认采用 AI Proxy 进行启动。
|
||||
如果你采用的是 FastGPT 中的默认配置文件部署[这里](/docs/introduction/development/docker.md),即默认采用 AI Proxy 进行启动。
|
||||
|
||||

|
||||
|
||||
@@ -116,7 +115,7 @@ ollama ls
|
||||
|
||||

|
||||
|
||||
在 FastGPT 中点击账号->模型提供商->模型配置->新增模型,添加自己的模型即可,添加模型时需要保证模型ID和 OneAPI 中的模型名称一致。详细参考[这里](/docs/development/modelConfig/intro.md)
|
||||
在 FastGPT 中点击账号->模型提供商->模型配置->新增模型,添加自己的模型即可,添加模型时需要保证模型ID和 OneAPI 中的模型名称一致。详细参考[这里](/docs/introduction/development/modelConfig/intro.md)
|
||||
|
||||

|
||||
|
||||
@@ -177,4 +176,5 @@ docker run -it --network [ FastGPT 网络 ] --name 容器名 intel/oneapi-hpckit
|
||||

|
||||
|
||||
### 6. 补充
|
||||
|
||||
上述接入 Ollama 的代理地址中,主机安装 Ollama 的地址为“http://[主机IP]:[端口]”,容器部署 Ollama 地址为“http://[容器名]:[端口]”
|
||||
|
@@ -13,8 +13,8 @@ Xinference 支持多种推理引擎作为后端,以满足不同场景下部署
|
||||
|
||||
如果你的目标是在一台 Linux 或者 Window 服务器上部署大模型,可以选择 Transformers 或 vLLM 作为 Xinference 的推理后端:
|
||||
|
||||
+ [Transformers](https://huggingface.co/docs/transformers/index):通过集成 Huggingface 的 Transformers 库作为后端,Xinference 可以最快地 集成当今自然语言处理(NLP)领域的最前沿模型(自然也包括 LLM)。
|
||||
+ [vLLM](https://vllm.ai/): vLLM 是由加州大学伯克利分校开发的一个开源库,专为高效服务大型语言模型(LLM)而设计。它引入了 PagedAttention 算法, 通过有效管理注意力键和值来改善内存管理,吞吐量能够达到 Transformers 的 24 倍,因此 vLLM 适合在生产环境中使用,应对高并发的用户访问。
|
||||
- [Transformers](https://huggingface.co/docs/transformers/index):通过集成 Huggingface 的 Transformers 库作为后端,Xinference 可以最快地 集成当今自然语言处理(NLP)领域的最前沿模型(自然也包括 LLM)。
|
||||
- [vLLM](https://vllm.ai/): vLLM 是由加州大学伯克利分校开发的一个开源库,专为高效服务大型语言模型(LLM)而设计。它引入了 PagedAttention 算法, 通过有效管理注意力键和值来改善内存管理,吞吐量能够达到 Transformers 的 24 倍,因此 vLLM 适合在生产环境中使用,应对高并发的用户访问。
|
||||
|
||||
假设你服务器配备 NVIDIA 显卡,可以参考[这篇文章中的指令来安装 CUDA](https://xorbits.cn/blogs/langchain-streamlit-doc-chat),从而让 Xinference 最大限度地利用显卡的加速功能。
|
||||
|
||||
@@ -98,7 +98,7 @@ xinference launch -n qwen-chat -s 14 -f pytorch
|
||||
|
||||
## 将本地模型接入 One API
|
||||
|
||||
One API 的部署和接入请参考[这里](/docs/development/modelconfig/one-api/)。
|
||||
One API 的部署和接入请参考[这里](/docs/introduction/development/modelconfig/one-api/)。
|
||||
|
||||
为 qwen1.5-chat 添加一个渠道,这里的 Base URL 需要填 Xinference 服务的端点,并且注册 qwen-chat (模型的 UID) 。
|
||||
|
||||
@@ -153,9 +153,6 @@ curl --location --request POST 'https://[oneapi_url]/v1/chat/completions' \
|
||||
|
||||
然后重启 FastGPT 就可以在应用配置中选择 Qwen 模型进行对话:
|
||||
|
||||

|
||||
---
|
||||
|
||||
+ 参考:[FastGPT + Xinference:一站式本地 LLM 私有化部署和应用开发](https://xorbits.cn/blogs/fastgpt-weather-chat)
|
||||
|
||||
## 
|
||||
|
||||
- 参考:[FastGPT + Xinference:一站式本地 LLM 私有化部署和应用开发](https://xorbits.cn/blogs/fastgpt-weather-chat)
|
||||
|
@@ -58,7 +58,7 @@ Zilliz Cloud 由 Milvus 原厂打造,是全托管的 SaaS 向量数据库服
|
||||
|
||||
### 1. 确保网络环境
|
||||
|
||||
如果使用`OpenAI`等国外模型接口,请确保可以正常访问,否则会报错:`Connection error` 等。 方案可以参考:[代理方案](/docs/development/proxy/)
|
||||
如果使用`OpenAI`等国外模型接口,请确保可以正常访问,否则会报错:`Connection error` 等。 方案可以参考:[代理方案](/docs/introduction/development/proxy/nginx)
|
||||
|
||||
### 2. 准备 Docker 环境
|
||||
|
||||
@@ -181,7 +181,7 @@ docker-compose up -d
|
||||
### 6. 配置模型
|
||||
|
||||
- 首次登录FastGPT后,系统会提示未配置`语言模型`和`索引模型`,并自动跳转模型配置页面。系统必须至少有这两类模型才能正常使用。
|
||||
- 如果系统未正常跳转,可以在`账号-模型提供商`页面,进行模型配置。[点击查看相关教程](/docs/development/modelconfig/ai-proxy)
|
||||
- 如果系统未正常跳转,可以在`账号-模型提供商`页面,进行模型配置。[点击查看相关教程](/docs/introduction/development/modelConfig/ai-proxy)
|
||||
- 目前已知可能问题:首次进入系统后,整个浏览器 tab 无法响应。此时需要删除该tab,重新打开一次即可。
|
||||
|
||||
## FAQ
|
||||
@@ -271,7 +271,7 @@ docker-compose up -d
|
||||
|
||||
### 如何更新版本?
|
||||
|
||||
1. 查看[更新文档](/docs/development/upgrading/index/),确认要升级的版本,避免跨版本升级。
|
||||
1. 查看[更新文档](/docs/upgrading),确认要升级的版本,避免跨版本升级。
|
||||
2. 修改镜像 tag 到指定版本
|
||||
3. 执行下面命令会自动拉取镜像:
|
||||
|
||||
@@ -284,7 +284,7 @@ docker-compose up -d
|
||||
|
||||
### 如何自定义配置文件?
|
||||
|
||||
修改`config.json`文件,并执行`docker-compose down`再执行`docker-compose up -d`重起容器。具体配置,参考[配置详解](/docs/development/configuration)。
|
||||
修改`config.json`文件,并执行`docker-compose down`再执行`docker-compose up -d`重起容器。具体配置,参考[配置详解](/docs/introduction/development/configuration)。
|
||||
|
||||
### 如何检查自定义配置文件是否挂载
|
||||
|
||||
|
@@ -18,7 +18,7 @@ description: FastGPT 私有部署常见问题
|
||||
|
||||
### OneAPI 错误
|
||||
|
||||
带有`requestId`的,都是 OneAPI 提示错误,大部分都是因为模型接口报错。可以参考 [OneAPI 常见错误](/docs/development/faq/#三常见的-oneapi-错误)
|
||||
带有`requestId`的,都是 OneAPI 提示错误,大部分都是因为模型接口报错。可以参考 [OneAPI 常见错误](/docs/introduction/development/faq/#三常见的-oneapi-错误)
|
||||
|
||||
## 二、通用问题
|
||||
|
||||
@@ -59,13 +59,15 @@ description: FastGPT 私有部署常见问题
|
||||
|
||||
1. 看日志。如果提示 JSON invalid,not support tool 之类的,说明该模型不支持工具调用或函数调用,需要设置`toolChoice=false`和`functionCall=false`,就会默认走提示词模式。目前内置提示词仅针对了商业模型API进行测试。问题分类基本可用,内容提取不太行。
|
||||
2. 如果已经配置正常,并且没有错误日志,则说明可能提示词不太适合该模型,可以通过修改`customCQPrompt`来自定义提示词。
|
||||
|
||||
|
||||
### 页面崩溃
|
||||
|
||||
1. 关闭翻译
|
||||
2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。
|
||||
* 95%情况是配置文件不对。会提示 xxx undefined
|
||||
* 提示`URI malformed`,请 Issue 反馈具体操作和页面,这是由于特殊字符串编码解析报错。
|
||||
|
||||
- 95%情况是配置文件不对。会提示 xxx undefined
|
||||
- 提示`URI malformed`,请 Issue 反馈具体操作和页面,这是由于特殊字符串编码解析报错。
|
||||
|
||||
3. 某些api不兼容问题(较少)
|
||||
|
||||
### 开启内容补全后,响应速度变慢
|
||||
@@ -102,7 +104,7 @@ description: FastGPT 私有部署常见问题
|
||||
|
||||
带有 requestId 的都是 OneAPI 的报错。
|
||||
|
||||
### insufficient_user_quota user quota is not enough
|
||||
### insufficient_user_quota user quota is not enough
|
||||
|
||||
OneAPI 账号的余额不足,默认 root 用户只有 200 刀,可以手动修改。
|
||||
|
||||
@@ -120,7 +122,8 @@ FastGPT 模型配置文件中的 model 必须与 OneAPI 渠道中的模型对应
|
||||
|
||||
### 点击模型测试失败
|
||||
|
||||
OneAPI 只会测试渠道的第一个模型,并且只会测试对话模型,向量模型无法自动测试,需要手动发起请求进行测试。[查看测试模型命令示例](/docs/development/faq/#如何检查模型问题)
|
||||
OneAPI 只会测试渠道的第一个模型,并且只会测试对话模型,向量模型无法自动测试,需要手动发起请求进行测试。[查看测试模型命令示例](/docs/introduction/development/faq/#如何检查模型问题)
|
||||
|
||||
### get request url failed: Post `"https://xxx"` dial tcp: xxxx
|
||||
|
||||
OneAPI 与模型网络不通,需要检查网络配置。
|
||||
@@ -137,7 +140,6 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
|
||||
2. 模型接口参数异常(温度、max token等可能不适配)
|
||||
3. ....
|
||||
|
||||
|
||||
### Tiktoken 下载失败
|
||||
|
||||
由于 OneAPI 会在启动时从网络下载一个 tiktoken 的依赖,如果网络异常,就会导致启动失败。可以参考[OneAPI 离线部署](https://blog.csdn.net/wanh/article/details/139039216)解决。
|
||||
@@ -304,35 +306,35 @@ curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "chatcmpl-A7kwo1rZ3OHYSeIFgfWYxu8X2koN3",
|
||||
"object": "chat.completion.chunk",
|
||||
"created": 1726412126,
|
||||
"model": "gpt-4o-mini-2024-07-18",
|
||||
"system_fingerprint": "fp_483d39d857",
|
||||
"choices": [
|
||||
{
|
||||
"id": "chatcmpl-A7kwo1rZ3OHYSeIFgfWYxu8X2koN3",
|
||||
"object": "chat.completion.chunk",
|
||||
"created": 1726412126,
|
||||
"model": "gpt-4o-mini-2024-07-18",
|
||||
"system_fingerprint": "fp_483d39d857",
|
||||
"choices": [
|
||||
{
|
||||
"index": 0,
|
||||
"delta": {
|
||||
"role": "assistant",
|
||||
"content": null,
|
||||
"tool_calls": [
|
||||
{
|
||||
"index": 0,
|
||||
"delta": {
|
||||
"role": "assistant",
|
||||
"content": null,
|
||||
"tool_calls": [
|
||||
{
|
||||
"index": 0,
|
||||
"id": "call_0n24eiFk8OUyIyrdEbLdirU7",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "mEYIcFl84rYC",
|
||||
"arguments": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"refusal": null
|
||||
},
|
||||
"logprobs": null,
|
||||
"finish_reason": null
|
||||
}
|
||||
],
|
||||
"usage": null
|
||||
"id": "call_0n24eiFk8OUyIyrdEbLdirU7",
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "mEYIcFl84rYC",
|
||||
"arguments": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"refusal": null
|
||||
},
|
||||
"logprobs": null,
|
||||
"finish_reason": null
|
||||
}
|
||||
],
|
||||
"usage": null
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -24,6 +24,7 @@ import FastGPTLink from '@/components/docs/linkFastGPT';
|
||||
|
||||
1. 用户默认的时区为 `Asia/Shanghai`,非 linux 环境时候,获取系统时间会异常,本地开发时候,可以将用户的时区调整成 UTC(+0)。
|
||||
2. 建议先服务器装好**数据库**,再进行本地开发。
|
||||
|
||||
</Alert>
|
||||
|
||||
### 1. Fork 存储库
|
||||
@@ -46,9 +47,11 @@ git clone git@github.com:<github_username>/FastGPT.git
|
||||
|
||||
### 3. 安装数据库
|
||||
|
||||
第一次开发,需要先部署数据库,建议本地开发可以随便找一台 2C2G 的轻量小数据库实践,或者新建文件夹并配置相关文件用以运行docker。数据库部署教程:[Docker 快速部署](/docs/development/docker/)。部署完了,可以本地访问其数据库。
|
||||
第一次开发,需要先部署数据库,建议本地开发可以随便找一台 2C2G 的轻量小数据库实践,或者新建文件夹并配置相关文件用以运行docker。数据库部署教程:[Docker 快速部署](/docs/introduction/development/docker/)。部署完了,可以本地访问其数据库。
|
||||
|
||||
<Alert context="warning">
|
||||
Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnection=true` 参数,才能连接上副本集的数据库。
|
||||
Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnection=true`
|
||||
参数,才能连接上副本集的数据库。
|
||||
</Alert>
|
||||
|
||||
### 4. 初始配置
|
||||
@@ -61,7 +64,7 @@ Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnec
|
||||
|
||||
**2. config 配置文件**
|
||||
|
||||
复制 `data/config.json` 文件,生成一个 `data/config.local.json` 配置文件,具体配置参数说明,可参考 [config 配置说明](/docs/development/configuration)
|
||||
复制 `data/config.json` 文件,生成一个 `data/config.local.json` 配置文件,具体配置参数说明,可参考 [config 配置说明](/docs/introduction/development/configuration)
|
||||
|
||||
**注意:json 配置文件不能包含注释,介绍中为了方便看才加入的注释**
|
||||
|
||||
@@ -128,7 +131,7 @@ make build name=app image=registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8
|
||||
FastGPT 在`pnpm i`后会执行`postinstall`脚本,用于自动生成`ChakraUI`的`Type`。如果没有权限,可以先执行`chmod -R +x ./scripts/`,再执行`pnpm i`。
|
||||
|
||||
仍不可行的话,可以手动执行`./scripts/postinstall.sh`里的内容。
|
||||
*如果是Windows下的话,可以使用git bash给`postinstall`脚本添加执行权限并执行sh脚本*
|
||||
_如果是Windows下的话,可以使用git bash给`postinstall`脚本添加执行权限并执行sh脚本_
|
||||
|
||||
### TypeError: Cannot read properties of null (reading 'useMemo' )
|
||||
|
||||
@@ -148,7 +151,11 @@ FastGPT 在`pnpm i`后会执行`postinstall`脚本,用于自动生成`ChakraUI
|
||||
|
||||
遇到困难了吗?有任何问题吗? 加入飞书群与开发者和用户保持沟通。
|
||||
|
||||
<img width="400px" src="https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png" className="medium-zoom-image" />
|
||||
<img
|
||||
width="400px"
|
||||
src="https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png"
|
||||
className="medium-zoom-image"
|
||||
/>
|
||||
|
||||
## 代码结构说明
|
||||
|
||||
@@ -160,12 +167,12 @@ FastGPT 使用了 nextjs 的 page route 作为框架。为了区分好前后端
|
||||
|
||||
FastGPT 采用 pnpm workspace 方式构建 monorepo 项目,主要分为两个部分:
|
||||
|
||||
- projects/app - FastGPT 主项目
|
||||
- packages/ - 子模块
|
||||
- global - 共用代码,通常是放一些前后端都能执行的函数、类型声明、常量。
|
||||
- service - 服务端代码
|
||||
- web - 前端代码
|
||||
- plugin - 工作流自定义插件的代码
|
||||
- projects/app - FastGPT 主项目
|
||||
- packages/ - 子模块
|
||||
- global - 共用代码,通常是放一些前后端都能执行的函数、类型声明、常量。
|
||||
- service - 服务端代码
|
||||
- web - 前端代码
|
||||
- plugin - 工作流自定义插件的代码
|
||||
|
||||
### 领域驱动模式(DDD)
|
||||
|
||||
|
@@ -17,7 +17,7 @@ AI Proxy 与 One API 类似,也是作为一个 OpenAI 接口管理 & 分发系
|
||||
|
||||
## 运行原理
|
||||
|
||||
AI proxy 核心模块:
|
||||
AI proxy 核心模块:
|
||||
|
||||
1. 渠道管理:管理各家模型提供商的 API Key 和可用模型列表。
|
||||
2. 模型调用:根据请求的模型,选中对应的渠道;根据渠道的 API 格式,构造请求体,发送请求;格式化响应体成标准格式返回。
|
||||
@@ -47,12 +47,12 @@ AI proxy 相关功能,可以在`账号-模型提供商`页面找到。
|
||||
|
||||
1. 渠道名:展示在外部的渠道名称,仅作标识;
|
||||
2. 厂商:模型对应的厂商,不同厂商对应不同的默认地址和 API 密钥格式;
|
||||
3. 模型:当前渠道具体可以使用的模型,系统内置了主流的一些模型,如果下拉框中没有想要的选项,可以点击“新增模型”,[增加自定义模型](/docs/development/modelconfig/intro/#新增自定义模型);
|
||||
3. 模型:当前渠道具体可以使用的模型,系统内置了主流的一些模型,如果下拉框中没有想要的选项,可以点击“新增模型”,[增加自定义模型](/docs/introduction/development/modelconfig/intro/#新增自定义模型);
|
||||
4. 模型映射:将 FastGPT 请求的模型,映射到具体提供的模型上。例如:
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"gpt-4o-test": "gpt-4o",
|
||||
"gpt-4o-test": "gpt-4o"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -81,7 +81,7 @@ FatGPT 中的模型为 `gpt-4o-test`,向 AI Proxy 发起请求时也是 `gpt-4
|
||||
|
||||
### 3. 启用模型
|
||||
|
||||
最后在`模型配置`中,可以选择启用对应的模型,这样就能在平台中使用了,更多模型配置可以参考[模型配置](/docs/development/modelconfig/intro)
|
||||
最后在`模型配置`中,可以选择启用对应的模型,这样就能在平台中使用了,更多模型配置可以参考[模型配置](/docs/introduction/development/modelconfig/intro)
|
||||
|
||||

|
||||
|
||||
|
@@ -15,11 +15,11 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
#### AI Proxy
|
||||
|
||||
从 4.8.23 版本开始, FastGPT 支持在页面上配置模型提供商,即使用 [AI Proxy 接入教程](/docs/development/modelconfig/ai-proxy) 来进行模型聚合,从而可以对接更多模型提供商。
|
||||
从 4.8.23 版本开始, FastGPT 支持在页面上配置模型提供商,即使用 [AI Proxy 接入教程](/docs/introduction/development/modelconfig/ai-proxy) 来进行模型聚合,从而可以对接更多模型提供商。
|
||||
|
||||
#### One API
|
||||
|
||||
也可以使用 [OneAPI 接入教程](/docs/development/modelconfig/one-api)。你需要先在各服务商申请好 API 接入 OneAPI 后,才能在 FastGPT 中使用这些模型。示例流程如下:
|
||||
也可以使用 [OneAPI 接入教程](/docs/introduction/development/modelconfig/one-api)。你需要先在各服务商申请好 API 接入 OneAPI 后,才能在 FastGPT 中使用这些模型。示例流程如下:
|
||||
|
||||

|
||||
|
||||
@@ -223,7 +223,7 @@ FastGPT 页面上提供了每类模型的简单测试,可以初步检查模型
|
||||
|
||||
#### 私有部署模型
|
||||
|
||||
[点击查看部署 ReRank 模型教程](/docs/development/custom-models/bge-rerank/)
|
||||
[点击查看部署 ReRank 模型教程](/docs/introduction/development/custom-models/bge-rerank/)
|
||||
|
||||
### 接入语音识别模型
|
||||
|
||||
@@ -253,7 +253,7 @@ OneAPI 的语言识别接口,无法正确的识别其他模型(会始终识
|
||||
|
||||
所有接口均遵循 OpenAI 提供的模型格式,可参考 [OpenAI API 文档](https://platform.openai.com/docs/api-reference/introduction) 进行配置。
|
||||
|
||||
由于 OpenAI 没有提供 ReRank 模型,遵循的是 Cohere 的格式。[点击查看接口请求示例](/docs/development/faq/#如何检查模型问题)
|
||||
由于 OpenAI 没有提供 ReRank 模型,遵循的是 Cohere 的格式。[点击查看接口请求示例](/docs/introduction/development/faq/#如何检查模型问题)
|
||||
|
||||
### 模型价格配置
|
||||
|
||||
@@ -276,13 +276,13 @@ OneAPI 的语言识别接口,无法正确的识别其他模型(会始终识
|
||||
|
||||
### 添加模型
|
||||
|
||||
你可以在`FastGPT-plugin`项目中`modules/model/provider`目录下,找对应模型提供商的配置文件,并追加模型配置。请自行全文检查,`model`字段,必须在所有模型中唯一。具体配置字段说明,参考[模型配置字段说明](/docs/development/modelconfig/intro/#通过配置文件配置)
|
||||
你可以在`FastGPT-plugin`项目中`modules/model/provider`目录下,找对应模型提供商的配置文件,并追加模型配置。请自行全文检查,`model`字段,必须在所有模型中唯一。具体配置字段说明,参考[模型配置字段说明](/docs/introduction/development/modelconfig/intro/#通过配置文件配置)
|
||||
|
||||
## 旧版模型配置说明
|
||||
|
||||
配置好 OneAPI 后,需要在`config.json`文件中,手动的增加模型配置,并重启。
|
||||
|
||||
由于环境变量不利于配置复杂的内容,FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/development/docker/) 来挂载配置文件。
|
||||
由于环境变量不利于配置复杂的内容,FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/introduction/development/docker/) 来挂载配置文件。
|
||||
|
||||
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
|
||||
**Docker部署**,修改`config.json` 文件,需要重启容器。
|
||||
|
@@ -8,7 +8,8 @@ import { Alert } from '@/components/docs/Alert';
|
||||
FastGPT 还可以通过 PPIO LLM API 接入模型。
|
||||
|
||||
<Alert context="warning">
|
||||
以下内容搬运自 [FastGPT 接入 PPIO LLM API](https://ppinfra.com/docs/third-party/fastgpt-use),可能会有更新不及时的情况。
|
||||
以下内容搬运自 [FastGPT 接入 PPIO LLM
|
||||
API](https://ppinfra.com/docs/third-party/fastgpt-use),可能会有更新不及时的情况。
|
||||
</Alert>
|
||||
|
||||
FastGPT 是一个将 AI 开发、部署和使用全流程简化为可视化操作的平台。它使开发者不需要深入研究算法,
|
||||
@@ -32,15 +33,25 @@ PPIO 派欧云提供简单易用的 API 接口,让开发者能够轻松调用
|
||||
登录派欧云控制台 [API 秘钥管理](https://www.ppinfra.com/settings/key-management) 页面,点击创建按钮。
|
||||
注册账号填写邀请码【VOJL20】得 50 代金券
|
||||
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/BKWqbzI5PoYG6qxwAPxcinQDnob.png" alt="创建 API 密钥" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/BKWqbzI5PoYG6qxwAPxcinQDnob.png"
|
||||
alt="创建 API 密钥"
|
||||
/>
|
||||
|
||||
(3) 生成并保存 【API 密钥】
|
||||
|
||||
<Alert context="warning">
|
||||
秘钥在服务端是加密存储,请在生成时保存好秘钥;若遗失可以在控制台上删除并创建一个新的秘钥。
|
||||
秘钥在服务端是加密存储,请在生成时保存好秘钥;若遗失可以在控制台上删除并创建一个新的秘钥。
|
||||
</Alert>
|
||||
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/OkUwbbWrcoCY2SxwVMIcM2aZnrs.png" alt="生成 API 密钥" />
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/GExfbvcosoJhVKxpzKVczlsdn3d.png" alt="保存 API 密钥" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/OkUwbbWrcoCY2SxwVMIcM2aZnrs.png"
|
||||
alt="生成 API 密钥"
|
||||
/>
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/GExfbvcosoJhVKxpzKVczlsdn3d.png"
|
||||
alt="保存 API 密钥"
|
||||
/>
|
||||
|
||||
(4) 获取需要使用的模型 ID
|
||||
|
||||
@@ -55,7 +66,7 @@ deepseek 系列:
|
||||
## 2. 部署最新版 FastGPT 到本地环境
|
||||
|
||||
<Alert context="warning">
|
||||
请使用 v4.8.22 以上版本,部署参考: https://doc.tryfastgpt.ai/docs/development/intro/
|
||||
请使用 v4.8.22 以上版本,部署参考: https://doc.fastgpt.io/docs/introduction/development/intro/
|
||||
</Alert>
|
||||
|
||||
## 3. 模型配置(下面两种方式二选其一)
|
||||
@@ -68,33 +79,62 @@ OPENAI_BASE_URL= http://OneAPI-IP:OneAPI-PORT/v1
|
||||
|
||||
- 修改后重启 FastGPT,按下图在模型提供商中选择派欧云
|
||||
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/Fvqzb3kTroys5Uxkjlzco7kwnsb.png" alt="选择派欧云" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/Fvqzb3kTroys5Uxkjlzco7kwnsb.png"
|
||||
alt="选择派欧云"
|
||||
/>
|
||||
|
||||
- 测试连通性
|
||||
以 deepseek 为例,在模型中选择使用 deepseek/deepseek-r1/community,点击图中②的位置进行连通性测试,出现图中绿色的的成功显示证明连通成功,可以进行后续的配置对话了
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/FzKGbGsSPoX4Eexobj2cxcaTnib.png" alt="测试连通性" />
|
||||
以 deepseek 为例,在模型中选择使用 deepseek/deepseek-r1/community,点击图中②的位置进行连通性测试,出现图中绿色的的成功显示证明连通成功,可以进行后续的配置对话了
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/FzKGbGsSPoX4Eexobj2cxcaTnib.png"
|
||||
alt="测试连通性"
|
||||
/>
|
||||
|
||||
(2)不使用 OneAPI 接入 PPIO 模型
|
||||
|
||||
按照下图在模型提供商中选择派欧云
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/QbcdbPqRsoAmuyx2nlycQWFanrc.png" alt="选择派欧云" />
|
||||
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/QbcdbPqRsoAmuyx2nlycQWFanrc.png"
|
||||
alt="选择派欧云"
|
||||
/>
|
||||
|
||||
- 配置模型 自定义请求地址中输入:`https://api.ppinfra.com/v3/openai/chat/completions`
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/ZVyAbDIaxo7ksAxLI3HcexYYnZf.png" alt="配置模型" />
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/Ha9YbggkwoQsVdx1Z4Gc9zUSnle.png" alt="配置模型" />
|
||||
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/ZVyAbDIaxo7ksAxLI3HcexYYnZf.png"
|
||||
alt="配置模型"
|
||||
/>
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/Ha9YbggkwoQsVdx1Z4Gc9zUSnle.png"
|
||||
alt="配置模型"
|
||||
/>
|
||||
|
||||
- 测试连通性
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/V1f0b89uloab9uxxj7IcKT0rn3e.png" alt="测试连通性" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/V1f0b89uloab9uxxj7IcKT0rn3e.png"
|
||||
alt="测试连通性"
|
||||
/>
|
||||
|
||||
出现图中绿色的的成功显示证明连通成功,可以进行对话配置
|
||||
|
||||
## 4. 配置对话
|
||||
|
||||
(1)新建工作台
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/ZaGpbBH6QoVubIx2TsLcwYEInfe.png" alt="新建工作台" />
|
||||
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/ZaGpbBH6QoVubIx2TsLcwYEInfe.png"
|
||||
alt="新建工作台"
|
||||
/>
|
||||
(2)开始聊天
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/HzcTb4gobokVRQxTlU7cD5OunMf.png" alt="开始聊天" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/HzcTb4gobokVRQxTlU7cD5OunMf.png"
|
||||
alt="开始聊天"
|
||||
/>
|
||||
|
||||
## PPIO 全新福利重磅来袭 🔥
|
||||
|
||||
顺利完成教程配置步骤后,您将解锁两大权益:1. 畅享 PPIO 高速通道与 FastGPT 的效能组合;2.立即激活 **「新用户邀请奖励」** ————通过专属邀请码邀好友注册,您与好友可各领 50 元代金券,硬核福利助力 AI 工具效率倍增!
|
||||
|
||||
🎁 新手专享:立即使用邀请码【VOJL20】完成注册,50 元代金券奖励即刻到账!
|
||||
|
@@ -5,11 +5,10 @@ description: 通过 SiliconCloud 体验开源模型
|
||||
|
||||
[SiliconCloud(硅基流动)](https://cloud.siliconflow.cn/i/TR9Ym0c4) 是一个以提供开源模型调用为主的平台,并拥有自己的加速引擎。帮助用户低成本、快速的进行开源模型的测试和使用。实际体验下来,他们家模型的速度和稳定性都非常不错,并且种类丰富,覆盖语言、向量、重排、TTS、STT、绘图、视频生成模型,可以满足 FastGPT 中所有模型需求。
|
||||
|
||||
如果你想部分模型使用 SiliconCloud 的模型,可额外参考[OneAPI接入硅基流动](/docs/development/modelconfig/one-api/#硅基流动--开源模型大合集)。
|
||||
如果你想部分模型使用 SiliconCloud 的模型,可额外参考[OneAPI接入硅基流动](/docs/introduction/development/modelconfig/one-api/#硅基流动--开源模型大合集)。
|
||||
|
||||
本文会介绍完全使用 SiliconCloud 模型来部署 FastGPT 的方案。
|
||||
|
||||
|
||||
## 1. 注册 SiliconCloud 账号
|
||||
|
||||
1. [点击注册硅基流动账号](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
||||
@@ -37,8 +36,8 @@ CHAT_API_KEY=sk-xxxxxx
|
||||
|
||||
随便新建一个简易应用,选择对应模型,并开启图片上传后进行测试:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| | |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
可以看到,72B 的模型,性能还是非常快的,这要是本地没几个 4090,不说配置环境,输出怕都要 30s 了。
|
||||
@@ -47,22 +46,22 @@ CHAT_API_KEY=sk-xxxxxx
|
||||
|
||||
新建一个知识库(由于只配置了一个向量模型,页面上不会展示向量模型选择)
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| | |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
导入本地文件,直接选择文件,然后一路下一步即可。79 个索引,大概花了 20s 的时间就完成了。现在我们去测试一下知识库问答。
|
||||
|
||||
首先回到我们刚创建的应用,选择知识库,调整一下参数后即可开始对话:
|
||||
|
||||
| | | |
|
||||
| --- | --- | --- |
|
||||
| | | |
|
||||
| ------------------------------- | ------------------------------- | ------------------------------- |
|
||||
|  |  |  |
|
||||
|
||||
对话完成后,点击底部的引用,可以查看引用详情,同时可以看到具体的检索和重排得分:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| | |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
### 测试语音播放
|
||||
@@ -79,8 +78,8 @@ CHAT_API_KEY=sk-xxxxxx
|
||||
|
||||
开启后,对话输入框中,会增加一个话筒的图标,点击可进行语音输入:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| | |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
## 总结
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,6 @@ title: 分享链接身份鉴权
|
||||
description: FastGPT 分享链接身份鉴权
|
||||
---
|
||||
|
||||
import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
## 介绍
|
||||
|
||||
在 FastGPT V4.6.4 中,我们修改了分享链接的数据读取方式,为每个用户生成一个 localId,用于标识用户,从云端拉取对话记录。但是这种方式仅能保障用户在同一设备同一浏览器中使用,如果切换设备或者清空浏览器缓存则会丢失这些记录。这种方式存在一定的风险,因此我们仅允许用户拉取近`30天`的`20条`记录。
|
||||
@@ -44,15 +42,15 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
配置校验地址后,在每次分享链接使用时,都会向对应的地址发起校验和上报请求。
|
||||
|
||||
<Alert icon="🤖">这里仅需配置根地址,无需具体到完整请求路径。</Alert>
|
||||
这里仅需配置根地址,无需具体到完整请求路径。
|
||||
|
||||
### 2. 分享链接中增加额外 query
|
||||
|
||||
在分享链接的地址中,增加一个额外的参数: authToken。例如:
|
||||
|
||||
原始的链接:`https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192`
|
||||
原始的链接:`https://share.fastgpt.io/chat/share?shareId=648aaf5ae121349a16d62192`
|
||||
|
||||
完整链接: `https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`
|
||||
完整链接: `https://share.fastgpt.io/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`
|
||||
|
||||
这个`authToken`通常是你系统生成的用户唯一凭证(Token之类的)。FastGPT 会在鉴权接口的`body`中携带 token=[authToken] 的参数。
|
||||
|
||||
@@ -358,9 +356,9 @@ export default async function (ctx: FunctionContext) {
|
||||
|
||||
### 3. 修改分享链接参数
|
||||
|
||||
源分享链接:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c`
|
||||
源分享链接:`https://share.fastgpt.io/chat/share?shareId=64be36376a438af0311e599c`
|
||||
|
||||
修改后:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`
|
||||
修改后:`https://share.fastgpt.io/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`
|
||||
|
||||
### 4. 测试效果
|
||||
|
||||
|
@@ -13,7 +13,7 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、Azure 、国内主流模型和本地模型等。
|
||||
|
||||
可参考:[Sealos 快速部署 OneAPI](/docs/development/modelconfig/one-api)
|
||||
可参考:[Sealos 快速部署 OneAPI](/docs/introduction/development/modelconfig/one-api)
|
||||
|
||||
## 一键部署
|
||||
|
||||
@@ -79,7 +79,7 @@ FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、A
|
||||
|
||||
务必先配置至少一组模型,否则系统无法正常使用。
|
||||
|
||||
[点击查看模型配置教程](/docs/development/modelConfig/intro/)
|
||||
[点击查看模型配置教程](/docs/introduction/development/modelConfig/intro/)
|
||||
|
||||
## 收费
|
||||
|
||||
@@ -110,13 +110,13 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据
|
||||
|
||||
### 如何更新/升级 FastGPT
|
||||
|
||||
[升级脚本文档](https://doc.tryfastgpt.ai/docs/development/upgrading/)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!!
|
||||
[升级脚本文档](https://doc.fastgpt.io/docs/introduction/development/upgrading/)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!!
|
||||
|
||||
例如,目前是4.5 版本,要升级到4.5.1,就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。
|
||||
|
||||
升级步骤:
|
||||
|
||||
1. 查看[更新文档](/docs/development/upgrading/index/),确认要升级的版本,避免跨版本升级。
|
||||
1. 查看[更新文档](/docs/introduction/development/upgrading/index/),确认要升级的版本,避免跨版本升级。
|
||||
2. 打开 sealos 的应用管理
|
||||
3. 有2个应用 fastgpt , fastgpt-pro
|
||||
4. 点击对应应用右边3个点,变更。或者点详情后右上角的变更。
|
||||
@@ -145,7 +145,7 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据
|
||||
|
||||

|
||||
|
||||
[配置文件参考](https://doc.tryfastgpt.ai/docs/development/configuration/)
|
||||
[配置文件参考](https://doc.fastgpt.io/docs/introduction/development/configuration/)
|
||||
|
||||
### 修改站点名称以及 favicon
|
||||
|
||||
@@ -184,4 +184,4 @@ SYSTEM_FAVICON 可以是一个网络地址
|
||||
|
||||
### One API 使用
|
||||
|
||||
[参考 OneAPI 使用步骤](/docs/development/modelconfig/one-api/)
|
||||
[参考 OneAPI 使用步骤](/docs/introduction/development/modelconfig/one-api/)
|
||||
|
Reference in New Issue
Block a user