Skip to content

v2026.08.29

Choose a tag to compare

@lianluo-esign lianluo-esign released this 29 Aug 18:01

计费准确性(#976)

  • Phase B1 · buffered 本地 tokenizer 兜底:上游返回 2xx 成功但 body 无 usage 时,用 gpt-tokenizer(o200k_base,纯 JS / workerd 安全)本地真数 prompt+completion token 归账,取代 chars/4 粗估。新增可审计计费来源标签 local_tokenizer。三处 buffered 站点接线:chat/responses、messages、gemini-native。
  • 反误标不变量:仅在 2xx + body 解析成功 + provider 未给 usage 时才兜底;!ok / 解析失败一律不合成。
  • 体积取舍已实测,B1 只内嵌 o200k(gzip +1.11MB),encodingForModel 留口子将来补 cl100k。
  • Phase A · Bedrock/Vertex $0 漏记修复:缺 dialect 分支导致真实用量被记 $0 的 BUG 已修。

其它(自 v2026.08.23.9 起累积)

  • 控制面 tenant-teardown / tenant-consumption-purge 运营路由 + 10 条 anti-drift 红清理
  • inference body 上限 1 MiB → 64 MiB
  • 计费分组配置发布到 KV 快照,去掉逐租户 fan-out
  • 受信 OAuth-bridge 免密登录(仅 verified email);console 网关 key 绑定浏览器会话
  • 租户后台展示 owner email

验证

gateway 全测绿(3293 + ratelimit 26 + tenancy 50)、billing 120、类型干净。已随超级仓 release v0.27.48 部署上线并核验(/healthz 200、/v1/models 401 missing_api_key)。