Skip to content

[Epic] 模型 Provider 与运行时预算 / Model providers and runtime budgets #35

Closed
3 of 3 issues completed

Description

@Qiyuanqiii

目标 / Goal

在现有 Anthropic-compatible 与 mock 能力之上,完成可扩展 Provider、可解释资格检测和统一 Token/时间/金额预算。

Extend the current Anthropic-compatible and mock stack with additional providers, explainable qualification, and unified token/time/cost budgets.

当前基线 / Current baseline

  • Mock Provider 与 Router 已存在。
  • DeepSeek Anthropic-compatible 真实多轮路径已通过本地验收。
  • MiMo 适配点存在,但当前本机未配置且没有可复现验收证据。
  • OpenAI-compatible 与 Ollama 仍是扩展点。
  • 累计 Token/模型时间预算已存在,金额预算尚未完成。

子任务范围 / Child scope

  • OpenAI-compatible Provider;
  • Ollama 本地 Provider;
  • 金额预算、价格快照、资格检测和诊断矩阵。

完成定义 / Definition of done

涉及目录 / Affected directories

  • internal/llm/
  • internal/modelregistry/
  • internal/credential/
  • internal/application/
  • internal/domain/
  • internal/store/
  • internal/contextmgr/
  • internal/httpapi/
  • cmd/cyberagent/
  • web/src/
  • configs/

Activity

  1. added
    goPull requests that update go code
    roadmapProduct roadmap and cross-cutting delivery tracking
    epicParent issue grouping related deliverables
    providerLLM provider and model runtime
    on Aug 13, 2026
  2. Qiyuanqiii commented on Aug 15, 2026

    @Qiyuanqiii
    MemberAuthor

    Epic 收口 / Epic closure

    三个子任务已全部完成并合并,完成定义五项均已核对通过:

    子任务 PR 关键交付
    #47 OpenAI-compatible Provider #60 严格 Chat Completions 适配、工具流式协议、凭证/Base URL/模型环境命名空间
    #48 Ollama 本地 Provider #63 显式 loopback-only、能力探测、no-tool 双层安全路径、稳定错误映射(ADR 0100)
    #49 金额预算、价格快照、资格诊断 #64 整数 micro-USD 账本 + 算子价格快照 + 8 值资格 taxonomy(schema v100,ADR 0101)

    完成定义逐项证据

    1. 统一接口:所有 Provider 实现同一 llm.Provider;Registry 统一配置、模型列表、Harness profile、凭证状态与诊断。
    2. 最小 schema:Harness profile 按 Provider 输出 transport/tool/json 策略;OpenAI 严格 profile 只发送协议字段;Ollama 未确认工具能力的模型在 Harness 与 Provider 两层拒绝透传 Tool schema。
    3. 资格检测:8 值 taxonomy(含未配置/网络/协议/容量/模型不支持 + rate_limit/auth_failed/available),持久化并接入诊断、qualification 与可用性视图;未诊断留空显示中性状态。
    4. 预算:Token/时间在每次调用前复核并持久化累计;金额走 reserve→call→settle-or-release 账本,终态 model.* 事件对账自愈,run 终态强制释放;MaxCostUSD>0 才启用、缺价格条目 fail-closed。
    5. Secret:仅进 OS 凭证管理器,明文永不返回/落库;模型可用性与 OpenAPI 有 secret-free 审计;Web 严格校验 redacted 视图。

    保留的边界(非目标,记录在 ADR 0101)

    • Mission 级金额上限与 vendor 价格订阅仍留待后续;当前“Mission 总金额”由 run 聚合覆盖。
    • Ollama 不自动安装/pull/扫描局域网,真实 smoke 为文档化可选人工步骤。
    • 金额闸门未启用(MaxCostUSD<=0)的 run 完全不记账,行为与以前一致。

    关闭本 epic。后续 Provider(如其他 OpenAI-compatible 厂商)与预算扩展均按新的独立 issue 从统一接口与 fail-closed 边界出发。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicParent issue grouping related deliverablesgoPull requests that update go codeproviderLLM provider and model runtimeroadmapProduct roadmap and cross-cutting delivery tracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions