Wattage — AI agent token-spend profiler and cost-regression gate

A Kill-A-Watt meter for AI agents. 解析 OTel trace 分析 token 浪费模式,定价每项浪费的金额,给出修复建议,并可在 CI 中对成本变化设置回归门限。

  • 类型: LLMOps / Agent Observability
  • 仓库: https://github.com/faizannraza/wattage
  • 语言: Python + TypeScript (CLI)
  • 安装: uvx wattage report trace.json — 零配置,完全离线,无需 API Key
  • 发布时间: 2026-07-27 (Show HN)
  • Stars: ~0 (全新发布)

核心能力

  • 读取 OTLP JSON trace 导出,为每次调用定价
  • 内置探测器分析 prompt 重复、cache miss、过长 context 等浪费模式
  • 输出结构化报告:token 效率评级、成本分解、具体修复建议
  • CI 集成:当 agent 变更导致 measurable cost increase 时 fail pipeline
  • 支持 Python (pip) 和 Node.js (npm) 两个生态

LLMOps 价值

已有 AISIX、Plano 等 AI 网关聚焦流量路由和安全,Wattage 填补了成本观测和效率分析的空缺。与 Plano (data plane) + AISIX (gateway) 形成互补:Wattage 负责 token 层面的成本分析和回归测试,Plano 负责流量管理,AISIX 负责协议转换。