fix: 平台 type 放开校验;模型唯一键改为 平台名/模型id

- type 仅决定余额适配器,未知值合法(查不了余额而已),不再报非法
- 打平视图 cfg.models:id = 内部唯一键「平台名/模型id」(池/会话/用量/前端按它认模型,调用处字段名不变),
  mid = 发给上游的原始模型名(callModel body.model 用它)
- 同平台内模型 id 必须唯一;不同平台允许同 id(旧版直接报错的问题)
- 旧 models[] 迁移时平台名自动去重,避免唯一键碰撞
- 前端:卡片/编辑器展示 mid(原始名),编辑弹窗新增时按 平台+id 查重
- concurrency 仍仅解析记录,调度保持每模型 1 会话
This commit is contained in:
2026-09-02 23:09:04 +08:00
parent 7e046e5bbe
commit e3bfe0a1d5
9 changed files with 302 additions and 99 deletions
+19 -11
View File
@@ -809,19 +809,27 @@ networks:
## 十四、配置文件示例
```yaml
models:
- id: ds1
display_name: "AMD DeepSeek 1"
# 模型池:平台(platforms) → Key → 模型 三层。url/type 配在平台,api_key/concurrency 配在 Key,
# 模型只声明 {id, display_name, vision}。加载时打平成全局模型列表。
platforms:
- name: proxy-a
url: "https://proxy-a.example.com/v1"
api_key: "sk-..."
- id: ds2
display_name: "AMD DeepSeek 2"
url: "https://proxy-b.example.com/v1"
api_key: "sk-..."
- id: ds3
display_name: "AMD DeepSeek 3"
type: openai # openai/deepseek/custom,决定余额查询适配器(预留)
keys:
- api_key: "sk-..."
concurrency: 1 # 该 Key 并发会话数,默认 1(当前仅记录,未参与调度)
models:
- id: ds1
display_name: "AMD DeepSeek 1"
# vision: true # 选填,默认 false
- name: proxy-c
url: "https://proxy-c.example.com/v1"
api_key: "sk-..."
type: custom
keys:
- api_key: "sk-..."
models:
- id: ds3
display_name: "AMD DeepSeek 3"
workspace_root: "/workspace/tasks"