fix: load model keys from environment

This commit is contained in:
董宏凯 committed 2026-07-26 13:08:09 +08:00
1 parent 25153dbd84
commit 3779bb69ef
3 files changed
+20 -11

No files matched your search

+5 -4
View File
@@ -1,4 +1,4 @@
# ========================
# ========================
# EDIT BEFORE DEPLOYMENT
# ========================
# This file is loaded by start_backend.scheduler.sh through docker --env-file.
@@ -18,10 +18,8 @@ SERPER_API_KEY=your-serper-api-key
# GATEWAY_CORS_ORIGINS must include the exact frontend origins, separated by commas.
AUTH_JWT_SECRET=i3_BiBK44sYHiFIkChhDs46y57ZewJKO3diQDw01anI
GATEWAY_CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173,http://localhost:5174,http://127.0.0.1:5174,http://localhost:5183,http://127.0.0.1:5183,http://localhost:4200,http://47.88.25.99:7010
GATEWAY_CORS_ALLOW_ALL=0
GATEWAY_ENABLE_DOCS=true
GATEWAY_ENABLE_DOCS=false
GATEWAY_WORKERS=2
DEER_FLOW_AUTH_DISABLED=false
AUTH_TRUSTED_PROXIES=
# Scheduler dependency behavior.
@@ -63,3 +61,6 @@ DEER_FLOW_NOTEBOOK_API_BASE=http://127.0.0.1:8003
# 圆桌后台作业网关:缺省即 inprocess(进程内驱动真模型,后台挂起开箱即用);
# 仅前端联调时显式设 simulated(真实进度但不调真模型)。本行可删,留作文档。
ROUNDTABLE_JOB_GATEWAY=inprocess
DEEPSEEK_CHAT_API_KEY=sk-686b7bc000be4b7cbed6dccb3897c411
GLM5_FP8_API_KEY=modalresearch_gWu46FDpVLYZWPVEA3b_2fq8Jw2UJiKMgEm_Rxmn1SA
SILICONFLOW_API_KEY=sk-ighylafootabtuthwueirmoycccyqtdgbifyhozduvolkdyt
+6 -6
View File
@@ -14,7 +14,7 @@ models:
display_name: DeepSeek Chat
use: langchain_openai:ChatOpenAI
model: deepseek-chat
api_key: sk-686b7bc000be4b7cbed6dccb3897c411
api_key: $DEEPSEEK_CHAT_API_KEY
base_url: https://api.deepseek.com
request_timeout: 600.0
max_retries: 2
@@ -27,7 +27,7 @@ models:
display_name: zai-org/GLM-5-FP8
use: langchain_openai:ChatOpenAI
model: zai-org/GLM-5-FP8
api_key: modalresearch_gWu46FDpVLYZWPVEA3b_2fq8Jw2UJiKMgEm_Rxmn1SA
api_key: $GLM5_FP8_API_KEY
base_url: https://api.us-west-2.modal.direct/v1
request_timeout: 600.0
max_retries: 2
@@ -117,7 +117,7 @@ models:
display_name: deepseek-ai/DeepSeek-V4-Flash
use: langchain_openai:ChatOpenAI
model: deepseek-ai/DeepSeek-V4-Flash
api_key: sk-ighylafootabtuthwueirmoycccyqtdgbifyhozduvolkdyt
api_key: $SILICONFLOW_API_KEY
base_url: https://api.siliconflow.cn/v1/
max_tokens: 4096
temperature: 1.0
@@ -133,7 +133,7 @@ models:
display_name: Pro/MiniMaxAI/MiniMax-M2.5
use: langchain_openai:ChatOpenAI
model: Pro/MiniMaxAI/MiniMax-M2.5
api_key: sk-ighylafootabtuthwueirmoycccyqtdgbifyhozduvolkdyt
api_key: $SILICONFLOW_API_KEY
base_url: https://api.siliconflow.cn/v1/
max_tokens: 4096
temperature: 1.0
@@ -143,7 +143,7 @@ models:
display_name: inclusionAI/Ling-flash-2.0
use: langchain_openai:ChatOpenAI
model: inclusionAI/Ling-flash-2.0
api_key: sk-ighylafootabtuthwueirmoycccyqtdgbifyhozduvolkdyt
api_key: $SILICONFLOW_API_KEY
base_url: https://api.siliconflow.cn/v1/
max_tokens: 4096
temperature: 1.0
@@ -153,7 +153,7 @@ models:
display_name: deepseek-ai/DeepSeek-V4-Pro
use: langchain_openai:ChatOpenAI
model: deepseek-ai/DeepSeek-V4-Pro
api_key: sk-ighylafootabtuthwueirmoycccyqtdgbifyhozduvolkdyt
api_key: $SILICONFLOW_API_KEY
base_url: https://api.siliconflow.cn/v1/
max_tokens: 4096
temperature: 1.0
@@ -19,6 +19,14 @@ CONFIG_FILE="${CONFIG_DIR}/config.yaml"
EXTENSIONS_FILE="${CONFIG_DIR}/extensions_config.json"
LANGGRAPH_FILE="${CONFIG_DIR}/langgraph.json"
ENV_FILE="${CONFIG_DIR}/.env"
ENV_SOURCE="${CODE_DIR}/.env"
# The repository-level offline deployment keeps its tracked environment file
# one directory above the backend source. Prefer a backend-local file when a
# deployment provides one, otherwise use that shared file.
if [[ ! -f "${ENV_SOURCE}" && -f "$(dirname "${CODE_DIR}")/.env" ]]; then
ENV_SOURCE="$(dirname "${CODE_DIR}")/.env"
fi
copy_if_missing() {
local src="$1"
@@ -43,7 +51,7 @@ mkdir -p "${CONFIG_DIR}" "${RUNTIME_DIR}/data" "${LOGS_DIR}"
copy_if_missing "${CODE_DIR}/config.yaml" "${CONFIG_FILE}"
copy_if_missing "${CODE_DIR}/extensions_config.json" "${EXTENSIONS_FILE}"
copy_if_missing "${CODE_DIR}/langgraph.json" "${LANGGRAPH_FILE}"
copy_if_missing "${CODE_DIR}/.env" "${ENV_FILE}"
copy_if_missing "${ENV_SOURCE}" "${ENV_FILE}"
touch "${ENV_FILE}"
copy_dir_if_missing "${CODE_DIR}/skills" "${SKILLS_DIR}"