mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 22:03:54 +00:00
70
docSite/docs/develop/data_config/chat_models.md
Normal file
70
docSite/docs/develop/data_config/chat_models.md
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Other Chat Model Configuration
|
||||
|
||||
By default, FastGPT is only configured with 3 models of GPT. If you need to integrate other models, you need to do some additional configuration.
|
||||
|
||||
## 1. Install OneAPI
|
||||
|
||||
First, you need to deploy a [OneAPI](/docs/develop/oneapi) and add the corresponding "channel".
|
||||

|
||||
|
||||
## 2. Add FastGPT Configuration
|
||||
|
||||
You can find the configuration file in /client/src/data/config.json (for local development, you need to copy it as config.local.json). In the configuration file, there is a section for chat model configuration:
|
||||
|
||||
```json
|
||||
"ChatModels": [
|
||||
{
|
||||
"model": "gpt-3.5-turbo", // The model here needs to correspond to the model in OneAPI
|
||||
"name": "FastAI-4k", // The name displayed externally
|
||||
"contextMaxToken": 4000, // Maximum context token, calculated according to GPT35 regardless of the model. Models other than GPT need to roughly calculate this value themselves. You can call the official API to compare the token ratio and then roughly calculate it here.
|
||||
// For example: the ratio of Chinese and English tokens in Wenxin Yiyuan is basically 1:1, while the ratio of Chinese tokens in GPT is 2:1. If the maximum token of Wenxin Yiyuan is 4000, then you can fill in 8000 here, or fill in 7000 for safety.
|
||||
"quoteMaxToken": 2000, // Maximum token for quoting knowledge base
|
||||
"maxTemperature": 1.2, // Maximum temperature
|
||||
"price": 1.5, // Price per token => 1.5 / 100000 * 1000 = 0.015 yuan/1k token
|
||||
"defaultSystem": "" // Default system prompt
|
||||
},
|
||||
{
|
||||
"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": ""
|
||||
}
|
||||
],
|
||||
```
|
||||
|
||||
### Add a New Model
|
||||
|
||||
Taking Wenxin Yiyuan as an example:
|
||||
|
||||
```json
|
||||
"ChatModels": [
|
||||
...
|
||||
{
|
||||
"model": "ERNIE-Bot",
|
||||
"name": "Wenxin Yiyuan",
|
||||
"contextMaxToken": 4000,
|
||||
"quoteMaxToken": 2000,
|
||||
"maxTemperature": 1,
|
||||
"price": 1.2
|
||||
}
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
After adding it, restart the application and you can choose the Wenxin Yiyuan model for conversation.
|
BIN
docSite/docs/develop/data_config/imgs/chatmodels1.png
Normal file
BIN
docSite/docs/develop/data_config/imgs/chatmodels1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 176 KiB |
37
docSite/docs/develop/data_config/intro.md
Normal file
37
docSite/docs/develop/data_config/intro.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Quick Introduction
|
||||
|
||||
Due to the limitations of environment variables in configuring complex content, the new version of FastGPT uses ConfigMap to mount configuration files. You can find the default configuration file at client/data/config.json.
|
||||
In the development environment, you need to make a copy of config.json as config.local.json for it to take effect.
|
||||
This configuration file includes customization of the frontend page, system-level parameters, and AI dialogue models, etc.
|
||||
|
||||
## Brief Explanation of Basic Fields
|
||||
|
||||
Here, we will introduce some basic configuration fields.
|
||||
|
||||
```json
|
||||
// This configuration controls some styles of the frontend
|
||||
"FeConfig": {
|
||||
"show_emptyChat": true, // Whether to display the introduction page when the conversation page is empty
|
||||
"show_register": false, // Whether to display the registration button (including forget password, register account, and third-party login)
|
||||
"show_appStore": false, // Whether to display the app store (currently the permissions are not properly set, so it is useless to open it)
|
||||
"show_userDetail": false, // Whether to display user details (account balance, OpenAI binding)
|
||||
"show_git": true, // Whether to display Git
|
||||
"systemTitle": "FastAI", // The title of the system
|
||||
"authorText": "Made by FastAI Team.", // Signature
|
||||
"gitLoginKey": "" // Git login credentials
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
// This configuration file contains system-level parameters
|
||||
"SystemParams": {
|
||||
"gitLoginSecret": "", // Git login credentials
|
||||
"vectorMaxProcess": 15, // Maximum number of processes for vector generation, set in combination with database performance and key
|
||||
"qaMaxProcess": 15, // Maximum number of processes for QA generation, set in combination with database performance and key
|
||||
"pgIvfflatProbe": 20 // pg vector search probe. Can be ignored before setting up the index, usually only needed for more than 500,000 groups.
|
||||
},
|
||||
```
|
@@ -1,39 +0,0 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Config 配置文件说明
|
||||
|
||||
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 client/data/config.json 看到默认的配置文件。
|
||||
|
||||
开发环境下,你需要复制一份 config.json 成 config.local.json 文件才会生效。
|
||||
|
||||
这个配置文件中包含了前端页面定制、系统级参数、AI 对话的模型等……
|
||||
|
||||
## 基础字段粗略说明
|
||||
|
||||
这里会介绍一些基础的配置字段。
|
||||
|
||||
```json
|
||||
// 这个配置会控制前端的一些样式
|
||||
"FeConfig": {
|
||||
"show_emptyChat": true, // 对话页面,空内容时,是否展示介绍页
|
||||
"show_register": false, // 是否展示注册按键(包括忘记密码,注册账号和三方登录)
|
||||
"show_appStore": false, // 是否展示应用市场(不过目前权限还没做好,放开也没用)
|
||||
"show_userDetail": false, // 是否展示用户详情(账号余额、OpenAI 绑定)
|
||||
"show_git": true, // 是否展示 Git
|
||||
"systemTitle": "FastAI", // 系统的 title
|
||||
"authorText": "Made by FastAI Team.", // 签名
|
||||
"gitLoginKey": "" // Git 登录凭证
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
// 这个配置文件是系统级参数
|
||||
"SystemParams": {
|
||||
"gitLoginSecret": "", // Git 登录凭证
|
||||
"vectorMaxProcess": 15, // 向量生成最大进程,结合数据库性能和 key 来设置
|
||||
"qaMaxProcess": 15, // QA 生成最大进程,结合数据库性能和 key 来设置
|
||||
"pgIvfflatProbe": 20 // pg vector 搜索探针。没有设置索引前可忽略,通常 50w 组以上才需要设置。
|
||||
},
|
||||
```
|
Reference in New Issue
Block a user