Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
4f0f950d
authored
Aug 31, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs
parent
c1f47853
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
56 additions
and
97 deletions
+56
-97
docSite/assets/imgs/oneapi-demo1.png
+0
-0
docSite/content/docs/development/_index.md
+4
-4
docSite/content/docs/development/configuration.md
+1
-1
docSite/content/docs/development/development.md
+3
-3
docSite/content/docs/installation/docker.md
+2
-2
docSite/content/docs/installation/one-api.md
+36
-3
docSite/content/docs/installation/reference/models.md
+0
-72
docSite/content/docs/use-cases/_index.md
+5
-6
docSite/content/docs/workflow/_index.md
+5
-6
No files found.
docSite/assets/imgs/oneapi-demo1.png
0 → 100644
View file @
4f0f950d
166 KB
docSite/content/docs/
installation/reference
/_index.md
→
docSite/content/docs/
development
/_index.md
View file @
4f0f950d
---
---
weight
:
75
0
weight
:
20
0
title
:
'
配置文件
'
title
:
'
开发指南
'
description
:
'
FastGPT
配置指南
'
description
:
'
本地开发
FastGPT
必看
'
icon
:
quick_reference_all
icon
:
'
code_blocks'
draft
:
false
draft
:
false
images
:
[]
images
:
[]
---
---
docSite/content/docs/
installation/reference
/configuration.md
→
docSite/content/docs/
development
/configuration.md
View file @
4f0f950d
...
@@ -4,7 +4,7 @@ description: 'FastGPT 配置参数介绍'
...
@@ -4,7 +4,7 @@ description: 'FastGPT 配置参数介绍'
icon
:
'
settings'
icon
:
'
settings'
draft
:
false
draft
:
false
toc
:
true
toc
:
true
weight
:
751
weight
:
100
---
---
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在
`client/data/config.json`
看到默认的配置文件。可以参考
[
docker-compose 快速部署
](
/docs/installation/docker/
)
来挂载配置文件。
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在
`client/data/config.json`
看到默认的配置文件。可以参考
[
docker-compose 快速部署
](
/docs/installation/docker/
)
来挂载配置文件。
...
...
docSite/content/docs/development.md
→
docSite/content/docs/development
/development
.md
View file @
4f0f950d
---
---
weight
:
50
0
weight
:
0
title
:
'
开发指南
'
title
:
'
快速开始
'
description
:
'
对
FastGPT
进行开发调试'
description
:
'
对
FastGPT
进行开发调试'
icon
:
'
developer_guide'
icon
:
'
developer_guide'
draft
:
false
draft
:
false
...
@@ -49,7 +49,7 @@ client 目录下为 FastGPT 核心代码。NextJS 框架前后端放在一起,
...
@@ -49,7 +49,7 @@ client 目录下为 FastGPT 核心代码。NextJS 框架前后端放在一起,
**2. config 配置文件**
**2. config 配置文件**
复制 data/config.json 文件,生成一个 data/config.local.json 配置文件。具体的参数说明,可参考
[
config 配置说名
](
/docs/
installation/reference
/configuration
)
复制 data/config.json 文件,生成一个 data/config.local.json 配置文件。具体的参数说明,可参考
[
config 配置说名
](
/docs/
development
/configuration
)
**注意:json 配置文件不能包含注释,介绍中为了方便看才加入的注释**
**注意:json 配置文件不能包含注释,介绍中为了方便看才加入的注释**
...
...
docSite/content/docs/installation/docker.md
View file @
4f0f950d
...
@@ -162,7 +162,7 @@ docker-compose up -d
...
@@ -162,7 +162,7 @@ docker-compose up -d
### 如何自定义配置文件?
### 如何自定义配置文件?
需要在
`docker-compose.yml`
同级目录创建一个
`config.json`
文件,内容参考:
[
配置详解
](
/docs/
installation/reference/configuration/
)
需要在
`docker-compose.yml`
同级目录创建一个
`config.json`
文件,内容参考:
[
配置详解
](
/docs/
development/configuration
)
然后修改
`docker-compose.yml`
中的
`fastgpt`
容器内容,增加挂载选项即可:
然后修改
`docker-compose.yml`
中的
`fastgpt`
容器内容,增加挂载选项即可:
...
@@ -186,4 +186,4 @@ fastgpt:
...
@@ -186,4 +186,4 @@ fastgpt:
-
./config.json:/app/data/config.json
-
./config.json:/app/data/config.json
```
```
> 参考[配置详解](/docs/
installation/reference/configuration/
)
> 参考[配置详解](/docs/
development/configuration
)
docSite/content/docs/installation/one-api.md
View file @
4f0f950d
...
@@ -7,6 +7,8 @@ toc: true
...
@@ -7,6 +7,8 @@ toc: true
weight
:
730
weight
:
730
---
---
默认情况下,FastGPT 只配置了 GPT 的 3 个模型,如果你需要接入其他模型,需要进行一些额外配置。
[
one-api
](
https://github.com/songquanpeng/one-api
)
是一个 OpenAI 接口管理 & 分发系统,可以通过标准的 OpenAI API 格式访问所有的大模型,开箱即用。
[
one-api
](
https://github.com/songquanpeng/one-api
)
是一个 OpenAI 接口管理 & 分发系统,可以通过标准的 OpenAI API 格式访问所有的大模型,开箱即用。
FastGPT 可以通过接入 one-api 来实现对各种大模型的支持。部署方法也很简单。
FastGPT 可以通过接入 one-api 来实现对各种大模型的支持。部署方法也很简单。
...
@@ -45,7 +47,7 @@ SqlLite 版本不支持多实例,适合个人小流量使用,但是价格非
...
@@ -45,7 +47,7 @@ SqlLite 版本不支持多实例,适合个人小流量使用,但是价格非
## 使用步骤
## 使用步骤
**1. 登录 one-api**
### 1. 登录 one-api
打开 【one-api 应用详情】,找到访问地址:
打开 【one-api 应用详情】,找到访问地址:


