mcpField
W
wattindex

wattindex

本地服务
github.com/CloudCorpRecords数据与分析01 周前更新

关于 wattindex

wattindex 提供模型推理的实测 GPU 能耗数据,并估算能耗与电网碳排。适合比较模型和 GPU 配置,可读取在线 API、内置快照或本地数据集。

主要功能

  1. 01浏览模型及有测量数据的 GPU
  2. 02按延迟时限筛选能耗记录
  3. 03估算能耗和电网 CO2e
  4. 04比较 GPU 与批次并发
  5. 05查看硬件信息和数据来源

适用场景

  1. 01比较某模型在不同 GPU 上的能耗
  2. 02估算指定 Token 数的能耗与排放
  3. 03查询各国家的电网碳强度
  4. 04查看 GPU 限制和测量来源

MCP 相关

其 MCP 服务提供模型与 GPU 查询、能耗估算、GPU 比较、并发曲线、电网强度、硬件数据及来源等工具。查询和计算使用配置的数据集在本地运行。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"cloudcorprecords-wattindex": {
"command": "npx",
"args": [
"-y",
"@reneturcios/wattindex"
]
}
}
}
启动命令npx -y @reneturcios/wattindex

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@reneturcios/wattindex0.1.0
ocighcr.io/cloudcorprecords/wattindex:0.1.0

工具

8

收录的工具列表 · 更新于 1 周前

此工具无需参数。

详细介绍

wattindex

为提供 100 万个输出 token,需要消耗多少 GPU 能源?wattindex 根据公开的实测配置索引给出答案:按模型、GPU 和运行批次统计每百万个输出 token 的瓦时数,并结合电网碳强度,计算任意地区的能源成本。

  • 最优行选择仅保留中间 token 延迟不超过截止时间的行(itl_deadline_ms,默认 500 ms),并选出能耗最低的一行。
  • estimate 按任意 token 数量缩放一行的数据,计算所在国家电网的 kg CO2e;如果你提供 pue 和/或 system_power_ratio(每项至少为 1.0),还会计算电表处的能耗,并标注为你的假设值。
  • 每个响应都会注明统计边界(gpu_only)、索引中的注意事项,以及数据来自实时 API、捆绑快照还是本地文件夹,同时提供更新日期和数据版本。

数据从 LEADGREEN_API_BASE 中指定的 JSON API 基础地址读取(默认 https://leadgreen.ai/api/v1);如果该值不是 URL,则视为包含 API 文件的本地文件夹,以供完全离线使用。所有查找和计算都在本地进行。

CLI

npx @reneturcios/wattindex list-models
npx @reneturcios/wattindex energy --model llama-3.1-70b --gpu H100
npx @reneturcios/wattindex estimate --model llama-3.1-70b --output-tokens 5000000 --country DE --pue 1.2
npx @reneturcios/wattindex compare-gpus --model llama-3.1-70b
npx @reneturcios/wattindex concurrency-curve --model llama-3.1-70b --gpu H100
npx @reneturcios/wattindex grid-intensity --country World
npx @reneturcios/wattindex gpu-hardware --gpu B200
npx @reneturcios/wattindex sources
npx @reneturcios/wattindex --version

输出为 JSON。退出码:成功时为 0;运行时错误(未知模型/GPU/国家、数据集无法读取或无法访问)时为 1;用法错误时为 2。

MCP 服务

npx -y @reneturcios/wattindex mcp

MCP 客户端配置:

{
  "mcpServers": {
    "wattindex": {
      "command": "npx",
      "args": ["-y", "@reneturcios/wattindex", "mcp"]
    }
  }
}
工具
  • list_models — 列出索引中的模型及各模型有实测数据的 GPU
  • energy_per_million_tokens — 返回模型在每种 GPU 上的最优行
    • model(字符串,必填)、gpu(字符串,可选)、itl_deadline_ms(数字,可选,默认 500)
  • estimate — 计算指定 token 数量的 GPU 能耗、kg CO2e,以及可选的电表处能耗
    • model(字符串,必填)、output_tokens(数字,必填)、gpu、country、running_batch、num_gpus、itl_deadline_ms、pue、system_power_ratio(可选)
  • compare_gpus — 比较指定模型在 H100 与 B200 上的最优行
    • model(字符串,必填)、itl_deadline_ms(可选)
  • concurrency_curve — 列出每种实测运行批次下的能耗
    • model、gpu(字符串,必填)
  • grid_intensity — 查询某个国家的年度平均 gCO2e/kWh(可使用名称、简称、ISO alpha-2/alpha-3 代码或 World)
    • country(字符串,必填)
  • gpu_hardware — 查询最大 TDP、内存、MIG 配置和整机能耗上限
    • gpu(字符串,可选;省略则列出所有 GPU)
  • sources — 列出所有来源、版本、获取日期和许可证

Docker

docker run -i ghcr.io/cloudcorprecords/wattindex
docker run --rm ghcr.io/cloudcorprecords/wattindex grid-intensity --country DE

开发

npm install
npm run build   # tsc -> dist/
npm test        # tsx --test test/*.test.ts (fake loader, no network)
npm run dev     # run the CLI from source

许可证

MIT — 版权所有 (c) 2026 Rene Turcios

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。