Skip to content

The Hermes plugin does not read the model output limit declared by the endpoint, leaving custom models without an output | Hermes 插件未读取端点声明的模型输出上限,自定义模型缺少输出预留 #3933

Closed

Description

@yanhuojiyusheng

(ai: custom/gpt-6.1-sol)

在 bili 0.1.202、master 8f98078 的 Hermes 原生插件中复现。使用 Magpie 的 group/sol、group/general 路由组,端点 /v1/models 声明 context_length: 500000 和 max_output_tokens: 384000。Hermes 未设置显式 max_tokens 时,bili 收到了 500000 的窗口,却没有输出预算,面板仍显示 500K,没有执行现有的输出预留策略。

原插件只把 pre_api_request 的 max_tokens 缓存在 session 中,再通过 x-bili-plugin-max-output 和 runtime-info 转发;没有读取模型元数据中的输出上限。具体模型可能命中 bili registry 的输出上限兜底,而 group/... 自定义名称没有对应项,因此暴露缺口。这不是 group 名称解析错误。#3262 / #3730 修复的是 contextWindow,#3223 则讨论相似的自定义 provider 输出上限问题。

建议的最小补丁:无显式输出预算时,调用 Hermes 已有的 fetch_endpoint_model_metadata(base_url),只按精确模型名读取归一化字段 max_completion_tokens;复用现有非阻塞 TTL memo,通过原有 header 和 runtime-info 双通道上报。显式预算仍优先,不添加配置或改变 headroom 策略。

验证边界:当前 Hermes 的 _extract_pricing 会被 Magpie modalities.input 列表触发 TypeError,使上述 accessor 返回 {}。Hermes 已有独立修复 PR:NousResearch/hermes-agent#140849 和 NousResearch/hermes-agent#137990 。因此 bili 补丁只能修复“宿主 accessor 正常返回但插件没有消费”的缺口,不能单独修好这台机器的完整链路。500K → 375K 是 bili 既有预留策略的结果,不是实测模型输入硬上限。

Activity

  1. changed the title [-]Hermes 插件未读取端点声明的模型输出上限,自定义模型缺少输出预留[/-] [+]The Hermes plugin does not read the model output limit declared by the endpoint, leaving custom models without an output | Hermes 插件未读取端点声明的模型输出上限,自定义模型缺少输出预留[/+] on Oct 20, 2026
  2. yanhuojiyusheng commented on Oct 20, 2026

    @yanhuojiyusheng
    ContributorAuthor

    (ai: custom/gpt-6.1-sol)

    已提交 PR #3934:#3934 。仅修改 bili 的 Hermes 插件和对应测试,并在 PR 中注明 Hermes 元数据解析错误的独立依赖及真实链路尚未验证的边界。

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions