技能 人工智能 本地 AI 推理成本计算器

本地 AI 推理成本计算器

v20261022
cost-local
计算在本地硬件(如 Ollama、llama.cpp)上运行 AI 模型的成本,考虑电力价格、硬件价格和生成速度。帮助分析本地部署与云端 API 服务的盈亏平衡点,辅助决策是否自建模型或调用外部服务。
获取技能
214 次下载
概览

Cost Local

node ${CLAUDE_PLUGIN_ROOT}/scripts/local-cost.mjs --tok-per-s 80 --busy 0.25 --compare claude-haiku-4-5

Inputs (all the user's): --watts-idle, --watts-active, --kwh, --hw-price, --life-years, --resale. --tok-per-s is required and must be a measured generation speed.

Rules

  • Cost = fixed (amortisation + idle power, paid busy or not) + marginal (extra watts while generating). Utilisation decides the answer: always show the table at 5/25/50/100% busy.
  • It is an estimate from the inputs; say so. Nothing is measured.
  • Compare against a same-capability hosted model, not a frontier one; price alone is a poor reason to buy a GPU for sporadic use.
  • Read real counts from the server (Ollama eval_count/prompt_eval_count on the native API, llama.cpp timings, vLLM /metrics), not the lossy OpenAI-compatible usage, and count model reloads (load_duration) as overhead.
信息
分类 人工智能
名称 cost-local
版本 v20261022
大小 1.31KB
更新时间 2026-10-23
语言