feat(builtin-models): add YAML-based declarative config with ${ENV} interpolation
Allow built-in models to be declared in config/builtin_models.yaml
instead of inserting rows via SQL. On every startup the file is read
and each entry is UPSERT-ed into the models table (is_builtin=true)
by stable id.
Any string field may reference an environment variable with ${NAME}.
Unset variables are left as the literal placeholder so
misconfiguration surfaces clearly in provider calls rather than
failing silently with an empty token.
The file is optional: missing file, parse errors, and per-entry
upsert failures all log a warning without aborting startup.
docker-compose.yml adds env_file (.env, required:false) so
deployment-specific variables are passed through automatically.
This commit is contained in:
@@ -18,6 +18,27 @@ GIN_MODE=release
|
||||
# 可选值:true(自动放在 LOG_PATH 同目录下 llm_debug.log)、false/空(关闭)、或指定文件路径
|
||||
# LLM_DEBUG_LOG=true
|
||||
|
||||
# ========== 内置模型(Built-in Models)声明式配置(可选) ==========
|
||||
# 如果启用了 config/builtin_models.yaml(见 config/builtin_models.yaml.example),
|
||||
# YAML 中的 ${NAME} 占位符会在应用启动期从这里读取真实值。变量名由 YAML 自行
|
||||
# 指定,下面给出常见命名作为参考;按你自己的部署改名也可以。详见
|
||||
# docs/BUILTIN_MODELS.md。
|
||||
#
|
||||
# LLM_MODEL_NAME=
|
||||
# LLM_BASE_URL=
|
||||
# LLM_API_KEY=
|
||||
# LLM_PROVIDER=openai
|
||||
#
|
||||
# EMBEDDING_MODEL_NAME=
|
||||
# EMBEDDING_BASE_URL=
|
||||
# EMBEDDING_API_KEY=
|
||||
# EMBEDDING_PROVIDER=openai
|
||||
#
|
||||
# RERANK_MODEL_NAME=
|
||||
# RERANK_BASE_URL=
|
||||
# RERANK_API_KEY=
|
||||
# RERANK_PROVIDER=generic
|
||||
|
||||
# ========== Langfuse 可观测性(可选) ==========
|
||||
# 用于追踪 chat / embedding / rerank / VLM / ASR 模型调用,统计 token 消耗。
|
||||
# 详细说明:docs/Langfuse集成.md
|
||||
|
||||
Reference in New Issue
Block a user