What does Llama-3 70B inference cost per million tokens?
Eight H100s in bf16 at the median $2.388/GPU/h run $19.11/hour for the node. At 1,800 aggregate tok/s that is about $2.95 per million tokens. Double the throughput and the unit cost halves — which is why the real answer here is the throughput assumption, not the price.
Price: median of device-level H100 SXM listings · as of 2026-11-05 · throughput is a published-baseline assumption, not measured here
Throughput drives everything
| 聚合吞吐假设 | 每小时 token | $/百万 token | 说明 |
|---|---|---|---|
| 1,200 tok/s | 4,320,000 | $4.42 | |
| 1,800 tok/s | 6,480,000 | $2.95 | baseline (vLLM continuous batching, bf16) |
| 3,000 tok/s | 10,800,000 | $1.77 | |
| 5,000 tok/s | 18,000,000 | $1.06 |
吞吐均为「输出 token / 秒」的整机聚合值,不含首 token 延迟与 prefill 开销;长 prompt、大 batch、投机解码都会改变这个数,方向不定。
Break-even against an API
| 口径 | 数值 |
|---|---|
| 8 卡 H100 月成本(730h) | $13,948 |
| 自建单 token 成本(1,800 tok/s) | $2.95 / 百万 |
| 对照的商业 API 单价(示例) | $0.90 / 百万 |
| 月盈亏平衡用量 | 15,498 百万 token ≈ 15.5 十亿 |
这张表的用处是把「自建便宜还是 API 便宜」这个纯争论变成一个可算的数:把你的月 token 量代进去,低于平衡点就买 API。注意自建的拥塞、扩缩容、模型版本滚动都要人力,这些成本没进表。
How it is computed
$/百万 token = 单卡时价 × 卡数 × 3600 ÷ (聚合 tok/s × 3600) × 1e6
化简后就是 卡数 × 单卡时价 ÷ 每秒 token 数 × 1e6 ÷ 3600。价格取 H100 SXM 的中位挂牌价 $2.388/时;卡数取 8,因为 70B 的 bf16 权重约 140GB,8×80GB 才留得下 KV cache 与并发。
为什么不用「单次请求成本」这个说法:单次请求的成本取决于 prompt 长度与 batch 拼法,同一台机器可以从 $0.0001 到 $0.01,说「每百万 token」才是跨供应商可比的口径。
Four assumptions that must travel with this number
② 不含冗余。生产环境要至少 2 倍冗余,账单要乘 2 以上。
③ 不含存储与出网。权重、日志、结果回传另计。
④ 不算人。自建要有人盯 OOM、扩缩容、模型升级——按人民币算,这部分通常比卡时贵。