...
@@ -53,7 +55,7 @@ SqlLite 版本不支持多实例,适合个人小流量使用,但是价格非
...
@@ -53,7 +55,7 @@ SqlLite 版本不支持多实例,适合个人小流量使用,但是价格非
登录 one-api
登录 one-api


**2. 创建渠道和令牌**
### 2. 创建渠道和令牌
在 one-api 中添加对应渠道,直接点击 【添加基础模型】,不要遗漏了向量模型
在 one-api 中添加对应渠道,直接点击 【添加基础模型】,不要遗漏了向量模型


...
@@ -61,7 +63,7 @@ SqlLite 版本不支持多实例,适合个人小流量使用,但是价格非
...
@@ -61,7 +63,7 @@ SqlLite 版本不支持多实例,适合个人小流量使用,但是价格非
创建一个令牌
创建一个令牌


**3. 修改 FastGPT 的环境变量**
### 3. 修改 FastGPT 的环境变量
有了 one-api 令牌后,FastGPT 可以通过修改 baseurl 和 key 去请求到 one-api,再由 one-api 去请求不同的模型。修改下面两个环境变量:
有了 one-api 令牌后,FastGPT 可以通过修改 baseurl 和 key 去请求到 one-api,再由 one-api 去请求不同的模型。修改下面两个环境变量:
...
@@ -71,3 +73,34 @@ OPENAI_BASE_URL=https://xxxx.cloud.sealos.io/v1
...
@@ -71,3 +73,34 @@ OPENAI_BASE_URL=https://xxxx.cloud.sealos.io/v1
# 下面的 key 是由 one-api 提供的令牌
# 下面的 key 是由 one-api 提供的令牌
CHAT_API_KEY
=
sk-xxxxxx
CHAT_API_KEY
=
sk-xxxxxx
```
```
## 接入其他模型
**以添加文心一言为例:**
### 1. One-API 添加对应模型渠道
!
[
](/imgs/oneapi-demo1.png)
### 2. 修改 FastGPT 配置文件
可以在
`/client/src/data/config.json`
里找到配置文件(本地开发需要复制成 config.local.json),配置文件中有一项是对话模型配置:
```
json
"ChatModels"
:
[
...
{
"model"
:
"ERNIE-Bot"
,
//
这里的模型需要对应
OneAPI
的模型
"name"
:
"文心一言"
,
//
对外展示的名称
"contextMaxToken"
:
4000
,
//
最大长下文
token,无论什么模型都按
GPT
35
的计算。GPT
外的模型需要自行大致计算下这个值。可以调用官方接口去比对
Token
的倍率,然后在这里粗略计算。
//
例如:文心一言的中英文
token
基本是
1
:
1
,而
GPT
的中文
Token
是
2
:
1
,如果文心一言官方最大
Token
是
4000
,那么这里就可以填
8000
,保险点就填
7000
.
"quoteMaxToken"
:
2000
,
//
引用知识库的最大
Token
"maxTemperature"
:
1
,
//
最大温度
"price"
:
0
,
//
1
个token
价格
=>
1.5
/
100000
*
1000
=
0.015
元/
1
k
token
"defaultSystem"
:
""
//
默认的系统提示词
}
...
],
```
添加完后,重启 FastGPT 即可在选择文心一言模型进行对话。
docSite/content/docs/installation/reference/models.md
deleted
100644 → 0
View file @
c1f47853
---
title
:
'
多模型支持'
description
:
'
快速接入除了
GPT
以外的其他大模型'
icon
:
'
model_training'
draft
:
false
toc
:
true
weight
:
752
---
默认情况下,FastGPT 只配置了 GPT 的 3 个模型,如果你需要接入其他模型,需要进行一些额外配置。
## 部署 one-api
首先你需要部署一个
[
one-api
](
/docs/installation/one-api/
)
,并添加对应的【渠道】和【令牌】,并修改 FastGPT 环境变量,具体可参考
[
快速部署 one-api
](
/docs/installation/one-api
)
## 添加 FastGPT 配置文件
可以在
`/client/src/data/config.json`
里找到配置文件(本地开发需要复制成 config.local.json),配置文件中有一项是对话模型配置:
```
json
"ChatModels"
:
[
{
"model"
:
"gpt-3.5-turbo"
,
//
这里的模型需要对应
OneAPI
的模型
"name"
:
"FastAI-4k"
,
//
对外展示的名称
"contextMaxToken"
:
4000
,
//
最大长下文
token,无论什么模型都按
GPT
35
的计算。GPT
外的模型需要自行大致计算下这个值。可以调用官方接口去比对
Token
的倍率,然后在这里粗略计算。
//
例如:文心一言的中英文
token
基本是
1
:
1
,而
GPT
的中文
Token
是
2
:
1
,如果文心一言官方最大
Token
是
4000
,那么这里就可以填
8000
,保险点就填
7000
.
"quoteMaxToken"
:
2000
,
//
引用知识库的最大
Token
"maxTemperature"
:
1.2
,
//
最大温度
"price"
:
1.5
,
//
1
个token
价格
=>
1.5
/
100000
*
1000
=
0.015
元/
1
k
token
"defaultSystem"
:
""
//
默认的系统提示词
},
{
"model"
:
"gpt-3.5-turbo-16k"
,
"name"
:
"FastAI-16k"
,
"contextMaxToken"
:
16000
,
"quoteMaxToken"
:
8000
,
"maxTemperature"
:
1.2
,
"price"
:
3
,
"defaultSystem"
:
""
},
{
"model"
:
"gpt-4"
,
"name"
:
"FastAI-Plus"
,
"contextMaxToken"
:
8000
,
"quoteMaxToken"
:
4000
,
"maxTemperature"
:
1.2
,
"price"
:
45
,
"defaultSystem"
:
""
}
],
```
### 添加新的对话模型
以添加文心一言为例:
```
json
"ChatModels"
:
[
...
{
"model"
:
"ERNIE-Bot"
,
"name"
:
"文心一言"
,
"contextMaxToken"
:
4000
,
"quoteMaxToken"
:
2000
,
"maxTemperature"
:
1
,
"price"
:
1.2
}
...
]
```
添加完后,重启 FastGPT 即可在选择文心一言模型进行对话。
docSite/content/docs/use-cases/_index.md
View file @
4f0f950d
---
---
weight
:
6
00
weight
:
1
00
title
:
"
使用案例"
title
:
'
使用案例'
description
:
"
有关
FastGPT
其他实践案例的更多信息"
description
:
'
有关
FastGPT
其他实践案例的更多信息'
icon
:
"
cases"
icon
:
'
cases'
draft
:
false
draft
:
false
images
:
[]
images
:
[]
---
---
\ No newline at end of file
docSite/content/docs/workflow/_index.md
View file @
4f0f950d
---
---
weight
:
40
0
weight
:
1
0
title
:
"
高级编排"
title
:
'
高级编排'
description
:
"
FastGPT
高级编排文档"
description
:
'
FastGPT
高级编排文档'
icon
:
"
family_history"
icon
:
'
family_history'
draft
:
false
draft
:
false
images
:
[]
images
:
[]
---
---
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment