You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9dda14d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(inference): price Agentic revenue using measured cache hits
Share Fleet-compatible cache-tier aggregation, interpolate throughput, token share, and cache hit before pricing, and display uncached, cached, and output prices. Use OpenRouter input_cache_read when published with the documented fallback.
中文:复用 Fleet 的缓存层级汇总规则,在定价前分别插值吞吐量、输入 token 占比和缓存命中率,并展示未缓存输入、缓存输入及输出价格。优先使用 OpenRouter 发布的 input_cache_read,缺失时采用已说明的回退价格。
**`buildDerivedChartFields(entry, hwKey, requestedMetrics?)`** is the sole owner of inference and historical trend formulas. The full transform requests every benchmark-backed field. History requests only the selected metric and its interpolation dependencies, so it stays lightweight. Each emitted value uses `{ y: number; roof: boolean }`.
61
61
62
62
-`tpPerGpu`, `outputTputPerGpu`, `inputTputPerGpu` — raw throughput from the entry (tok/s/gpu).
63
-
-`tokenRevenuePerGpuHour` — gross revenue in $/GPU/hr. `buildDerivedChartFields` emits the normalized default (`tputPerGpu × 3,600 ÷ 1,000,000`, with input and output both priced at $1/M). `applyTokenRevenuePricing` can replace it with the selected model's current public OpenRouter prompt/completion prices. Aggregate rows use their measured input/output split; disaggregated rows derive a like-for-like split from fixed ISL:OSL or measured agentic prompt:generation totals because their raw input/output rates use different prefill/decode GPU denominators.
63
+
-`tokenRevenuePerGpuHour` — gross revenue in $/GPU/hr. `buildDerivedChartFields` emits an uncached normalized placeholder; `applyTokenRevenuePricing` applies the selected normalized or OpenRouter prices to uncached input, cached input, and output. Normalized pricing uses $1/M for uncached input and output and $0.10/M for cached input. OpenRouter uses its published cache-read price when available, otherwise 10% of the prompt price. Agentic cache share uses the same measured GPU-plus-external-or-CPU rule as Fleet Lifecycle. Aggregate rows use their measured input/output split; disaggregated rows derive a like-for-like split from fixed ISL:OSL or measured agentic prompt:generation totals because their raw input/output rates use different prefill/decode GPU denominators. Historical Trends splines total throughput, token share, and cache hit independently before applying these prices; a partly measured cache frontier receives no cache discount.
64
64
-`tpPerMw` — `(tputPerGpu * 1000) / hardwarePower` (GPU power in kW, result in tok/s/MW).
65
65
- Cost-per-million fields — GPU hourly cost divided by tokens-per-hour (in millions): `costh` / `costn` / `costr` for hyperscaler / neocloud / 3-year-rental pricing respectively. Three token variants exist: combined (`costh`/`costn`/`costr`), output-only (`costhOutput`/`costnOutput`/`costrOutput`), and input-only (`costhi`/`costni`/`costri`).
66
66
- Tokens-per-dollar fields — tokens-per-hour divided by the same hourly costs. They are separate Y-axis metrics rather than a display toggle: combined (`tokensPerDollarH`/`N`/`R`), output-only (`outputTokensPerDollarH`/`N`/`R`), and input-only (`inputTokensPerDollarH`/`N`/`R`). This keeps existing `i_metric=y_cost*` links and cost semantics unchanged.
0 commit comments