This commit is contained in:
@@ -24,7 +24,7 @@ class FrontendConfig:
|
||||
layout: str = "wide"
|
||||
|
||||
# ==================== 模型配置 ====================
|
||||
default_model: str = "zhipu"
|
||||
default_model: str = "local" # 更改为local作为默认模型
|
||||
model_options: dict = None
|
||||
|
||||
# ==================== 用户配置 ====================
|
||||
@@ -41,9 +41,9 @@ class FrontendConfig:
|
||||
"""初始化后处理 - 设置默认值和加载环境变量"""
|
||||
if self.model_options is None:
|
||||
self.model_options = {
|
||||
"zhipu": "智谱 GLM-4.7-Flash(在线)",
|
||||
"deepseek": "DeepSeek V3.2(在线)",
|
||||
"local": "本地 llama.cpp(Gemma-4)"
|
||||
"local": "本地 llama.cpp(Gemma-4)", # 本地模型作为第一个
|
||||
"deepseek": "DeepSeek V3.2(在线)", # DeepSeek 作为中间
|
||||
"zhipu": "智谱 GLM-4.7-Flash(在线)" # GLM-4.7 作为最后一个
|
||||
}
|
||||
|
||||
# 从环境变量加载配置
|
||||
@@ -53,9 +53,9 @@ class FrontendConfig:
|
||||
"""从环境变量加载配置(优先级最高)"""
|
||||
# API 地址(移除 /chat 后缀)
|
||||
# 优先级:环境变量 API_URL > 默认值
|
||||
api_url = os.getenv("API_URL", "http://localhost:8083")
|
||||
api_url = os.getenv("API_URL", "http://127.0.0.1:8083")
|
||||
self.api_base = api_url.replace("/chat", "").rstrip("/")
|
||||
|
||||
|
||||
# 全局配置实例(单例模式)
|
||||
config = FrontendConfig()
|
||||
config = FrontendConfig()
|
||||
Reference in New Issue
Block a user