Skip to content

feat(api-service): 支持自定义模型和多账号绑定调度 - #2666

Open
lxjmaster wants to merge 4 commits into
jlcodes99:mainfrom
lxjmaster:feat/api-service-custom-models
Open

lxjmaster wants to merge 4 commits into
jlcodes99:mainfrom
lxjmaster:feat/api-service-custom-models

Conversation

@lxjmaster

@lxjmaster lxjmaster commented Sep 30, 2026 •

Copy link
Copy Markdown

修改内容

API 服务此前无法自由配置请求模型 ID。本次在现有模型配置页增加自定义模型,并将模型目录、账号绑定与实际请求调度打通。

  • 支持新增、编辑和删除自定义模型,配置请求模型 ID、承接账号及上游模型 ID;同一请求模型可绑定多个账号,各账号可使用不同上游模型。
  • 在 API Key 供应商编辑页增加独立的“同步模型供应商到 API 服务”开关;关闭自动同步后,手动模型映射仍可使用。旧账号缺失该字段时保持原有同步行为,新建账号默认关闭。
  • 调度、会话亲和、并发等待和失败切换均限定在模型绑定的账号范围内,并遵守 API Key 的账号范围与模型排除规则。
  • 手动映射覆盖同名自动模型,删除后恢复自动贡献;统一模型目录与路由的别名处理,避免重复展开或别名碰撞。
  • 明确的模型不支持错误可切换候选账号;流式输出开始后不重放请求。
  • API Key 轮换导致账号 ID 改变时迁移模型及服务相关绑定;补齐原生供应商自定义上游模型注册,并保留已保存的模型目录。
  • 已合并最新上游 main,解决与当前原生路由、模型能力及账号编辑实现的冲突。

验证

  • npm run typecheck 通过。
  • 18 项相关 TypeScript 回归测试通过,覆盖供应商凭据编辑和本地接入操作。
  • Go sidecar go test ./... -count=1 通过。
  • 27 项 Rust 定向回归通过,覆盖自定义模型、原生调度、账号范围、别名、目录同步和密钥轮换。
  • git diff --check 通过。

lxjmaster and others added 2 commits September 30, 2026 14:09
Add configurable request-to-upstream model mappings and independent provider catalog synchronization. Restrict scheduling and failover to bound accounts, preserve mappings during key rotation, and cover routing regressions.
feat(api-service): 支持自定义模型和多账号绑定调度
Merge jlcodes99/cockpit-tools main at 76fbea0 while retaining custom models, per-account upstream mappings, and independent API service catalog synchronization.

Adapt native and sidecar routing, preserve scoped aliases and credential-reference migration, and keep service-sync updates under account edit locks.

Validation: frontend build and 1627 TypeScript tests, full Go sidecar suite, and 175 targeted Rust regression tests passed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant