For deployment of LLMs on GPU devices, support naive chat & agent chat.
sudo ./install.sh # need superuser./run.sh./run.sh model stop (Optional)
./run.sh model dev./run.sh view stop (Optional)
./run.sh view dev./run.sh frontend devRevise the field agent_type & default_lang in configs/global.yml to change the agent mode for LLM.
base:
agent_type: null
default_lang: enagent_type
null: naive chat modebuilt-in: only for ChatGLM3 built-in tool usage in this versionreact: ReAct agentrewoo: ReWOO agent
default_lang
zh: Simplified Chinese promptsen: English prompts
NOTE:
- The built-in agent of ChatGLM3 conflicts with ReAct agent
- The capacity of agents depends on tools defined in
agent/tools
[Mandatory]
-
Create OAuth Application of Github & Google with fields as follow:
- Homepage URL:
$URL - Callback URL:
$URL/api/auth/callback
- Homepage URL:
-
Fill the section
frontend-envinconfigs/global.ymlas follow:
frontend:
env:
NEXTAUTH_URL: 'http://localhost:8501'
NEXTAUTH_SECRET: 'A CHOSEN SECRET TOKEN'
GITHUB_ID: "$GITHUB_ID"
GITHUB_SECRET: "$GITHUB_SECRET"
GOOGLE_ID: "$GOOGLE_ID"
GOOGLE_SECRET: "$GOOGLE_SECRET"[Support LLM]: ChatGLM, Qwen, InternLM
First configure the LLM model for local deployment by the section llm in configs/global.yml as follow:
llm:
# The model_name defined by yourself for llm.chat(query, select_model=model_name)
# Multiple subsection in `llm` section means deploying multiple models
model_1:
# The llm type support in backend/llm
type: ChatGLM
# local llm model path or huggingface remote repo name
llm_name_or_path: THUDM/chatglm3-6b
...Configure the section api-model in configs/global.yml as follow:
api:
model:
host: 0.0.0.0
port: 10080- Revise
/etc/mongodb.conf, and startup mongodb service bysystemctl|service - [Mandatory] Configure the
mongosection inconfigs/global.ymlas follow:
mongo:
database: chat
host: 0.0.0.0
port: 27017Backend: LLM & embedding Layer
./run.sh model restartBackend: View Layer
./run.sh view restartExport
python -m scripts.history_data_process --operation export --output_dir $EXPORT_DIR --output_name $EXPORT_NAME --split_size $SPLIT_SIZE- EXPORT_DIR: The output dir of export feedback data
- EXPORT_NAME: The output filename(filename suffix
.jsonl) - SPLIT_SIZE: Data number of a single export file,default 0
- 0: Export into a file
{EXPORT_NAME}.jsonl - >0: Export into chunk files named
{EXPORT_NAME}_{idx}.jsonl, each chunk file contains $SPLIT_SIZE data
- 0: Export into a file
Clear
python -m scripts.history_data_process --operation delete