chat model config
This commit is contained in:
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.
|
||||
},
|
||||
```
|
||||
Reference in New Issue
Block a user