<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Opencost on lo0 — Tech Blog</title><link>https://blog.lo0.es/en/tags/opencost/</link><description>Recent content in Opencost on lo0 — Tech Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 16 Jun 2026 12:00:00 +0200</lastBuildDate><atom:link href="https://blog.lo0.es/en/tags/opencost/index.xml" rel="self" type="application/rss+xml"/><item><title>The reproducible harness: measuring cost, performance and energy in a single auditable experiment</title><link>https://blog.lo0.es/en/posts/reproducible-harness-cost-performance-energy-experiment/</link><pubDate>Tue, 16 Jun 2026 12:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/reproducible-harness-cost-performance-energy-experiment/</guid><description>&lt;blockquote>
&lt;p>Notation: amounts in &lt;strong>euros (N €)&lt;/strong>, decimals with a point, thousands with a thin space. The dollar sign is not used (on this site it is a formula delimiter).&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>The &amp;ldquo;data&amp;rdquo; series has produced three independent measurement axes: cost per million tokens (OpenCost + LiteLLM), performance under an SLO (GuideLLM + AIPerf) and energy per token (DCGM + Kepler). The problem is that the three have been measured in different articles, with different loads and at different times: they are not comparable with each other. This closing article describes the &lt;strong>integrated harness&lt;/strong> that runs the three axes &lt;strong>in the same experiment&lt;/strong>, on the same node (4×H100 SXM, a generic reference), with all the metadata fixed, the output in versioned JSON/CSV and an idempotent Kubernetes Job. The result is the &lt;strong>3-axis scorecard&lt;/strong> (€/1M tok, Wh/token, TTFT/ITL P99) that allows configurations to be compared on a &lt;strong>multi-objective Pareto frontier&lt;/strong> and any figure to be audited with the bench to reproduce it.&lt;/p>
&lt;hr>
&lt;h2 id="why-the-three-axes-must-be-measured-together">Why the three axes must be measured together&lt;/h2>
&lt;p>The series&amp;rsquo; opening post (&lt;a href="https://blog.lo0.es/en/posts/cost-performance-energy-three-axes-llm-inference/">The three axes&lt;/a>) established the identity:&lt;/p>
$$\text{CPM} = \frac{\text{cost/h}}{\text{throughput (tok/s)} \times 3.6 \times 10^{-3}}$$
$$\text{energy/token (Wh)} = \frac{\text{mean power (W)}}{\text{throughput (tok/s)} \times 3\,600}$$
&lt;p>Throughput is the common denominator. If it is measured in different experiments, different time, different load, different GPU temperature, then CPM and energy/token &lt;strong>do not share a denominator&lt;/strong>: they are three anecdotes, not a scorecard. The harness captures them in the same time window, over the same load, with Prometheus windows aligned to the second. Only then is the scorecard row coherent by construction.&lt;/p>
&lt;p>The second reason is reproducibility. The post &lt;a href="https://blog.lo0.es/en/posts/measurement-bias-reproducibility-llm-benchmarks/">Bias and reproducibility in benchmarking&lt;/a> listed twelve biases that invalidate comparisons: an unpinned engine, an undeclared tokeniser, unfixed input/output lengths, missing warmup, a client outside the cluster. The harness removes all of them because the metadata are part of the Job, not of the documentation.&lt;/p>
&lt;hr>
&lt;h2 id="architecture-of-the-integrated-bench">Architecture of the integrated bench&lt;/h2>
&lt;p>The harness has four layers. Each one is OSS, exports to Prometheus and lives in the same Kubernetes namespace:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Layer&lt;/th>
&lt;th>Tool(s)&lt;/th>
&lt;th>Primary metric&lt;/th>
&lt;th>Export protocol&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Performance&lt;/strong>&lt;/td>
&lt;td>GuideLLM (SLO sweep) + AIPerf&lt;/td>
&lt;td>TTFT P99, ITL P99, goodput (tok/s)&lt;/td>
&lt;td>native JSON/CSV + &lt;code>/metrics&lt;/code> OpenMetrics&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Cost&lt;/strong>&lt;/td>
&lt;td>OpenCost + LiteLLM proxy&lt;/td>
&lt;td>CPM (€/1M tok), cost/request&lt;/td>
&lt;td>REST API + Prometheus scrape&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Energy (GPU)&lt;/strong>&lt;/td>
&lt;td>DCGM Exporter&lt;/td>
&lt;td>&lt;code>DCGM_FI_DEV_POWER_USAGE&lt;/code> (W), &lt;code>DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION&lt;/code> (mJ)&lt;/td>
&lt;td>Prometheus DaemonSet&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Energy (pod)&lt;/strong>&lt;/td>
&lt;td>Kepler&lt;/td>
&lt;td>&lt;code>kepler_container_joules_total&lt;/code>, energy per pod&lt;/td>
&lt;td>Prometheus DaemonSet&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>MLPerf Power is used as an &lt;strong>external comparability reference&lt;/strong>: its published results, with hardware documented in detail, allow the harness figures to be calibrated for plausibility. The in-house bench does not aim to be an MLPerf submission, but to be &lt;strong>reproducible on your own cluster&lt;/strong>.&lt;/p>
&lt;div class="diagram" style="max-width:820px;margin:1rem auto;">
&lt;svg viewBox="0 0 820 320" role="img" aria-label="Harness architecture: a Kubernetes Job orchestrates GuideLLM and AIPerf as load generators, OpenCost and LiteLLM measure cost, DCGM and Kepler measure energy, everything converges on Prometheus and the JSON scorecard" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.2;marker-end:url(#ah)}.dsh{fill:none;stroke:currentColor;stroke-width:1;stroke-dasharray:4 3;marker-end:url(#ah)}&lt;/style>
&lt;defs>&lt;marker id="ah" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="10" y="10" width="800" height="300" rx="10"/>
&lt;text x="20" y="28" class="tl">Namespace: benchmark&lt;/text>
&lt;rect class="bx" x="30" y="40" width="180" height="70" rx="6"/>
&lt;text x="40" y="60" class="tl">Job benchmark-run&lt;/text>
&lt;text x="40" y="76" class="ts">GuideLLM sweep (SLO)&lt;/text>
&lt;text x="40" y="92" class="ts">AIPerf fixed concurrency&lt;/text>
&lt;rect class="bx" x="30" y="130" width="180" height="60" rx="6"/>
&lt;text x="40" y="150" class="tl">LiteLLM proxy&lt;/text>
&lt;text x="40" y="168" class="ts">token counting + CPM&lt;/text>
&lt;rect class="bx" x="30" y="210" width="180" height="60" rx="6"/>
&lt;text x="40" y="230" class="tl">DCGM DaemonSet&lt;/text>
&lt;text x="40" y="248" class="ts">POWER_USAGE, ENERGY&lt;/text>
&lt;rect class="bx" x="30" y="280" width="180" height="28" rx="6"/>
&lt;text x="40" y="298" class="tl">Kepler DaemonSet&lt;/text>
&lt;rect class="bx" x="280" y="40" width="180" height="70" rx="6"/>
&lt;text x="290" y="60" class="tl">Inference endpoint&lt;/text>
&lt;text x="290" y="78" class="ts">vLLM / SGLang&lt;/text>
&lt;text x="290" y="96" class="ts">pinned model, FP8/FP16&lt;/text>
&lt;rect class="bx" x="280" y="130" width="180" height="60" rx="6"/>
&lt;text x="290" y="150" class="tl">OpenCost&lt;/text>
&lt;text x="290" y="168" class="ts">€/GPU-h per pod/ns&lt;/text>
&lt;rect class="bx" x="540" y="60" width="160" height="80" rx="6"/>
&lt;text x="550" y="82" class="tl">Prometheus&lt;/text>
&lt;text x="550" y="100" class="ts">15 s scrape&lt;/text>
&lt;text x="550" y="116" class="ts">30-day retention&lt;/text>
&lt;rect class="bx" x="540" y="170" width="160" height="80" rx="6"/>
&lt;text x="550" y="192" class="tl">Scorecard exporter&lt;/text>
&lt;text x="550" y="210" class="ts">PromQL → JSON/CSV&lt;/text>
&lt;text x="550" y="228" class="ts">versioned in git&lt;/text>
&lt;path class="ar" d="M210,75 L280,75"/>
&lt;path class="ar" d="M460,155 L540,155"/>
&lt;path class="ar" d="M210,155 L280,155"/>
&lt;path class="dsh" d="M210,240 L540,200"/>
&lt;path class="dsh" d="M210,294 L540,220"/>
&lt;path class="ar" d="M700,100 L700,170"/>
&lt;text x="550" y="278" class="ts">one row per (model, config, hardware)&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="the-kubernetes-job-the-full-yaml">The Kubernetes Job: the full YAML&lt;/h2>
&lt;p>The experiment runs as a versioned &lt;strong>Kubernetes Job&lt;/strong>. All the relevant metadata are environment variables declared in the manifest: not in ad-hoc scripts, not in external documentation. The Job is idempotent (same name = same run) and leaves traces in the pod log and in the output volume.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">batch/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">Job&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">bench-llama3-70b-fp8-h100x4-20260616&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">namespace&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">benchmark&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">labels&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama3-70b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/precision&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">fp8&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/engine&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">vllm-0.9.1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/hardware&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">h100x4-sxm&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/isl&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;1024&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/osl&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;256&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/concurrency&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;32&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/tokenizer&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">meta-llama-3-tokenizer-v3&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">bench/run-id&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;20260616T1200&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">backoffLimit&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">template&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">restartPolicy&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">Never&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">serviceAccountName&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">bench-runner&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">volumes&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">results&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">persistentVolumeClaim&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">claimName&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">bench-results-pvc&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">initContainers&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c"># Warmup: 60 s of traffic before the experiment&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">warmup&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">image&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ghcr.io/vllm-project/guidellm:0.4.2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">command&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">guidellm&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">benchmark&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">target&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">http://vllm-svc.inference.svc.cluster.local:8000&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">rate-type&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">concurrent&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">rate&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="s2">&amp;#34;4&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">max-seconds&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="s2">&amp;#34;60&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">data&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">prompt_tokens=1024,output_tokens=256&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">env&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">GUIDELLM_ENV&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">value&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">production&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">containers&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">guidellm-sweep&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">image&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ghcr.io/vllm-project/guidellm:0.4.2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">command&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">guidellm&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">benchmark&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">target&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">http://vllm-svc.inference.svc.cluster.local:8000&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">rate-type&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">sweep&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">max-seconds&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="s2">&amp;#34;120&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">data&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">prompt_tokens=1024,output_tokens=256&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">output-path&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">/results/guidellm-$(BENCH_RUN_ID).json&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">env&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">BENCH_RUN_ID&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">valueFrom&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">fieldRef&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">fieldPath&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">metadata.labels[&amp;#39;bench/run-id&amp;#39;]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">volumeMounts&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">results&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">mountPath&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">/results&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">aiperf-concurrent&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">image&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">nvcr.io/nvidia/aiperf:0.2.0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">command&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">aiperf&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">profile&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">url&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">http://vllm-svc.inference.svc.cluster.local:8000/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">model&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">meta-llama/Meta-Llama-3-70B-Instruct&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">concurrency&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="s2">&amp;#34;4,8,16,32&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">input-tokens&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="s2">&amp;#34;1024&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">output-tokens&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="s2">&amp;#34;256&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">num-requests&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="s2">&amp;#34;200&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">output&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">/results/aiperf-$(BENCH_RUN_ID).json&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">volumeMounts&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">results&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">mountPath&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">/results&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">scorecard-exporter&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">image&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">python:3.12-slim&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">command&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">python&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">/scripts/export_scorecard.py&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">run-id&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="s2">&amp;#34;$(BENCH_RUN_ID)&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">prometheus&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">http://prometheus.monitoring.svc.cluster.local:9090&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- --&lt;span class="l">output&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="l">/results/scorecard-$(BENCH_RUN_ID).json&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">env&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">BENCH_RUN_ID&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">valueFrom&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">fieldRef&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">fieldPath&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">metadata.labels[&amp;#39;bench/run-id&amp;#39;]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">volumeMounts&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">results&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">mountPath&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">/results&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The Job name (&lt;code>bench-llama3-70b-fp8-h100x4-20260616&lt;/code>) is the unique identifier of the run. Changing it is enough to register a variant. The labels are the metadata that the &lt;code>scorecard-exporter&lt;/code> reads to enrich the output JSON.&lt;/p>
&lt;hr>
&lt;h2 id="performance-layer-guidellm-and-aiperf">Performance layer: GuideLLM and AIPerf&lt;/h2>
&lt;h3 id="guidellm--the-slo-driven-sweep">GuideLLM — the SLO-driven sweep&lt;/h3>
&lt;p>GuideLLM (a vLLM project) generates realistic traffic patterns, synchronous, concurrent, poisson, throughput, &lt;strong>sweep&lt;/strong>, and captures full TTFT and ITL distributions (&lt;a href="https://developers.redhat.com/articles/2025/06/20/guidellm-evaluate-llm-deployments-real-world-inference">Red Hat Developer&lt;/a>). The &lt;code>sweep&lt;/code> mode ramps from idle to saturation over 10 rounds and identifies the &lt;strong>knee&lt;/strong>: the maximum load where goodput ≈ throughput under the declared SLO. The output is JSON/CSV with all the percentiles per round, ready to be versioned.&lt;/p>
&lt;p>For the harness, the bench&amp;rsquo;s reference SLO is:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Metric&lt;/th>
&lt;th>Threshold&lt;/th>
&lt;th>Percentile&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>TTFT&lt;/td>
&lt;td>500 ms&lt;/td>
&lt;td>P99&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ITL (TPOT)&lt;/td>
&lt;td>50 ms/tok&lt;/td>
&lt;td>P95&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Error rate&lt;/td>
&lt;td>0.5 %&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The Job command already appears in the YAML above. The JSON output includes, per round: rate (req/s), TTFT (P50/P95/P99), ITL (P50/P95/P99), throughput (tok/s) and goodput (tok/s). The goodput under the SLO at the knee is the value that enters the scorecard.&lt;/p>
&lt;p>For the cross-verification layer of the data and comparability with published results, see the post &lt;a href="https://blog.lo0.es/en/posts/guidellm-validating-slo-under-load-sizing-knee/">GuideLLM in depth&lt;/a>.&lt;/p>
&lt;h3 id="aiperf--nvidias-concurrency-profiler">AIPerf — NVIDIA&amp;rsquo;s concurrency profiler&lt;/h3>
&lt;p>AIPerf (the successor to GenAI-Perf, repository &lt;code>ai-dynamo/aiperf&lt;/code>) measures TTFT, ITL, throughput and latency distributions at fixed concurrencies (&lt;a href="https://github.com/ai-dynamo/aiperf">GitHub ai-dynamo/aiperf&lt;/a>). Where GuideLLM gives the automatic sweep up to the knee, AIPerf gives the detailed profile at specific concurrencies (4, 8, 16, 32 in the example): it allows the throughput-latency curve to be characterised point by point.&lt;/p>
&lt;p>The two are complementary: GuideLLM finds the knee automatically; AIPerf confirms it and characterises the behaviour in the neighbourhood of that knee. Both outputs go to the results volume with the same &lt;code>BENCH_RUN_ID&lt;/code>. The deep analysis of AIPerf/GenAI-Perf is in &lt;a href="https://blog.lo0.es/en/posts/genai-perf-llm-inference-profiling-in-depth/">GenAI-Perf in depth&lt;/a>.&lt;/p>
&lt;p>Metrics the harness extracts from AIPerf for the scorecard:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># TTFT P99 at concurrency 16 (the closest to the sweep&amp;#39;s knee):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">aiperf profile ... --concurrency &lt;span class="m">16&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.results[] | select(.concurrency==16) | .ttft_ms.p99&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Goodput (tok/s) at concurrency 16:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">aiperf profile ... --concurrency &lt;span class="m">16&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.results[] | select(.concurrency==16) | .output_token_throughput&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="cost-layer-opencost-and-litellm">Cost layer: OpenCost and LiteLLM&lt;/h2>
&lt;h3 id="opencost--the-denominator-in-euros-per-gpu-hour">OpenCost — the denominator in euros per GPU-hour&lt;/h3>
&lt;p>OpenCost (CNCF incubating, &lt;a href="https://opencost.io/">opencost.io&lt;/a>) allocates Kubernetes cost to namespace, label, pod and container in real time (&lt;a href="https://github.com/opencost/opencost">GitHub opencost/opencost&lt;/a>). For the harness, OpenCost answers the question: &lt;strong>how much does the &lt;code>vllm-svc&lt;/code> pod cost in euros per hour during the experiment&amp;rsquo;s window?&lt;/strong>&lt;/p>
&lt;p>The harness calls the OpenCost REST API when the experiment finishes:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Cost of the inference namespace over the experiment window (1 hour)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">curl -s &lt;span class="s2">&amp;#34;http://opencost.monitoring.svc.cluster.local:9003/allocation&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --data-urlencode &lt;span class="s1">&amp;#39;window=2026-06-16T12:00:00Z,2026-06-16T13:00:00Z&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --data-urlencode &lt;span class="s1">&amp;#39;aggregate=namespace&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --data-urlencode &lt;span class="s1">&amp;#39;namespace=inference&amp;#39;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.data[0].inference.totalCost&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The returned cost (in EUR, configured with the node&amp;rsquo;s real prices) is divided by the throughput measured in that same window to obtain the CPM:&lt;/p>
$$\text{CPM} = \frac{\text{cost}_\text{namespace/h} \times 10^6}{\text{goodput (tok/s)} \times 3\,600}$$
&lt;p>The post &lt;a href="https://blog.lo0.es/en/posts/opencost-gpu-cost-allocation-kubernetes/">OpenCost: cost allocation in Kubernetes&lt;/a> details the price configuration and the allocation by GPU label.&lt;/p>
&lt;h3 id="litellm--the-per-request-token-counter">LiteLLM — the per-request token counter&lt;/h3>
&lt;p>LiteLLM (&lt;a href="https://www.litellm.ai/">litellm.ai&lt;/a>, &lt;a href="https://github.com/BerriAI/litellm">GitHub BerriAI/litellm&lt;/a>) acts as an OpenAI-compatible proxy with token accounting per request, model and team. In the harness, GuideLLM and AIPerf point at the LiteLLM endpoint (which in turn forwards to vLLM): every request is recorded with &lt;code>prompt_tokens&lt;/code>, &lt;code>completion_tokens&lt;/code> and &lt;code>cost&lt;/code> (using the custom pricing configured for the on-prem node).&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># litellm-config.yaml (fragment of custom on-prem pricing)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">model_list&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">model_name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama3-70b-fp8&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">litellm_params&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">openai/meta-llama/Meta-Llama-3-70B-Instruct&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_base&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">http://vllm-svc.inference.svc.cluster.local:8000/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_key&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">sk-dummy&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">input_cost_per_token&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.00000109&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># 1.09 EUR/1M tok on-prem&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">output_cost_per_token&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.00000109&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The LiteLLM records are exported to Prometheus as &lt;code>litellm_request_total_tokens&lt;/code> and &lt;code>litellm_spend_metric_total&lt;/code>, which the scorecard exporter consumes to compute the real CPM per token type (input vs output).&lt;/p>
&lt;hr>
&lt;h2 id="energy-layer-dcgm-and-kepler">Energy layer: DCGM and Kepler&lt;/h2>
&lt;h3 id="dcgm-exporter--gpu-power-and-energy">DCGM Exporter — GPU power and energy&lt;/h3>
&lt;p>DCGM Exporter (&lt;a href="https://github.com/NVIDIA/dcgm-exporter">GitHub NVIDIA/dcgm-exporter&lt;/a>, &lt;a href="https://docs.nvidia.com/datacenter/dcgm/latest/gpu-telemetry/dcgm-exporter.html">docs&lt;/a>) exposes GPU metrics on &lt;code>/metrics&lt;/code> for Prometheus as a DaemonSet on the GPU nodes. The two energy metrics the harness uses:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>DCGM metric&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Unit&lt;/th>
&lt;th>Use in the harness&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>DCGM_FI_DEV_POWER_USAGE&lt;/code>&lt;/td>
&lt;td>gauge&lt;/td>
&lt;td>W&lt;/td>
&lt;td>instantaneous power per GPU&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION&lt;/code>&lt;/td>
&lt;td>counter&lt;/td>
&lt;td>mJ&lt;/td>
&lt;td>energy accumulated since boot&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>To compute the energy consumed during the experiment&amp;rsquo;s window (without the idle baseline), the harness takes the difference of the counter before and after the sweep:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Deployment as a DaemonSet (fragment of the official chart)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">helm repo add gpu-helm-charts &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> https://nvidia.github.io/dcgm-exporter/helm-charts
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">helm install dcgm-exporter gpu-helm-charts/dcgm-exporter &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --namespace monitoring &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --set serviceMonitor.enabled&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --set serviceMonitor.interval&lt;span class="o">=&lt;/span>15s
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The &lt;code>DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION&lt;/code> field (in mJ) allows the experiment&amp;rsquo;s energy to be computed with hardware-counter accuracy, not with an estimate:&lt;/p>
$$\text{experiment energy (J)} = \left(\text{counter}_\text{end} - \text{counter}_\text{start}\right) \times 10^{-3}$$
$$\text{Wh/token} = \frac{\text{experiment energy (J)}}{3\,600 \times \text{generated tokens}}$$
&lt;h3 id="kepler--pod-level-energy">Kepler — pod-level energy&lt;/h3>
&lt;p>Kepler (CNCF sandbox, &lt;a href="https://github.com/sustainable-computing-io/kepler">GitHub sustainable-computing-io/kepler&lt;/a>) uses eBPF to estimate energy consumption at container and pod level, exporting &lt;code>kepler_container_joules_total&lt;/code> to Prometheus (&lt;a href="https://next.redhat.com/2023/08/22/introducing-kepler-efficient-power-monitoring-for-kubernetes/">Red Hat Emerging Technologies&lt;/a>). It combines RAPL (CPU/DRAM), NVML (GPU) and regression models when no sensors are available.&lt;/p>
&lt;p>In the harness, Kepler complements DCGM: DCGM gives the hardware measurement of the GPU (more precise for GPU-intensive loads such as LLM inference), while Kepler attributes the energy to the specific vLLM pod (including the node&amp;rsquo;s CPU contribution). The main metric the harness consumes:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-promql" data-lang="promql">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Energy of the vllm-svc pod during the experiment (J)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kr">increase&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nv">kepler_container_joules_total&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nl">container_namespace&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">&amp;#34;&lt;/span>&lt;span class="s">inference&lt;/span>&lt;span class="p">&amp;#34;,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nl">container_name&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">&amp;#34;&lt;/span>&lt;span class="s">vllm&lt;/span>&lt;span class="p">&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}[&lt;/span>&lt;span class="err">${BENCH_DURATION}&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The comparative analysis of DCGM vs Kepler vs Zeus is in &lt;a href="https://blog.lo0.es/en/posts/measuring-energy-in-production-kepler-dcgm-stack/">Energy tools: deployment, precision and overhead&lt;/a>.&lt;/p>
&lt;h3 id="the-mlperf-power-reference">The MLPerf Power reference&lt;/h3>
&lt;p>MLPerf Power (&lt;a href="https://mlcommons.org/benchmarks/inference-datacenter/">MLCommons&lt;/a>, IEEE HPCA 2025 paper) establishes the protocol for measuring the energy efficiency of ML systems with high-precision external measurement. The in-house bench &lt;strong>is not an MLPerf submission&lt;/strong> (that requires external power meters and committee review), but its published results are the calibration reference: if the harness gives a result of the same order as the MLPerf submission for the same hardware with the same model, the measurement is plausible. If it differs by more than a factor of 2, there is a methodological problem. See the post &lt;a href="https://blog.lo0.es/en/posts/mlperf-power-energy-efficiency-benchmark/">MLPerf Power: energy efficiency&lt;/a> for the current reference data.&lt;/p>
&lt;hr>
&lt;h2 id="unifying-the-metrics-the-promql-queries">Unifying the metrics: the PromQL queries&lt;/h2>
&lt;p>The &lt;code>scorecard-exporter&lt;/code> is the Job container that, once GuideLLM and AIPerf have finished, collects all the metrics from Prometheus and builds the JSON of the scorecard row. The key queries:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-promql" data-lang="promql">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Mean GPU power during the sweep (W) — 4×H100 node&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kr">avg_over_time&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">sum&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">DCGM_FI_DEV_POWER_USAGE&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="nl">Hostname&lt;/span>&lt;span class="o">=~&lt;/span>&lt;span class="p">&amp;#34;&lt;/span>&lt;span class="s">gpu-node-.*&lt;/span>&lt;span class="p">&amp;#34;}&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="err">${BENCH_DURATION}:&lt;/span>&lt;span class="s">15s&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># Total GPU energy during the sweep (mJ → convert to J)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">sum&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="nl">Hostname&lt;/span>&lt;span class="o">=~&lt;/span>&lt;span class="p">&amp;#34;&lt;/span>&lt;span class="s">gpu-node-.*&lt;/span>&lt;span class="p">&amp;#34;}&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">offset&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">sum&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="nl">Hostname&lt;/span>&lt;span class="o">=~&lt;/span>&lt;span class="p">&amp;#34;&lt;/span>&lt;span class="s">gpu-node-.*&lt;/span>&lt;span class="p">&amp;#34;}&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">offset&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">$&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="err">BENCH_DURATION&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mf">0.001&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># Tokens generated during the sweep (from LiteLLM)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kr">increase&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nv">litellm_request_total_tokens&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="nl">model&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">&amp;#34;&lt;/span>&lt;span class="s">llama3-70b-fp8&lt;/span>&lt;span class="p">&amp;#34;,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nl">token_type&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">&amp;#34;&lt;/span>&lt;span class="s">completion&lt;/span>&lt;span class="p">&amp;#34;}[&lt;/span>&lt;span class="err">${BENCH_DURATION}&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># Cost of the inference namespace over the window (from the OpenCost API)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># → REST call at the start and at the end of the Job, difference of accrual&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The &lt;code>${BENCH_DURATION}&lt;/code> variable is the real duration of the sweep (in Prometheus format, e.g. &lt;code>22m&lt;/code>), which the exporter computes as &lt;code>end_ts - start_ts&lt;/code> and substitutes into every query.&lt;/p>
&lt;p>The output JSON of each run has this structure:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;run_id&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;20260616T1200&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;metadata&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;model&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;meta-llama/Meta-Llama-3-70B-Instruct&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;engine&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;vllm-0.9.1&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;precision&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;fp8&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;hardware&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;4xH100-SXM-80GB&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;isl_tokens&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">1024&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;osl_tokens&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">256&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;tokenizer&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;meta-llama-3-tokenizer-v3&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;slo_ttft_p99_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">500&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;slo_itl_p95_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">50&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;bench_tool_guidellm&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;0.4.2&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;bench_tool_aiperf&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;0.2.0&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;dcgm_exporter&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;3.3.9&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;kepler&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;0.10.2&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;performance&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;goodput_tok_s&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">3120&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;ttft_p99_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">487&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;itl_p95_ms&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">42&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;throughput_peak_tok_s&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">3890&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;elbow_concurrency&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">28&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;cost&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;cpm_eur_1m&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">0.97&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;gpu_cost_eur_h&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">10.8&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;cost_window_eur&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">3.24&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;energy&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;wh_per_token&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">0.00044&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;j_per_token&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">1.58&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;power_mean_w&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">4924&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;energy_total_kwh&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">0.287&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;pue&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">1.4&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;wh_per_token_pue_adjusted&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">0.000616&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;carbon&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;grid_intensity_gco2_kwh&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">40&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;co2_per_1m_tokens_g&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mf">24.6&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>All the fields are computed from the same time windows. The JSON is versioned in git alongside the harness code. Reproducing any scorecard row is: &lt;code>git checkout &amp;lt;run-id&amp;gt; &amp;amp;&amp;amp; kubectl apply -f job.yaml&lt;/code>.&lt;/p>
&lt;hr>
&lt;h2 id="the-3-axis-scorecard-table-and-interpretation">The 3-axis scorecard: table and interpretation&lt;/h2>
&lt;p>The following table illustrates how five configurations of the same model (Llama 3 70B) on the same reference node (4×H100 SXM) compare with the harness. The figures are &lt;strong>illustrative of the order of magnitude&lt;/strong> (the bench fills them in with real measurements):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Config&lt;/th>
&lt;th>Engine&lt;/th>
&lt;th>Precision&lt;/th>
&lt;th>CPM (€/1M)&lt;/th>
&lt;th>Goodput (tok/s)&lt;/th>
&lt;th>Wh/tok&lt;/th>
&lt;th>TTFT P99 (ms)&lt;/th>
&lt;th>ITL P95 (ms)&lt;/th>
&lt;th>CO2 /1M (g, FR)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>A&lt;/strong>&lt;/td>
&lt;td>vLLM 0.9&lt;/td>
&lt;td>FP16&lt;/td>
&lt;td>1.64&lt;/td>
&lt;td>1,890&lt;/td>
&lt;td>0.00074&lt;/td>
&lt;td>498&lt;/td>
&lt;td>49&lt;/td>
&lt;td>29.6&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>B&lt;/strong>&lt;/td>
&lt;td>vLLM 0.9&lt;/td>
&lt;td>FP8&lt;/td>
&lt;td>0.97&lt;/td>
&lt;td>3,120&lt;/td>
&lt;td>0.00044&lt;/td>
&lt;td>487&lt;/td>
&lt;td>42&lt;/td>
&lt;td>17.6&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>C&lt;/strong>&lt;/td>
&lt;td>SGLang 0.4&lt;/td>
&lt;td>FP8&lt;/td>
&lt;td>0.88&lt;/td>
&lt;td>3,410&lt;/td>
&lt;td>0.00041&lt;/td>
&lt;td>421&lt;/td>
&lt;td>38&lt;/td>
&lt;td>16.4&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>D&lt;/strong>&lt;/td>
&lt;td>vLLM 0.9&lt;/td>
&lt;td>FP8, ISL 512&lt;/td>
&lt;td>1.31&lt;/td>
&lt;td>2,240&lt;/td>
&lt;td>0.00056&lt;/td>
&lt;td>294&lt;/td>
&lt;td>31&lt;/td>
&lt;td>22.4&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>E&lt;/strong>&lt;/td>
&lt;td>vLLM 0.9&lt;/td>
&lt;td>FP8, max-batch 128&lt;/td>
&lt;td>0.84&lt;/td>
&lt;td>3,590&lt;/td>
&lt;td>0.00040&lt;/td>
&lt;td>721&lt;/td>
&lt;td>55&lt;/td>
&lt;td>16.0&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>How to read the table:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>B vs A&lt;/strong>: FP8 over FP16 cuts CPM by 41 % and energy per token by 41 % thanks to the same higher throughput. Both meet the SLO (TTFT P99 &amp;lt; 500 ms, ITL P95 &amp;lt; 50 ms). B dominates A on all three axes: it is Pareto-superior.&lt;/li>
&lt;li>&lt;strong>C vs B&lt;/strong>: SGLang gives 9 % more goodput and 9 % lower CPM with FP8. Both meet the SLO. C is Pareto-superior to B (if the engine is indifferent for the stack).&lt;/li>
&lt;li>&lt;strong>D vs B&lt;/strong>: a shorter ISL (512 tok) lowers latency (TTFT P99 294 ms vs 487 ms) but lowers goodput and raises CPM. If the use case demands TTFT &amp;lt; 300 ms, D is the candidate; if TTFT &amp;lt; 500 ms is enough, B is better on cost and energy.&lt;/li>
&lt;li>&lt;strong>E vs C&lt;/strong>: &lt;code>max-batch 128&lt;/code> raises goodput (+5 %) and lowers CPM, but the TTFT P99 breaks the SLO (721 ms &amp;gt; 500 ms) and so does the ITL P95 (55 ms &amp;gt; 50 ms). E has the best raw throughput &lt;strong>but is outside the SLO&lt;/strong>: it is not a valid candidate for the interactive chat use case.&lt;/li>
&lt;/ul>
&lt;p>The scorecard&amp;rsquo;s &lt;strong>Pareto frontier&lt;/strong>, under the declared SLO, includes only A, B, C and D (E falls out for breaking the SLO). Of those four, C dominates B which dominates A. D only enters the frontier if the use case demands TTFT P99 &amp;lt; 300 ms. The decision is not a number; it is the whole row plus the SLO.&lt;/p>
&lt;hr>
&lt;h2 id="the-multi-objective-pareto-frontier">The multi-objective Pareto frontier&lt;/h2>
&lt;p>With three minimisation metrics, CPM (€/1M tok), Wh/tok and TTFT P99 (ms), the Pareto frontier is defined as the set of configurations where none dominates another on all three axes simultaneously. Formally, config \( i \) &lt;strong>dominates&lt;/strong> config \( j \) if:&lt;/p>
$$\text{CPM}_i \leq \text{CPM}_j \;\land\; \text{Wh/tok}_i \leq \text{Wh/tok}_j \;\land\; \text{TTFT}_{i} \leq \text{TTFT}_{j}$$
&lt;p>with at least one strict inequality. The scorecard allows it to be computed over the set of runs with a simple vector operation. In the table&amp;rsquo;s example, the frontier under the SLO (with E excluded) is \(\{C, D\}\): C dominates on cost/energy/goodput; D dominates on latency. Between C and D the choice depends on the TTFT SLO of the specific use case.&lt;/p>
&lt;div class="diagram" style="max-width:700px;margin:1rem auto;">
&lt;svg viewBox="0 0 700 320" role="img" aria-label="Pareto frontier on two axes: CPM EUR per million tokens on the Y axis and goodput tok per s on the X axis; points A B C D E marked; E excluded for breaking the SLO; the Pareto curve passes through C and D" xmlns="http://www.w3.org/2000/svg">
&lt;style>.ax{fill:none;stroke:currentColor;stroke-width:1}.ts{font:11px sans-serif;fill:currentColor}.tl{font:600 12px sans-serif;fill:currentColor}.pt{fill:currentColor}.dsh{fill:none;stroke:currentColor;stroke-width:1;stroke-dasharray:4 3}&lt;/style>
&lt;line class="ax" x1="70" y1="30" x2="70" y2="270"/>
&lt;line class="ax" x1="70" y1="270" x2="660" y2="270"/>
&lt;text x="10" y="155" class="ts" transform="rotate(-90 10 155)">CPM (EUR/1M tok) ↑ worse&lt;/text>
&lt;text x="320" y="300" class="ts">goodput (tok/s) → better&lt;/text>
&lt;text x="70" y="26" class="ts">1.70&lt;/text>
&lt;text x="70" y="80" class="ts">1.40&lt;/text>
&lt;text x="70" y="134" class="ts">1.10&lt;/text>
&lt;text x="70" y="188" class="ts">0.90&lt;/text>
&lt;text x="70" y="242" class="ts">0.84&lt;/text>
&lt;text x="115" y="284" class="ts">1,800&lt;/text>
&lt;text x="263" y="284" class="ts">2,200&lt;/text>
&lt;text x="410" y="284" class="ts">3,100&lt;/text>
&lt;text x="520" y="284" class="ts">3,400&lt;/text>
&lt;text x="600" y="284" class="ts">3,600&lt;/text>
&lt;circle class="pt" cx="130" cy="55" r="5"/>
&lt;text x="140" y="52" class="tl">A (FP16)&lt;/text>
&lt;circle class="pt" cx="380" cy="170" r="5"/>
&lt;text x="390" y="167" class="tl">B (FP8)&lt;/text>
&lt;circle class="pt" cx="500" cy="152" r="5"/>
&lt;text x="510" y="148" class="tl">C (SGLang FP8) ★&lt;/text>
&lt;circle class="pt" cx="270" cy="195" r="5"/>
&lt;text x="280" y="192" class="tl">D (ISL 512)&lt;/text>
&lt;circle class="pt" cx="570" cy="138" r="4" opacity="0.4"/>
&lt;text x="580" y="135" class="ts" opacity="0.4">E (SLO broken)&lt;/text>
&lt;path class="dsh" d="M130,55 L270,195 L500,152"/>
&lt;text x="190" y="148" class="ts">Pareto frontier&lt;/text>
&lt;text x="72" y="286" class="ts">(A dominates only on latency; C+D on the frontier under the SLO)&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="reproducible-design-the-twelve-mandatory-metadata">Reproducible design: the twelve mandatory metadata&lt;/h2>
&lt;p>The checklist that closes the bias dossier (&lt;a href="https://blog.lo0.es/en/posts/measurement-bias-reproducibility-llm-benchmarks/">Bias and reproducibility&lt;/a>). For the harness JSON to be auditable, the twelve fields must be present in every run:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>#&lt;/th>
&lt;th>Field&lt;/th>
&lt;th>Example&lt;/th>
&lt;th>Why it is mandatory&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>Serving engine version&lt;/td>
&lt;td>&lt;code>vllm-0.9.1&lt;/code>&lt;/td>
&lt;td>the same model can perform differently across versions&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td>Model version (commit/tag)&lt;/td>
&lt;td>&lt;code>meta-llama/Meta-Llama-3-70B-Instruct@sha256:abc&lt;/code>&lt;/td>
&lt;td>avoids ambiguity between variants of the same name&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td>Precision&lt;/td>
&lt;td>&lt;code>fp8&lt;/code>&lt;/td>
&lt;td>FP16 vs FP8 changes throughput and latency&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4&lt;/td>
&lt;td>Tokeniser and version&lt;/td>
&lt;td>&lt;code>meta-llama-3-tokenizer-v3&lt;/code>&lt;/td>
&lt;td>the ISL/OSL in tokens depends on the tokeniser&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5&lt;/td>
&lt;td>ISL (input sequence length)&lt;/td>
&lt;td>&lt;code>1024&lt;/code> tok&lt;/td>
&lt;td>changes the prefill time and the knee&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>6&lt;/td>
&lt;td>OSL (output sequence length)&lt;/td>
&lt;td>&lt;code>256&lt;/code> tok&lt;/td>
&lt;td>changes the decode time&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>7&lt;/td>
&lt;td>Hardware (model and count)&lt;/td>
&lt;td>&lt;code>4×H100-SXM-80GB&lt;/code>&lt;/td>
&lt;td>the basis of any comparison&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>8&lt;/td>
&lt;td>Maximum concurrency tested&lt;/td>
&lt;td>&lt;code>32&lt;/code>&lt;/td>
&lt;td>defines the sweep&amp;rsquo;s range&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>9&lt;/td>
&lt;td>Bench tool version&lt;/td>
&lt;td>&lt;code>guidellm-0.4.2&lt;/code>, &lt;code>aiperf-0.2.0&lt;/code>&lt;/td>
&lt;td>different versions can give different metrics&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>10&lt;/td>
&lt;td>Declared SLO&lt;/td>
&lt;td>&lt;code>TTFT P99 &amp;lt; 500 ms, ITL P95 &amp;lt; 50 ms&lt;/code>&lt;/td>
&lt;td>the knee depends on the SLO; without it there is no goodput&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>11&lt;/td>
&lt;td>Warmup duration&lt;/td>
&lt;td>&lt;code>60 s&lt;/code>&lt;/td>
&lt;td>without warmup the KV cache is cold and the first rounds are biased&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>12&lt;/td>
&lt;td>Harness version / run-id&lt;/td>
&lt;td>&lt;code>20260616T1200&lt;/code>&lt;/td>
&lt;td>identifies the run so it can be reproduced with &lt;code>git checkout&lt;/code>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>A scorecard missing any of these twelve fields is an anecdote. With all twelve, it is an auditable datum. The run-id in the Job name (&lt;code>bench-llama3-70b-fp8-h100x4-20260616&lt;/code>) implicitly incorporates fields 1-3 and 7, forcing the Job name to change with every variant, which makes it impossible to overlap runs in the same namespace.&lt;/p>
&lt;hr>
&lt;h2 id="idempotence-and-versioning-of-results">Idempotence and versioning of results&lt;/h2>
&lt;p>The Kubernetes Job is idempotent: if the same manifest is applied again (same name), the Job already exists and Kubernetes does not relaunch it (&lt;code>backoffLimit: 0&lt;/code> policy). This avoids accidental duplicate runs. To relaunch, the Job has to be deleted (&lt;code>kubectl delete job &amp;lt;name&amp;gt;&lt;/code>) or the &lt;code>run-id&lt;/code> changed.&lt;/p>
&lt;p>Results are versioned with the following directory convention in the harness&amp;rsquo;s git repository:&lt;/p>
&lt;pre tabindex="0">&lt;code>results/
20260616T1200/
guidellm-20260616T1200.json
aiperf-20260616T1200.json
scorecard-20260616T1200.json
20260617T0900/
guidellm-20260617T0900.json
aiperf-20260617T0900.json
scorecard-20260617T0900.json
scorecard-aggregate.csv # all rows, for analysis and charts
&lt;/code>&lt;/pre>&lt;p>The &lt;code>scorecard-aggregate.csv&lt;/code> is the scorecard table in flat format: each row is a run, each column a field of the JSON. It is generated with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Generates the aggregate CSV from all the JSON files in results/&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">python scripts/aggregate_scorecards.py results/ &amp;gt; scorecard-aggregate.csv
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The CSV is what feeds the Pareto charts, the reports and the architecture decisions. It is versioned in git; its diff is the configuration change.&lt;/p>
&lt;hr>
&lt;h2 id="how-it-connects-with-the-other-posts-in-the-series">How it connects with the other posts in the series&lt;/h2>
&lt;p>The harness is not a standalone article: it is the synthesis of the twenty-eight articles. Each tool has its deep dive:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Performance&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/guidellm-validating-slo-under-load-sizing-knee/">GuideLLM in depth&lt;/a> — sweep, SLO, goodput, knee; &lt;a href="https://blog.lo0.es/en/posts/genai-perf-llm-inference-profiling-in-depth/">GenAI-Perf / AIPerf in depth&lt;/a> — concurrency, rate sweep, distribution metrics.&lt;/li>
&lt;li>&lt;strong>Cost&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/opencost-gpu-cost-allocation-kubernetes/">OpenCost: cost allocation in Kubernetes&lt;/a> — allocation by namespace/label, custom on-prem prices.&lt;/li>
&lt;li>&lt;strong>Energy&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/measuring-energy-in-production-kepler-dcgm-stack/">Energy tools: deployment, precision and overhead&lt;/a> — DCGM vs Kepler vs Zeus, instrumentation overhead, relative precision; &lt;a href="https://blog.lo0.es/en/posts/mlperf-power-energy-efficiency-benchmark/">MLPerf Power: energy efficiency&lt;/a> — the external calibration reference.&lt;/li>
&lt;li>&lt;strong>Theoretical framework&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/cost-performance-energy-three-axes-llm-inference/">The three axes: cost, performance and energy&lt;/a> — the CPM/energy/throughput identity that justifies measuring them together.&lt;/li>
&lt;li>&lt;strong>Bias&lt;/strong>: &lt;a href="https://blog.lo0.es/en/posts/measurement-bias-reproducibility-llm-benchmarks/">Bias and reproducibility in benchmarking&lt;/a> — the twelve biases the harness removes.&lt;/li>
&lt;/ul>
&lt;p>The harness closes the series&amp;rsquo; dossier because it makes the opening article&amp;rsquo;s promise possible: &amp;ldquo;when someone disputes a number in the proposal, the answer is not &amp;lsquo;a blog says so&amp;rsquo;, but &amp;rsquo;this is the bench, this is the methodology, reproduce it&amp;rsquo;&amp;rdquo;. With the run-id and the git repo, reproducing is one command.&lt;/p>
&lt;hr>
&lt;h2 id="full-flow-of-a-benchmarking-session">Full flow of a benchmarking session&lt;/h2>
&lt;p>The harness&amp;rsquo;s standard operating procedure, from start to finish:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 1. Make sure the inference endpoint is up&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">kubectl get svc vllm-svc -n inference
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 2. Verify that DCGM and Kepler are scraping&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">curl -s http://prometheus.monitoring.svc.cluster.local:9090/api/v1/query &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --data-urlencode &lt;span class="s1">&amp;#39;query=DCGM_FI_DEV_POWER_USAGE&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> jq &lt;span class="s1">&amp;#39;.data.result | length&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 3. Record the energy counter BEFORE the experiment&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">PRE_ENERGY&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="k">$(&lt;/span>kubectl &lt;span class="nb">exec&lt;/span> -n monitoring dcgm-exporter-xxx -- &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> curl -s localhost:9400/metrics &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> &lt;span class="p">|&lt;/span> grep DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION &lt;span class="p">|&lt;/span> awk &lt;span class="s1">&amp;#39;{sum+=$2} END{print sum}&amp;#39;&lt;/span>&lt;span class="k">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 4. Launch the Job (unique name per run)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">kubectl apply -f jobs/bench-llama3-70b-fp8-h100x4-20260616.yaml
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 5. Wait for it to finish&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">kubectl &lt;span class="nb">wait&lt;/span> --for&lt;span class="o">=&lt;/span>&lt;span class="nv">condition&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">complete&lt;/span> job/bench-llama3-70b-fp8-h100x4-20260616 &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -n benchmark --timeout&lt;span class="o">=&lt;/span>3600s
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 6. Record the energy counter AFTER&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">POST_ENERGY&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="k">$(&lt;/span>kubectl &lt;span class="nb">exec&lt;/span> -n monitoring dcgm-exporter-xxx -- &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> curl -s localhost:9400/metrics &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> &lt;span class="p">|&lt;/span> grep DCGM_FI_DEV_TOTAL_ENERGY_CONSUMPTION &lt;span class="p">|&lt;/span> awk &lt;span class="s1">&amp;#39;{sum+=$2} END{print sum}&amp;#39;&lt;/span>&lt;span class="k">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 7. Collect the results from the volume&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">kubectl cp benchmark/bench-run-pod:/results/ ./results/20260616T1200/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 8. Compute the experiment&amp;#39;s energy (mJ → kWh)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">python scripts/calc_energy.py &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --pre &lt;span class="nv">$PRE_ENERGY&lt;/span> --post &lt;span class="nv">$POST_ENERGY&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> --run-id 20260616T1200
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 9. Add a row to the aggregate CSV&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">python scripts/aggregate_scorecards.py results/ &amp;gt; scorecard-aggregate.csv
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 10. Version it&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">git add results/20260616T1200/ scorecard-aggregate.csv
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">git commit -m &lt;span class="s2">&amp;#34;bench: llama3-70b fp8 4xH100 ISL1024 OSL256 (20260616T1200)&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Steps 6-9 are candidates for automation as a second post-processing Job launched when the main one completes (with &lt;code>ownerReferences&lt;/code> or a clean-up CronJob). In the harness&amp;rsquo;s basic state, the manual steps are precisely the ones that force a review of the result before versioning it.&lt;/p>
&lt;hr>
&lt;h2 id="cost-of-the-experiment">Cost of the experiment&lt;/h2>
&lt;p>A GuideLLM sweep of 10 rounds at 120 seconds per round occupies the node for ~22-26 minutes. The AIPerf profile at 4 concurrencies (200 requests each) adds ~8-12 minutes. Total per run: ~35-40 minutes of a 4×H100 node.&lt;/p>
&lt;p>At the reference amortised cost (~10.8 €/h for 4×H100 on-prem):&lt;/p>
$$\text{cost per run} \approx 10.8 \times \frac{38}{60} \approx 6.84 \text{ EUR}$$
&lt;p>At the reference European cloud price (4 × 2.73 = 10.92 €/h):&lt;/p>
$$\text{cost per run (cloud)} \approx 10.92 \times \frac{38}{60} \approx 6.92 \text{ EUR}$$
&lt;p>A continuous benchmarking programme (10 configurations × 3 models × 2 sweeps/week) adds up to ~415 EUR/week. That is why the harness includes short sweeps (5 rounds, ~15 minutes) for CI and full sweeps for releases.&lt;/p>
&lt;hr>
&lt;h2 id="what-the-harness-does-not-measure-and-why">What the harness does not measure (and why)&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Missing dimension&lt;/th>
&lt;th>Reason&lt;/th>
&lt;th>Where it is covered&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Output quality (MMLU, HumanEval)&lt;/td>
&lt;td>requires a quality evaluation bench, not a serving one&lt;/td>
&lt;td>&lt;a href="https://blog.lo0.es/en/posts/cost-performance-energy-three-axes-llm-inference/">LLM quality benchmarks&lt;/a>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Training throughput&lt;/td>
&lt;td>the harness is exclusively for inference&lt;/td>
&lt;td>outside the scope of the &amp;ldquo;data&amp;rdquo; series&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Network and storage cost&lt;/td>
&lt;td>OpenCost can attribute it, but it requires additional configuration&lt;/td>
&lt;td>&lt;a href="https://blog.lo0.es/en/posts/opencost-gpu-cost-allocation-kubernetes/">OpenCost: cost allocation&lt;/a>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Hourly carbon intensity&lt;/td>
&lt;td>use the ElectricityMaps API + the measured energy&lt;/td>
&lt;td>&lt;a href="https://blog.lo0.es/en/posts/cost-performance-energy-three-axes-llm-inference/">From the watt to carbon: PUE and grid mix&lt;/a>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Client-server network latency&lt;/td>
&lt;td>the Job runs inside the cluster; WAN latency requires an external client&lt;/td>
&lt;td>document as additional metadata&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>GuideLLM · GitHub (proyecto vLLM) — &lt;a href="https://github.com/vllm-project/guidellm">https://github.com/vllm-project/guidellm&lt;/a>&lt;/li>
&lt;li>GuideLLM · PyPI — &lt;a href="https://pypi.org/project/guidellm/">https://pypi.org/project/guidellm/&lt;/a>&lt;/li>
&lt;li>Red Hat Developer · desplegar y benchmarkear vLLM con GuideLLM en Kubernetes — &lt;a href="https://developers.redhat.com/articles/2025/12/24/how-deploy-and-benchmark-vllm-guidellm-kubernetes">https://developers.redhat.com/articles/2025/12/24/how-deploy-and-benchmark-vllm-guidellm-kubernetes&lt;/a>&lt;/li>
&lt;li>Red Hat Developer · GuideLLM: evaluar despliegues LLM para inferencia real — &lt;a href="https://developers.redhat.com/articles/2025/06/20/guidellm-evaluate-llm-deployments-real-world-inference">https://developers.redhat.com/articles/2025/06/20/guidellm-evaluate-llm-deployments-real-world-inference&lt;/a>&lt;/li>
&lt;li>AIPerf · GitHub (ai-dynamo/aiperf) — &lt;a href="https://github.com/ai-dynamo/aiperf">https://github.com/ai-dynamo/aiperf&lt;/a>&lt;/li>
&lt;li>GenAI-Perf · documentación NVIDIA Triton — &lt;a href="https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/perf_analyzer/genai-perf/README.html">https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/perf_analyzer/genai-perf/README.html&lt;/a>&lt;/li>
&lt;li>NVIDIA · LLM performance benchmarking con GenAI-Perf — &lt;a href="https://developer.nvidia.com/blog/llm-performance-benchmarking-measuring-nvidia-nim-performance-with-genai-perf">https://developer.nvidia.com/blog/llm-performance-benchmarking-measuring-nvidia-nim-performance-with-genai-perf&lt;/a>&lt;/li>
&lt;li>NVIDIA NIM Benchmarking · métricas (TTFT, ITL, throughput) — &lt;a href="https://docs.nvidia.com/nim/benchmarking/llm/latest/metrics.html">https://docs.nvidia.com/nim/benchmarking/llm/latest/metrics.html&lt;/a>&lt;/li>
&lt;li>OpenCost · web oficial — &lt;a href="https://opencost.io/">https://opencost.io/&lt;/a>&lt;/li>
&lt;li>OpenCost · GitHub (opencost/opencost) — &lt;a href="https://github.com/opencost/opencost">https://github.com/opencost/opencost&lt;/a>&lt;/li>
&lt;li>OpenCost · CNCF blog (sandbox → incubating) — &lt;a href="https://www.cncf.io/blog/2022/12/06/opencost-a-new-cncf-sandbox-project-for-real-time-kubernetes-cost-monitoring/">https://www.cncf.io/blog/2022/12/06/opencost-a-new-cncf-sandbox-project-for-real-time-kubernetes-cost-monitoring/&lt;/a>&lt;/li>
&lt;li>LiteLLM · web oficial — &lt;a href="https://www.litellm.ai/">https://www.litellm.ai/&lt;/a>&lt;/li>
&lt;li>LiteLLM · GitHub (BerriAI/litellm) — &lt;a href="https://github.com/BerriAI/litellm">https://github.com/BerriAI/litellm&lt;/a>&lt;/li>
&lt;li>LiteLLM · Spend Tracking docs — &lt;a href="https://docs.litellm.ai/docs/proxy/cost_tracking">https://docs.litellm.ai/docs/proxy/cost_tracking&lt;/a>&lt;/li>
&lt;li>NVIDIA DCGM Exporter · documentación oficial — &lt;a href="https://docs.nvidia.com/datacenter/dcgm/latest/gpu-telemetry/dcgm-exporter.html">https://docs.nvidia.com/datacenter/dcgm/latest/gpu-telemetry/dcgm-exporter.html&lt;/a>&lt;/li>
&lt;li>NVIDIA DCGM Exporter · GitHub — &lt;a href="https://github.com/NVIDIA/dcgm-exporter">https://github.com/NVIDIA/dcgm-exporter&lt;/a>&lt;/li>
&lt;li>NVIDIA DCGM Exporter · métricas CSV — &lt;a href="https://github.com/NVIDIA/dcgm-exporter/blob/main/etc/dcp-metrics-included.csv">https://github.com/NVIDIA/dcgm-exporter/blob/main/etc/dcp-metrics-included.csv&lt;/a>&lt;/li>
&lt;li>Kepler (Kubernetes-based Efficient Power Level Exporter) · GitHub — &lt;a href="https://github.com/sustainable-computing-io/kepler">https://github.com/sustainable-computing-io/kepler&lt;/a>&lt;/li>
&lt;li>Red Hat Emerging Technologies · Introducing Kepler — &lt;a href="https://next.redhat.com/2023/08/22/introducing-kepler-efficient-power-monitoring-for-kubernetes/">https://next.redhat.com/2023/08/22/introducing-kepler-efficient-power-monitoring-for-kubernetes/&lt;/a>&lt;/li>
&lt;li>MLCommons · MLPerf Inference Datacenter benchmark — &lt;a href="https://mlcommons.org/benchmarks/inference-datacenter/">https://mlcommons.org/benchmarks/inference-datacenter/&lt;/a>&lt;/li>
&lt;li>MLCommons · MLPerf Power presentado en IEEE HPCA 2025 — &lt;a href="https://mlcommons.org/2025/03/ml-commons-power-hpca/">https://mlcommons.org/2025/03/ml-commons-power-hpca/&lt;/a>&lt;/li>
&lt;li>IEEE Xplore · MLPerf Power paper (μWatts to MWatts) — &lt;a href="https://ieeexplore.ieee.org/document/10946778/">https://ieeexplore.ieee.org/document/10946778/&lt;/a>&lt;/li>
&lt;li>MLCommons · MLPerf Inference v5.1 results (septiembre 2025) — &lt;a href="https://mlcommons.org/2025/09/mlperf-inference-v5-1-results/">https://mlcommons.org/2025/09/mlperf-inference-v5-1-results/&lt;/a>&lt;/li>
&lt;li>Red Hat · Efficient and reproducible LLM inference: MLPerf Inference v5.1 — &lt;a href="https://www.redhat.com/en/blog/efficient-and-reproducible-llm-inference-red-hat-mlperf-inference-v51-results">https://www.redhat.com/en/blog/efficient-and-reproducible-llm-inference-red-hat-mlperf-inference-v51-results&lt;/a>&lt;/li>
&lt;li>BentoML · Beyond tokens-per-second: cost, speed and quality in LLM inference — &lt;a href="https://www.bentoml.com/blog/beyond-tokens-per-second-how-to-balance-speed-cost-and-quality-in-llm-inference">https://www.bentoml.com/blog/beyond-tokens-per-second-how-to-balance-speed-cost-and-quality-in-llm-inference&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>GPU chargeback and showback in multi-tenancy: how to split cluster cost between teams</title><link>https://blog.lo0.es/en/posts/gpu-chargeback-showback-multi-tenancy/</link><pubDate>Mon, 15 Jun 2026 04:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/gpu-chargeback-showback-multi-tenancy/</guid><description>&lt;blockquote>
&lt;p>Notation: amounts in &lt;strong>euros (N €)&lt;/strong>, decimals with a point. The dollar sign is not used
(on this site it is a formula delimiter).&lt;/p>
&lt;/blockquote>
&lt;h2 id="tldr">TL;DR&lt;/h2>
&lt;p>A cluster of 4×H100 SXM at ~1.40 €/GPU-hour (depreciated capex plus energy) shared between three
teams with different occupancy produces a monthly chargeback report of 3 rows and an additional
idle row that nobody claimed. Without tooling, that idle cost vanishes, diluted into the total.
With OpenCost + LiteLLM + Kueue, attribution operates on three orthogonal planes: the &lt;strong>iron&lt;/strong>
(OpenCost, €/GPU-hour per namespace/label), &lt;strong>token consumption&lt;/strong> (LiteLLM, €/token per
key/team/model) and the &lt;strong>scheduler quota&lt;/strong> (Kueue, GPUs reserved per ClusterQueue). Crossing the
three produces the number that goes to finance: team B consumed X million tokens at Y €/1M tok,
the GPU cost it Z €, and it still has 2 GPUs borrowed from the cohort that will cost it W € if it
holds on to them next month.&lt;/p>
&lt;hr>
&lt;h2 id="showback-vs-chargeback-the-finops-foundation-definition">Showback vs chargeback: the FinOps Foundation definition&lt;/h2>
&lt;p>The distinction is not one of technology but of &lt;strong>accounting formality&lt;/strong>
(&lt;a href="https://www.finops.org/framework/capabilities/invoicing-chargeback/">FinOps Foundation — Invoicing &amp;amp; Chargeback&lt;/a>,
&lt;a href="https://www.finops.org/framework/previous-capabilities/analysis-showback/">FinOps Foundation — Data Analysis and Showback&lt;/a>):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Concept&lt;/th>
&lt;th>Definition&lt;/th>
&lt;th>Moves money&lt;/th>
&lt;th>Requires&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Showback&lt;/strong>&lt;/td>
&lt;td>visibility of consumption and its cost per team; the report arrives, the budget does not change&lt;/td>
&lt;td>No&lt;/td>
&lt;td>metrics + attribution&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Chargeback&lt;/strong>&lt;/td>
&lt;td>the cost is transferred to the team&amp;rsquo;s or product&amp;rsquo;s P&amp;amp;L as real expenditure&lt;/td>
&lt;td>Yes&lt;/td>
&lt;td>showback + accounting policy + financial system&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Two points from the framework worth pinning down:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Showback is a requirement of any FinOps practice; chargeback is optional&lt;/strong> and depends on
the organisation&amp;rsquo;s accounting policy supporting transfers between cost centres.&lt;/li>
&lt;li>&lt;strong>Neither is &amp;ldquo;more mature&amp;rdquo; than the other.&lt;/strong> The narrative that chargeback is the &amp;ldquo;grown-up&amp;rdquo;
version is false according to the framework itself. The natural sequence is: showback → trust
in the data → chargeback if policy allows it.&lt;/li>
&lt;/ol>
&lt;h3 id="when-to-use-each">When to use each&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Situation&lt;/th>
&lt;th>Recommended mode&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>First attribution cycle; teams do not trust the data yet&lt;/td>
&lt;td>Showback&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Teams with their own budget in a financial system&lt;/td>
&lt;td>Chargeback&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Shared cluster with no P&amp;amp;L separation per team&lt;/td>
&lt;td>Showback with visible idle cost&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Teams with a committed GPU availability SLA&lt;/td>
&lt;td>Chargeback (real reservation)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Research/experimentation workloads with no formal budget&lt;/td>
&lt;td>Showback + threshold alert&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="gpu-cost-attribution-with-opencost">GPU cost attribution with OpenCost&lt;/h2>
&lt;h3 id="allocation-api-attribution-parameters">Allocation API: attribution parameters&lt;/h3>
&lt;p>The OpenCost &lt;code>/allocation&lt;/code> API is the piece that turns Prometheus metrics into a cost report per
dimension (&lt;a href="https://opencost.io/docs/integrations/api/">OpenCost — API&lt;/a>):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Values&lt;/th>
&lt;th>Use in multi-tenancy&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>window&lt;/code>&lt;/td>
&lt;td>&lt;code>today&lt;/code>, &lt;code>7d&lt;/code>, &lt;code>lastmonth&lt;/code>, RFC3339 range&lt;/td>
&lt;td>window of the monthly report&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>aggregate&lt;/code>&lt;/td>
&lt;td>&lt;code>namespace&lt;/code>, &lt;code>label:LABEL&lt;/code>, &lt;code>annotation:NAME&lt;/code>, &lt;code>pod&lt;/code>, &lt;code>controller&lt;/code>&lt;/td>
&lt;td>attribution dimension&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>includeIdle&lt;/code>&lt;/td>
&lt;td>&lt;code>true&lt;/code> / &lt;code>false&lt;/code>&lt;/td>
&lt;td>adds an &lt;code>__idle__&lt;/code> row to the report&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>shareIdle&lt;/code>&lt;/td>
&lt;td>&lt;code>true&lt;/code> / &lt;code>false&lt;/code>&lt;/td>
&lt;td>distributes idle among the non-idle allocations (proportional to non-idle cost)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>idleByNode&lt;/code>&lt;/td>
&lt;td>&lt;code>true&lt;/code> / &lt;code>false&lt;/code>&lt;/td>
&lt;td>computes idle per node instead of per cluster&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>filter&lt;/code>&lt;/td>
&lt;td>&lt;code>namespace:&amp;quot;llm-prod&amp;quot;&lt;/code>, &lt;code>label:equipo:&amp;quot;datos&amp;quot;&lt;/code>&lt;/td>
&lt;td>restrict to one specific team&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Query for a monthly report per team, with idle visible as a separate row:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">curl -G http://localhost:9003/allocation &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">window&lt;/span>&lt;span class="o">=&lt;/span>lastmonth &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">aggregate&lt;/span>&lt;span class="o">=&lt;/span>label:equipo &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">includeIdle&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">shareIdle&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">false&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">resolution&lt;/span>&lt;span class="o">=&lt;/span>10m
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>With &lt;code>shareIdle=false&lt;/code> (the default), OpenCost returns idle as a separate &lt;code>__idle__&lt;/code> entry, which
makes visible how much was paid for unused capacity. With &lt;code>shareIdle=true&lt;/code>, that idle is
distributed among the tenants in proportion to their non-idle cost: each absorbs its share of the
waste, which is the right behaviour for a chargeback that penalises whoever is responsible for
the idle.&lt;/p>
&lt;h3 id="labelling-inference-pods">Labelling inference pods&lt;/h3>
&lt;p>For &lt;code>aggregate=label:equipo&lt;/code> to work, the inference pods need the right label. Two methods:&lt;/p>
&lt;p>&lt;strong>Label in the pod spec&lt;/strong> (the most direct):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># vLLM Deployment for the datos team&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">labels&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">equipo&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">datos&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">producto&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">rag-prod&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">modelo&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama-70b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">entorno&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">prod&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Annotation&lt;/strong> (when the label is already taken by another convention):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># aggregate as an annotation&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">aggregate&lt;/span>&lt;span class="o">=&lt;/span>annotation:finops.io/equipo
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>OpenCost supports &lt;code>aggregate=label:KEY&lt;/code> and &lt;code>aggregate=annotation:KEY&lt;/code> with the same syntax; the
choice between the two depends on the cluster&amp;rsquo;s labelling convention.&lt;/p>
&lt;h3 id="shared-costs-and-idle-the-three-modes">Shared costs and idle: the three modes&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>API mode&lt;/th>
&lt;th>Behaviour&lt;/th>
&lt;th>When&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>includeIdle=false&lt;/code> (default)&lt;/td>
&lt;td>Ignores idle; total cost looks lower than it is&lt;/td>
&lt;td>Never in production&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>includeIdle=true, shareIdle=false&lt;/code>&lt;/td>
&lt;td>Idle in a separate &lt;code>__idle__&lt;/code> row&lt;/td>
&lt;td>Showback: visibility of waste&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>includeIdle=true, shareIdle=true&lt;/code>&lt;/td>
&lt;td>Idle distributed among tenants proportionally&lt;/td>
&lt;td>Chargeback: the team pays its share of idle&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>shareIdle=true, idleByNode=true&lt;/code>&lt;/td>
&lt;td>Idle distributed per node (finer-grained if there are dedicated nodes)&lt;/td>
&lt;td>Chargeback with heterogeneous nodes&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>For infrastructure with nodes dedicated per team, &lt;code>idleByNode=true&lt;/code> is fairer: the idle of a node
dedicated to team A is not transferred to team B.&lt;/p>
&lt;hr>
&lt;h2 id="litellm-as-the-attribution-point-for-token-consumption">LiteLLM as the attribution point for token consumption&lt;/h2>
&lt;h3 id="virtual-keys-and-teams">Virtual keys and teams&lt;/h3>
&lt;p>LiteLLM materialises token chargeback with four mechanisms
(&lt;a href="https://docs.litellm.ai/docs/proxy/virtual_keys">LiteLLM — Virtual Keys&lt;/a>,
&lt;a href="https://docs.litellm.ai/docs/proxy/team_budgets">LiteLLM — Setting Team Budgets&lt;/a>,
&lt;a href="https://docs.litellm.ai/docs/proxy/cost_tracking">LiteLLM — Spend Tracking&lt;/a>):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Mechanism&lt;/th>
&lt;th>What it does&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Virtual key&lt;/strong> with &lt;code>max_budget&lt;/code>&lt;/td>
&lt;td>monthly budget per key; the key is blocked once it is exhausted&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>&lt;code>budget_duration&lt;/code>&lt;/strong>&lt;/td>
&lt;td>reset window: &lt;code>30d&lt;/code>, &lt;code>7d&lt;/code>, &lt;code>24h&lt;/code>; the proxy runs a daily cron that resets according to the duration&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>&lt;code>team_id&lt;/code>&lt;/strong>&lt;/td>
&lt;td>groups keys; spend accumulates in &lt;code>LiteLLM_TeamTable&lt;/code> per team&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>&lt;code>tags&lt;/code>&lt;/strong>&lt;/td>
&lt;td>tag each request; they allow budgets per tag (cost centre)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Spend logs&lt;/strong>&lt;/td>
&lt;td>one row per request with &lt;code>team_id&lt;/code>, &lt;code>model&lt;/code>, &lt;code>prompt_tokens&lt;/code>, &lt;code>completion_tokens&lt;/code>, &lt;code>response_cost&lt;/code>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="configuring-teams-with-a-monthly-budget">Configuring teams with a monthly budget&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># litellm-config.yaml — per-team budgets with the declared on-prem cost&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">model_list&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">model_name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama-3-70b-onprem&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">litellm_params&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">openai/llama-3-70b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_base&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">http://vllm-svc:8000/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">input_cost_per_token&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.00000140&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># 1.40 €/1M tok (€/GPU-hour ÷ throughput)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">output_cost_per_token&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.00000140&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">model_name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama-3-8b-onprem&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">litellm_params&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">openai/llama-3-8b&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_base&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">http://vllm-8b-svc:8000/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">input_cost_per_token&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.00000035&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># 0.35 €/1M tok (1 GPU, higher throughput)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">output_cost_per_token&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.00000035&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">litellm_settings&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">success_callback&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;langfuse&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># or any external logger&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># Teams (via the /team/new API or config)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># POST /team/new&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># {&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># &amp;#34;team_alias&amp;#34;: &amp;#34;equipo-datos&amp;#34;,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># &amp;#34;max_budget&amp;#34;: 800, # 800 € per month&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># &amp;#34;budget_duration&amp;#34;: &amp;#34;30d&amp;#34;,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># &amp;#34;tpm_limit&amp;#34;: 500000, # max tokens/min&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># &amp;#34;rpm_limit&amp;#34;: 1000 # max requests/min&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># }&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The &lt;code>input_cost_per_token&lt;/code> key comes from the identity in &lt;a href="https://blog.lo0.es/en/posts/gpu-hour-to-cost-per-token-on-prem-vs-cloud/">article A4&lt;/a>:
the €/GPU-hour from OpenCost divided by the benchmark throughput. With that value, the
&lt;code>response_cost&lt;/code> of each request reflects the real cost of the on-prem iron for that model.&lt;/p>
&lt;h3 id="endpoints-for-querying-spend-per-team">Endpoints for querying spend per team&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Team spend accumulated over the period&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">GET /team/info?team_id&lt;span class="o">=&lt;/span>equipo-datos
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Team spend per model (aggregated spend_logs table)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">GET /global/spend/logs?team_id&lt;span class="o">=&lt;/span>equipo-datos&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">start_date&lt;/span>&lt;span class="o">=&lt;/span>2026-06-01&lt;span class="p">&amp;amp;&lt;/span>&lt;span class="nv">end_date&lt;/span>&lt;span class="o">=&lt;/span>2026-06-30
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Total spend across all teams&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">GET /global/spend/teams
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The response includes &lt;code>spend&lt;/code> (accumulated cost in the configured currency), &lt;code>total_tokens&lt;/code>,
&lt;code>prompt_tokens&lt;/code>, &lt;code>completion_tokens&lt;/code> and a per-model breakdown, the direct fields for the monthly
chargeback report.&lt;/p>
&lt;h3 id="joining-gpu-hour-iron-with-tokens-per-team">Joining €/GPU-hour (iron) with tokens per team&lt;/h3>
&lt;p>The two attribution planes, OpenCost (iron) and LiteLLM (tokens), are crossed with one key: the
&lt;code>model_name&lt;/code> and the &lt;code>namespace&lt;/code>. The join happens outside the tools (in a BI pipeline or a SQL
query over the LiteLLM database and the data exported from OpenCost):&lt;/p>
&lt;pre tabindex="0">&lt;code>coste_por_token_real = OpenCost.GPU_cost_namespace / LiteLLM.total_tokens_team
&lt;/code>&lt;/pre>&lt;p>When the on-prem cost is properly declared in &lt;code>input_cost_per_token&lt;/code>, LiteLLM already does this
calculation internally and the &lt;code>response_cost&lt;/code> is correct. The explicit join serves to validate:
if the sum of LiteLLM&amp;rsquo;s &lt;code>response_cost&lt;/code> per team does not match the GPU cost OpenCost assigns to
the namespace, there is drift in &lt;code>input_cost_per_token&lt;/code> that has to be corrected (changed
throughput, a new optimisation, more replicas).&lt;/p>
&lt;hr>
&lt;h2 id="kueue-as-the-gpu-budgetquota-mechanism">Kueue as the GPU budget/quota mechanism&lt;/h2>
&lt;h3 id="clusterqueue-localqueue-and-cohorts">ClusterQueue, LocalQueue and cohorts&lt;/h3>
&lt;p>Kueue introduces the &lt;strong>quota-based scheduling&lt;/strong> layer on top of Kubernetes
(&lt;a href="https://kueue.sigs.k8s.io/docs/concepts/cluster_queue/">Kueue — Cluster Queue&lt;/a>,
&lt;a href="https://kueue.sigs.k8s.io/docs/concepts/cohort/">Kueue — Cohort&lt;/a>,
&lt;a href="https://kueue.sigs.k8s.io/docs/concepts/fair_sharing/">Kueue — Fair Sharing&lt;/a>):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Object&lt;/th>
&lt;th>Scope&lt;/th>
&lt;th>What it does&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>ResourceFlavor&lt;/code>&lt;/td>
&lt;td>cluster&lt;/td>
&lt;td>maps resources to a group of nodes (e.g. H100 nodes)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>ClusterQueue&lt;/code>&lt;/td>
&lt;td>cluster&lt;/td>
&lt;td>defines &lt;code>nominalQuota&lt;/code>, &lt;code>borrowingLimit&lt;/code>, &lt;code>lendingLimit&lt;/code> per resource/flavor&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>LocalQueue&lt;/code>&lt;/td>
&lt;td>namespace&lt;/td>
&lt;td>entry point for the team&amp;rsquo;s workloads; points to a &lt;code>ClusterQueue&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Cohort&lt;/code>&lt;/td>
&lt;td>cluster&lt;/td>
&lt;td>groups ClusterQueues that can lend quota to each other&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="quota-concepts">Quota concepts&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>&lt;code>nominalQuota&lt;/code>&lt;/strong>: GPUs guaranteed to the ClusterQueue at all times.&lt;/li>
&lt;li>&lt;strong>&lt;code>borrowingLimit&lt;/code>&lt;/strong>: maximum additional GPUs it can borrow from the cohort when others are not
using them.&lt;/li>
&lt;li>&lt;strong>&lt;code>lendingLimit&lt;/code>&lt;/strong>: GPUs from its &lt;code>nominalQuota&lt;/code> that it allows to be lent to others (if not
specified, it can lend all unused ones).&lt;/li>
&lt;li>&lt;strong>Fair Sharing&lt;/strong>: a mechanism that orders pending workloads by the historical resource usage of
their LocalQueue, giving preference to whoever has consumed less. Compatible with hierarchical
cohorts since Kueue v0.11.&lt;/li>
&lt;/ul>
&lt;h3 id="example-yaml-3-teams-in-the-llm-platform-cohort">Example YAML: 3 teams in the llm-platform cohort&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># ResourceFlavor mapping to the H100 SXM nodes&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">kueue.x-k8s.io/v1beta2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ResourceFlavor&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">h100-sxm&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">nodeLabels&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">accelerator&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">h100-sxm&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nn">---&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># ClusterQueue for the datos team — 2 guaranteed GPUs, can borrow up to 2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">kueue.x-k8s.io/v1beta2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ClusterQueue&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">cq-datos&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">cohort&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llm-platform&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">namespaceSelector&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">matchLabels&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">kubernetes.io/metadata.name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ns-datos&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">queueingStrategy&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">BestEffortFIFO&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">resourceGroups&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">coveredResources&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;nvidia.com/gpu&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">flavors&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">h100-sxm&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">resources&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;nvidia.com/gpu&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">nominalQuota&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">borrowingLimit&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">2&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># can use up to 4 GPUs in total&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">preemption&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">reclaimWithinCohort&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">LowerPriority&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">withinClusterQueue&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">LowerPriority&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nn">---&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># ClusterQueue for the ia team — 1 guaranteed GPU, lends what it does not use&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">kueue.x-k8s.io/v1beta2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ClusterQueue&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">cq-ia&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">cohort&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llm-platform&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">namespaceSelector&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">matchLabels&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">kubernetes.io/metadata.name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ns-ia&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">resourceGroups&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">coveredResources&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;nvidia.com/gpu&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">flavors&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">h100-sxm&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">resources&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;nvidia.com/gpu&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">nominalQuota&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">lendingLimit&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">1&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># lends its GPU when it is not using it&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nn">---&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># ClusterQueue for the plataforma team — 1 guaranteed GPU, low priority&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">kueue.x-k8s.io/v1beta2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ClusterQueue&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">cq-plataforma&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">cohort&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llm-platform&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">namespaceSelector&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">matchLabels&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">kubernetes.io/metadata.name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ns-plataforma&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">resourceGroups&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">coveredResources&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;nvidia.com/gpu&amp;#34;&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">flavors&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">h100-sxm&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">resources&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;nvidia.com/gpu&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">nominalQuota&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">borrowingLimit&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">3&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># can use all 4 if the rest are free&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nn">---&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c"># LocalQueue in each namespace — entry point for the workloads&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">kueue.x-k8s.io/v1beta2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">LocalQueue&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">lq-datos&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">namespace&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">ns-datos&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">clusterQueue&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">cq-datos&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="how-kueue-materialises-the-gpu-budget">How Kueue materialises the &amp;ldquo;GPU budget&amp;rdquo;&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>FinOps concept&lt;/th>
&lt;th>Kueue mechanism&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Guaranteed budget&lt;/td>
&lt;td>&lt;code>nominalQuota&lt;/code>: the team always has these GPUs available&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maximum spend limit&lt;/td>
&lt;td>&lt;code>nominalQuota + borrowingLimit&lt;/code>: absolute ceiling of admissible GPUs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Lending idle capacity&lt;/td>
&lt;td>cohort + &lt;code>lendingLimit&lt;/code>: others take what this one does not use&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Fair sharing between teams&lt;/td>
&lt;td>&lt;code>Fair Sharing&lt;/code> + &lt;code>WorkloadPriorityClass&lt;/code>: those who have consumed most wait longest&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Reclaiming your own quota&lt;/td>
&lt;td>&lt;code>preemption.reclaimWithinCohort: LowerPriority&lt;/code>: the owner of the lent GPU reclaims it by evicting lower-priority workloads&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The &lt;code>nominalQuota&lt;/code> is the expression of the budget in GPUs: if the team has 2 nominal GPUs and the
price is 1.40 €/GPU-hour, its maximum guaranteed spend is&lt;/p>
\[
\text{maximum nominal spend} = 2 \times 1.40 \times 720 = 2{,}016 \text{ €/month}
\]
&lt;p>The &lt;code>borrowingLimit&lt;/code> sets the potential overspend if it borrows from the cohort (and that
borrowing can be charged with the same formula, multiplying the borrowed usage hours by
1.40 €/GPU-hour).&lt;/p>
&lt;hr>
&lt;h2 id="cost-model-an-example-with-4h100-sxm-and-3-teams">Cost model: an example with 4×H100 SXM and 3 teams&lt;/h2>
&lt;h3 id="node-price">Node price&lt;/h3>
&lt;p>Generic hardware: a server with 4×H100 SXM 80 GB. 2026 market prices: a single H100 SXM costs
between 27,000 and 40,000 € depending on the source
(&lt;a href="https://www.gmicloud.ai/en/blog/nvidia-h100-gpu-pricing-2026-rent-vs-buy-cost-analysis">GMI Cloud — H100 GPU Pricing 2026&lt;/a>);
a 4×H100 server sits in the 120,000–180,000 € range including chassis, power supplies and NVLink.
We use 140,000 € as a generic assumption for the complete server (4 GPUs plus infrastructure).&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Component&lt;/th>
&lt;th>Calculation&lt;/th>
&lt;th>€/hour node&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Depreciated capex (140,000 €, 4 years, 90 % availability)&lt;/td>
&lt;td>140,000 ÷ (4 × 8,760 × 0.9)&lt;/td>
&lt;td>~4.43&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Energy (4 × 700 W TDP × PUE 1.4 × 0.12 €/kWh)&lt;/td>
&lt;td>4 × 0.7 × 1.4 × 0.12&lt;/td>
&lt;td>~0.47&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Operations / networking / maintenance&lt;/td>
&lt;td>estimate&lt;/td>
&lt;td>~0.70&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Total 4×H100 node&lt;/strong>&lt;/td>
&lt;td>&lt;/td>
&lt;td>&lt;strong>~5.60 €/h&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Per GPU&lt;/strong>&lt;/td>
&lt;td>5.60 ÷ 4&lt;/td>
&lt;td>&lt;strong>~1.40 €/GPU-hour&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Cost-per-token formula for the 70B model (sustained throughput ~2,000 tok/s at TP=4):&lt;/p>
$$\text{€/1M tokens} = \frac{5.60 \text{ €/h}}{2{,}000 \text{ tok/s} \times 3{,}600 \text{ s/h}} \times 10^6 \approx 0.78 \text{ €/1M tokens}$$
&lt;h3 id="monthly-scenario-3-teams-heterogeneous-utilisation">Monthly scenario: 3 teams, heterogeneous utilisation&lt;/h3>
&lt;p>Reference month (720 hours). The 4 GPUs are nominally assigned: 2 to &lt;strong>Datos&lt;/strong>, 1 to &lt;strong>IA&lt;/strong>, 1 to
&lt;strong>Plataforma&lt;/strong>. Real occupancy varies:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Team&lt;/th>
&lt;th>Nominal GPUs&lt;/th>
&lt;th>Average occupancy&lt;/th>
&lt;th>GPU-hours used&lt;/th>
&lt;th>Idle GPU-hours&lt;/th>
&lt;th>GPU cost (€)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Datos&lt;/td>
&lt;td>2&lt;/td>
&lt;td>75 %&lt;/td>
&lt;td>1,080&lt;/td>
&lt;td>360&lt;/td>
&lt;td>~1,512&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>IA&lt;/td>
&lt;td>1&lt;/td>
&lt;td>60 %&lt;/td>
&lt;td>432&lt;/td>
&lt;td>288&lt;/td>
&lt;td>~605&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Plataforma&lt;/td>
&lt;td>1&lt;/td>
&lt;td>35 %&lt;/td>
&lt;td>252&lt;/td>
&lt;td>468&lt;/td>
&lt;td>~353&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Cluster idle&lt;/strong>&lt;/td>
&lt;td>—&lt;/td>
&lt;td>—&lt;/td>
&lt;td>—&lt;/td>
&lt;td>&lt;strong>1,116&lt;/strong>&lt;/td>
&lt;td>&lt;strong>~1,562&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Node total&lt;/strong>&lt;/td>
&lt;td>4&lt;/td>
&lt;td>—&lt;/td>
&lt;td>1,764&lt;/td>
&lt;td>1,116&lt;/td>
&lt;td>&lt;strong>~4,032&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;blockquote>
&lt;p>Total node cost per month: 5.60 €/h × 720 h = 4,032 €.
Cost per GPU-hour used: 5.60 ÷ 4 = 1.40 €.&lt;/p>
&lt;/blockquote>
&lt;p>With &lt;code>shareIdle=false&lt;/code> (showback), the 1,562 € of idle appears as a separate row in the report and
nobody pays for it directly. With &lt;code>shareIdle=true&lt;/code> (proportional chargeback), it is split among
the three in proportion to their non-idle cost: Datos absorbs ~857 €, IA ~333 €, Plataforma ~192 €
of additional idle.&lt;/p>
&lt;h3 id="token-consumption-per-team-litellm-spend-logs">Token consumption per team (LiteLLM spend logs)&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Team&lt;/th>
&lt;th>Model&lt;/th>
&lt;th>Tokens/month&lt;/th>
&lt;th>Cost/token&lt;/th>
&lt;th>Token cost (€)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Datos&lt;/td>
&lt;td>llama-70b (TP=4)&lt;/td>
&lt;td>380 M&lt;/td>
&lt;td>0.78 €/1M&lt;/td>
&lt;td>~296&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>IA&lt;/td>
&lt;td>llama-8b (1 GPU)&lt;/td>
&lt;td>210 M&lt;/td>
&lt;td>0.35 €/1M&lt;/td>
&lt;td>~74&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Plataforma&lt;/td>
&lt;td>llama-8b + batch&lt;/td>
&lt;td>80 M&lt;/td>
&lt;td>0.35 €/1M&lt;/td>
&lt;td>~28&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="monthly-chargeback-report-showback--tokens">Monthly chargeback report (showback + tokens)&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Team&lt;/th>
&lt;th>Iron GPU cost (€)&lt;/th>
&lt;th>Assigned idle cost (€)&lt;/th>
&lt;th>LiteLLM token cost (€)&lt;/th>
&lt;th>Total chargeable (€)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Datos&lt;/td>
&lt;td>1,512&lt;/td>
&lt;td>857&lt;/td>
&lt;td>296&lt;/td>
&lt;td>&lt;strong>2,665&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>IA&lt;/td>
&lt;td>605&lt;/td>
&lt;td>333&lt;/td>
&lt;td>74&lt;/td>
&lt;td>&lt;strong>1,012&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Plataforma&lt;/td>
&lt;td>353&lt;/td>
&lt;td>192&lt;/td>
&lt;td>28&lt;/td>
&lt;td>&lt;strong>573&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Idle (without shareIdle)&lt;/td>
&lt;td>1,562&lt;/td>
&lt;td>—&lt;/td>
&lt;td>—&lt;/td>
&lt;td>visible, not charged&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="attribution-dimensions--policy-table">Attribution dimensions × policy table&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Attribution dimension&lt;/th>
&lt;th>Tool&lt;/th>
&lt;th>Showback&lt;/th>
&lt;th>Chargeback&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>namespace&lt;/td>
&lt;td>OpenCost &lt;code>aggregate=namespace&lt;/code>&lt;/td>
&lt;td>&lt;code>/allocation?aggregate=namespace&amp;amp;includeIdle=true&lt;/code>&lt;/td>
&lt;td>&lt;code>shareIdle=true&lt;/code> + transfer to P&amp;amp;L&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>pod label&lt;/td>
&lt;td>OpenCost &lt;code>aggregate=label:equipo&lt;/code>&lt;/td>
&lt;td>report per label&lt;/td>
&lt;td>same with shareIdle&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>virtual key / team&lt;/td>
&lt;td>LiteLLM &lt;code>/global/spend/teams&lt;/code>&lt;/td>
&lt;td>token dashboard&lt;/td>
&lt;td>hard &lt;code>max_budget&lt;/code> per key&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ClusterQueue (reserved GPU)&lt;/td>
&lt;td>Kueue &lt;code>nominalQuota&lt;/code>&lt;/td>
&lt;td>observe usage vs quota&lt;/td>
&lt;td>committed budget in GPUs&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>request tag&lt;/td>
&lt;td>LiteLLM &lt;code>tag_budgets&lt;/code>&lt;/td>
&lt;td>per cost centre&lt;/td>
&lt;td>budget per tag&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>pod annotation&lt;/td>
&lt;td>OpenCost &lt;code>aggregate=annotation:KEY&lt;/code>&lt;/td>
&lt;td>report per annotation&lt;/td>
&lt;td>same with shareIdle&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="end-to-end-data-flow">End-to-end data flow&lt;/h2>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 300" role="img" aria-label="GPU chargeback attribution flow: from the inference pod to the three planes OpenCost, LiteLLM and Kueue, and to the monthly report" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#chm)}&lt;/style>
&lt;defs>&lt;marker id="chm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="20" y="30" width="160" height="50" rx="6"/>
&lt;text x="32" y="52" class="tl">vLLM pod&lt;/text>
&lt;text x="32" y="68" class="ts">label:equipo=datos&lt;/text>
&lt;path class="ar" d="M180,55 L220,80"/>
&lt;path class="ar" d="M180,55 L220,145"/>
&lt;path class="ar" d="M180,55 L220,210"/>
&lt;rect class="bx" x="220" y="60" width="175" height="50" rx="6"/>
&lt;text x="232" y="82" class="tl">OpenCost (iron)&lt;/text>
&lt;text x="232" y="98" class="ts">€/GPU-hour × namespace/label&lt;/text>
&lt;rect class="bx" x="220" y="125" width="175" height="50" rx="6"/>
&lt;text x="232" y="147" class="tl">LiteLLM (tokens)&lt;/text>
&lt;text x="232" y="163" class="ts">€/token × team_id/key/model&lt;/text>
&lt;rect class="bx" x="220" y="190" width="175" height="50" rx="6"/>
&lt;text x="232" y="212" class="tl">Kueue (scheduler)&lt;/text>
&lt;text x="232" y="228" class="ts">nominalQuota / cohort / fair-share&lt;/text>
&lt;path class="ar" d="M395,85 L440,140"/>
&lt;path class="ar" d="M395,150 L440,150"/>
&lt;path class="ar" d="M395,215 L440,160"/>
&lt;rect class="bx" x="440" y="115" width="185" height="70" rx="6"/>
&lt;text x="452" y="137" class="tl">Monthly report&lt;/text>
&lt;text x="452" y="153" class="ts">€/team (iron + idle + tokens)&lt;/text>
&lt;text x="452" y="169" class="ts">borrowed GPUs · budget left&lt;/text>
&lt;path class="ar" d="M625,150 L665,150"/>
&lt;rect class="dsh" x="665" y="115" width="100" height="70" rx="6"/>
&lt;text x="677" y="143" class="tl">Showback&lt;/text>
&lt;text x="677" y="159" class="ts">or&lt;/text>
&lt;text x="677" y="175" class="tl">Chargeback&lt;/text>
&lt;text x="20" y="275" class="ts">The three planes are orthogonal: OpenCost sees the iron, LiteLLM sees the tokens, Kueue sees the scheduler quota.&lt;/text>
&lt;text x="20" y="292" class="ts">Crossing the three gives the complete number: €/team with idle, tokens and borrowed GPUs.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="fair-sharing-and-preemption-how-kueue-reclaims-quota">Fair sharing and preemption: how Kueue reclaims quota&lt;/h2>
&lt;p>When the Datos team has exhausted its 2 nominal GPUs and borrows those of Plataforma (which is
not using them), Kueue records that loan. As soon as Plataforma launches a new workload:&lt;/p>
&lt;ol>
&lt;li>Kueue detects that &lt;code>cq-plataforma&lt;/code> is below its &lt;code>nominalQuota&lt;/code>.&lt;/li>
&lt;li>With &lt;code>preemption.reclaimWithinCohort: LowerPriority&lt;/code>, Kueue evicts the Datos workload that was
on the borrowed GPU, if its priority is lower.&lt;/li>
&lt;li>The evicted workload returns to the &lt;code>cq-datos&lt;/code> queue and is readmitted once quota frees up.&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>Fair Sharing&lt;/strong> orders the pending queue by the LocalQueue&amp;rsquo;s accumulated historical usage: if
Datos has consumed more GPU-hours than IA in the recent period, IA&amp;rsquo;s next workloads have
admission priority over new ones from Datos. This implements an equitable split without blocking
anyone permanently.&lt;/p>
&lt;hr>
&lt;h2 id="configuring-opencost-for-the-node-price">Configuring OpenCost for the node price&lt;/h2>
&lt;p>For the numbers in the previous section to be reproducible, the node price has to be declared
explicitly (the default value underestimates on-prem GPU,
&lt;a href="https://github.com/opencost/opencost/issues/3781">issue #3781&lt;/a>):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># OpenCost Helm values.yaml — on-prem 4×H100 node, 5.60 €/h&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">opencost&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">customPricing&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enabled&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">provider&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">custom&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">costModel&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">description&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;On-prem 4xH100 SXM node&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">CPU&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;0.025&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/CPU-hour (minor component)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">RAM&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;0.003&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/GB-hour&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">GPU&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;1.40&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/GPU-hour ← the one that drives the split&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">storage&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;0.0002&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/GB-hour&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Verify after configuring:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Check the price resolved per node&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">curl http://localhost:9003/allNodePricing
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Attribution query per team label, last month, idle separate&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">curl -G http://localhost:9003/allocation &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">window&lt;/span>&lt;span class="o">=&lt;/span>lastmonth &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">aggregate&lt;/span>&lt;span class="o">=&lt;/span>label:equipo &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">includeIdle&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">shareIdle&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">false&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -d &lt;span class="nv">accumulate&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nb">true&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="reference-promql-for-chargeback-dashboards">Reference PromQL for chargeback dashboards&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-promql" data-lang="promql">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># GPU cost assigned per team (label:equipo) — €/hour&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">sum&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">by&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">label_equipo&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nv">container_gpu_allocation&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">on&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">node&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">group_left&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nv">node_gpu_hourly_cost&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># Idle GPU-hours per node (idle &amp;gt; 15 min)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">sum&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">by&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">node&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kr">avg_over_time&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">DCGM_FI_DEV_GPU_UTIL&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s">15m&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">/&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">100&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">on&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">node&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">group_left&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nv">node_gpu_hourly_cost&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># Accumulated monthly cost per team (sum over window)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kr">sum_over_time&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">sum&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">by&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">label_equipo&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nv">container_gpu_allocation&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">on&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">node&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">group_left&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nv">node_gpu_hourly_cost&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s">30d&lt;/span>&lt;span class="err">:&lt;/span>&lt;span class="s">1h&lt;/span>&lt;span class="p">]&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>FinOps Foundation — Invoicing &amp;amp; Chargeback Capability — &lt;a href="https://www.finops.org/framework/capabilities/invoicing-chargeback/">https://www.finops.org/framework/capabilities/invoicing-chargeback/&lt;/a>&lt;/li>
&lt;li>FinOps Foundation — Data Analysis and Showback — &lt;a href="https://www.finops.org/framework/previous-capabilities/analysis-showback/">https://www.finops.org/framework/previous-capabilities/analysis-showback/&lt;/a>&lt;/li>
&lt;li>FinOps Foundation — Allocation Capability — &lt;a href="https://www.finops.org/framework/capabilities/allocation/">https://www.finops.org/framework/capabilities/allocation/&lt;/a>&lt;/li>
&lt;li>OpenCost — API (Allocation API, parámetros window/aggregate/shareIdle/idleByNode) — &lt;a href="https://opencost.io/docs/integrations/api/">https://opencost.io/docs/integrations/api/&lt;/a>&lt;/li>
&lt;li>OpenCost — API Examples — &lt;a href="https://opencost.io/docs/integrations/api-examples/">https://opencost.io/docs/integrations/api-examples/&lt;/a>&lt;/li>
&lt;li>OpenCost — GitHub (issue #3781, infra-precio GPU on-prem por defecto) — &lt;a href="https://github.com/opencost/opencost/issues/3781">https://github.com/opencost/opencost/issues/3781&lt;/a>&lt;/li>
&lt;li>LiteLLM — Virtual Keys (&lt;code>max_budget&lt;/code>, &lt;code>budget_duration&lt;/code>, &lt;code>team_id&lt;/code>) — &lt;a href="https://docs.litellm.ai/docs/proxy/virtual_keys">https://docs.litellm.ai/docs/proxy/virtual_keys&lt;/a>&lt;/li>
&lt;li>LiteLLM — Setting Team Budgets — &lt;a href="https://docs.litellm.ai/docs/proxy/team_budgets">https://docs.litellm.ai/docs/proxy/team_budgets&lt;/a>&lt;/li>
&lt;li>LiteLLM — Spend Tracking — &lt;a href="https://docs.litellm.ai/docs/proxy/cost_tracking">https://docs.litellm.ai/docs/proxy/cost_tracking&lt;/a>&lt;/li>
&lt;li>LiteLLM — Budgets &amp;amp; Rate Limits — &lt;a href="https://docs.litellm.ai/docs/proxy/users">https://docs.litellm.ai/docs/proxy/users&lt;/a>&lt;/li>
&lt;li>LiteLLM — Setting Tag Budgets — &lt;a href="https://docs.litellm.ai/docs/proxy/tag_budgets">https://docs.litellm.ai/docs/proxy/tag_budgets&lt;/a>&lt;/li>
&lt;li>LiteLLM — Budget Reset Times — &lt;a href="https://docs.litellm.ai/docs/proxy/budget_reset_and_tz">https://docs.litellm.ai/docs/proxy/budget_reset_and_tz&lt;/a>&lt;/li>
&lt;li>Kueue — Cluster Queue (nominalQuota, borrowingLimit, lendingLimit, preemption) — &lt;a href="https://kueue.sigs.k8s.io/docs/concepts/cluster_queue/">https://kueue.sigs.k8s.io/docs/concepts/cluster_queue/&lt;/a>&lt;/li>
&lt;li>Kueue — Cohort — &lt;a href="https://kueue.sigs.k8s.io/docs/concepts/cohort/">https://kueue.sigs.k8s.io/docs/concepts/cohort/&lt;/a>&lt;/li>
&lt;li>Kueue — Fair Sharing — &lt;a href="https://kueue.sigs.k8s.io/docs/concepts/fair_sharing/">https://kueue.sigs.k8s.io/docs/concepts/fair_sharing/&lt;/a>&lt;/li>
&lt;li>Kueue — Administer Cluster Quotas — &lt;a href="https://kueue.sigs.k8s.io/docs/tasks/manage/administer_cluster_quotas/">https://kueue.sigs.k8s.io/docs/tasks/manage/administer_cluster_quotas/&lt;/a>&lt;/li>
&lt;li>GMI Cloud — NVIDIA H100 GPU Pricing 2026 — &lt;a href="https://www.gmicloud.ai/en/blog/nvidia-h100-gpu-pricing-2026-rent-vs-buy-cost-analysis">https://www.gmicloud.ai/en/blog/nvidia-h100-gpu-pricing-2026-rent-vs-buy-cost-analysis&lt;/a>&lt;/li>
&lt;li>IntuitionLabs — NVIDIA AI GPU Prices H100 Cost Guide — &lt;a href="https://intuitionlabs.ai/articles/nvidia-ai-gpu-pricing-guide">https://intuitionlabs.ai/articles/nvidia-ai-gpu-pricing-guide&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/opencost-gpu-cost-allocation-kubernetes/">OpenCost in depth: how GPU cost is allocated in Kubernetes&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/kubecost-vs-opencost-vs-alternatives/">Kubecost vs OpenCost vs alternatives&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-hour-to-cost-per-token-on-prem-vs-cloud/">From GPU-hour to cost per token&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/finops-multi-tenancy-gpu-cluster-who-pays/">FinOps and GPU cluster multi-tenancy: who pays for what&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/sharing-one-gpu-time-slicing-mps-mig/">Sharing a GPU: time-slicing, MPS and MIG&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>From GPU-hour to cost per token: the metric that compares on-prem and cloud</title><link>https://blog.lo0.es/en/posts/gpu-hour-to-cost-per-token-on-prem-vs-cloud/</link><pubDate>Sun, 14 Jun 2026 03:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/gpu-hour-to-cost-per-token-on-prem-vs-cloud/</guid><description>&lt;blockquote>
&lt;p>Notation: amounts in &lt;strong>euros (N €)&lt;/strong>, decimals with a point. The dollar sign is not used
(on this site it is a formula delimiter).&lt;/p>
&lt;/blockquote>
&lt;h2 id="what-this-article-covers">What this article covers&lt;/h2>
&lt;p>Fourth article in the FinOps track (A4), and the one that closes out the metric that gives
the whole pillar its meaning: &lt;strong>cost per token&lt;/strong>. In A2 we saw how OpenCost assigns the cost of
the iron (the pod, in €/hour); in A3, which tool to use. But the cost of the pod is not the
metric that compares on-prem with cloud, nor the one the business understands: that one is
&lt;strong>cost per token&lt;/strong> (or per request). This article explains how it is really calculated (spoiler:
for your own inference it &lt;strong>is not a list price, it is €/GPU-hour divided by throughput&lt;/strong>), how
to instrument it with a gateway (LiteLLM), how to attribute it by team and product, and how
to compare it against European cloud. No recommendations; only the mechanics and the numbers.&lt;/p>
&lt;hr>
&lt;h2 id="the-identity-from-gpu-hour-to-token">The identity: from GPU-hour to token&lt;/h2>
&lt;p>Cost per million tokens (CPM) is the cost of the iron divided by what it produces:&lt;/p>
$$\text{cost per token} = \frac{\text{cost of the iron (€/h)}}{\text{throughput (tok/s)} \times 3600 / 10^6}$$
&lt;p>This is the central formula of the FinOps track, and it has a consequence many people never quite
internalise: for a self-hosted model, the cost of a token &lt;strong>does not exist as a fixed
price&lt;/strong>. It depends on two things that change: the cost of the iron (from OpenCost, in
€/hour) and the throughput (from your benchmark, in tok/s). The same model on the same node
costs half as much per token if you double the throughput with an optimisation, because the
denominator changes, not the numerator. The cost per token of your own inference is &lt;strong>a function
of your efficiency&lt;/strong>, not a tariff.&lt;/p>
&lt;p>That sets it radically apart from an external API, where the price per token really is a
fixed tariff the provider charges you. Comparing the two requires turning your variable cost
into a number, and that is where the iron (A2) meets the tokens (this article).&lt;/p>
&lt;hr>
&lt;h2 id="the-two-halves-of-cost-per-token">The two halves of cost per token&lt;/h2>
&lt;p>Cost per token comes from joining two measurements that live in different places:&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 220" role="img" aria-label="The two halves of cost per token: the cost of the iron from OpenCost and the token count from the gateway, which divided give the cost per token" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#tm)}&lt;/style>
&lt;defs>&lt;marker id="tm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="20" y="40" width="220" height="56" rx="6"/>
&lt;text x="32" y="62" class="tl">Cost of the iron (OpenCost)&lt;/text>
&lt;text x="32" y="80" class="ts">€/hour of the vLLM pod (by usage)&lt;/text>
&lt;rect class="bx" x="20" y="120" width="220" height="56" rx="6"/>
&lt;text x="32" y="142" class="tl">Tokens (LiteLLM gateway)&lt;/text>
&lt;text x="32" y="160" class="ts">tokens/s per model and team&lt;/text>
&lt;path class="ar" d="M240,68 L300,100"/>
&lt;path class="ar" d="M240,148 L300,116"/>
&lt;rect class="bx" x="300" y="84" width="200" height="48" rx="6"/>
&lt;text x="312" y="106" class="tl">÷ → cost per token&lt;/text>
&lt;text x="312" y="122" class="ts">€/1M tok per team&lt;/text>
&lt;path class="ar" d="M500,108 L560,108"/>
&lt;rect class="dsh" x="560" y="84" width="200" height="48" rx="6"/>
&lt;text x="572" y="106" class="tl">compare / chargeback&lt;/text>
&lt;text x="572" y="122" class="ts">on-prem vs cloud · per team&lt;/text>
&lt;text x="20" y="205" class="ts">Without the iron (OpenCost) you would know the tokens but not their cost; without the gateway, the cost of the pod but not the tokens. You need both.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;p>The iron half comes from OpenCost (article A2): the by-usage cost of the vLLM pod, in
€/hour. The token half comes from the gateway, which intercepts every request and counts
tokens per model and per team. Divide, and out comes the cost per token and, crucially, &lt;strong>per
team&lt;/strong>, which is what enables chargeback.&lt;/p>
&lt;hr>
&lt;h2 id="the-gateway-litellm-in-depth">The gateway: LiteLLM in depth&lt;/h2>
&lt;p>The gateway sits between the application and the engine (vLLM) or the provider, and intercepts
every request. LiteLLM is the OSS reference: it proxies over 100 models and &lt;strong>tracks spend
by keys, users and teams&lt;/strong>, logging spend for all known models automatically
(&lt;a href="https://docs.litellm.ai/docs/proxy/cost_tracking">LiteLLM · Spend Tracking&lt;/a>).&lt;/p>
&lt;p>Its key mechanisms:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Mechanism&lt;/th>
&lt;th>What it does&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>response_cost&lt;/code>&lt;/td>
&lt;td>the cost of each response, available in logging (&lt;code>kwargs[&amp;quot;response_cost&amp;quot;]&lt;/code>)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Spend logs&lt;/strong>&lt;/td>
&lt;td>one row per request with tokens, model, user, key and cost (SQLite/PostgreSQL)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Tags&lt;/strong>&lt;/td>
&lt;td>tag each request by team, project, environment and model &lt;em>tier&lt;/em>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Budgets&lt;/strong>&lt;/td>
&lt;td>budgets and rate limits per team or user&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Custom callbacks&lt;/strong>&lt;/td>
&lt;td>bespoke loggers for key/user/model/tokens/cost&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>With the spend logs table (via the database adapter) you have the detail of every request to
build cost dashboards (&lt;a href="https://docs.litellm.ai/docs/proxy/logging">LiteLLM · Logging&lt;/a>), and you
can tag each request with team/project/environment for per-team analysis, with notifications
(Slack) and hard caps for keys that must not exceed a limit. In practice it is the platform&amp;rsquo;s
token meter and cost allocator.&lt;/p>
&lt;hr>
&lt;h2 id="the-self-hosted-trap-litellm-does-not-know-what-your-own-token-costs-you">The self-hosted trap: LiteLLM does not know what your own token costs you&lt;/h2>
&lt;p>Here is the point almost nobody wires up correctly. LiteLLM tracks cost using list prices
for known models (the API ones: OpenAI, Anthropic and so on). But for a model self-hosted on
your vLLM there &lt;strong>is no list price&lt;/strong>, because you pay nobody per token. If you tell it
nothing, LiteLLM does not know the real cost of your own token. The solution is custom
pricing: declaring to LiteLLM the cost per token of your self-hosted model
(&lt;a href="https://docs.litellm.ai/docs/proxy/custom_pricing">LiteLLM · Custom Pricing&lt;/a>).&lt;/p>
&lt;p>And where does that number come from? From the identity above: the cost of the iron
(OpenCost) divided by the throughput (your benchmark). That is, the correct flow is:&lt;/p>
&lt;ol>
&lt;li>OpenCost gives you the cost of the vLLM pod: ~11 €/hour (A2).&lt;/li>
&lt;li>Your benchmark gives you the throughput: ~2,800 tok/s (track B).&lt;/li>
&lt;li>The identity gives the cost per token: 11 ÷ (2,800 × 3,600 / 10⁶) ≈ &lt;strong>1.09 €/1M tok&lt;/strong>.&lt;/li>
&lt;li>That 1.09 €/1M goes into LiteLLM as custom pricing.&lt;/li>
&lt;/ol>
&lt;p>Only then does the &lt;code>response_cost&lt;/code> of each request reflect the real cost of your inference,
rather than a zero or somebody else&amp;rsquo;s list price. Without this step, your LiteLLM cost dashboards
lie about your own models. It is the explicit junction of the three tracks: iron (FinOps),
throughput (benchmarking) and measurement (gateway).&lt;/p>
&lt;hr>
&lt;h3 id="configuring-custom-pricing-an-example">Configuring custom pricing: an example&lt;/h3>
&lt;p>In LiteLLM, the real cost of a self-hosted model is declared in its configuration. An example
with the cost per token derived from the identity (1.09 €/1M ÷ 10⁶ = 0.00000109 €/token):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># LiteLLM config.yaml — real cost of a self-hosted model&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">model_list&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>- &lt;span class="nt">model_name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">llama-3.1-70b-onprem&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">litellm_params&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">model&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">openai/llama-3.1-70b &lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># your vLLM endpoint&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">api_base&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">http://vllm:8000/v1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">input_cost_per_token&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.00000109&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/token (from OpenCost ÷ throughput)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">output_cost_per_token&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="m">0.00000109&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># refine if you separate prefill/decode&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>With that, every &lt;code>response_cost&lt;/code> LiteLLM records reflects the real cost of your iron. The
operational note: this number must be updated when the cost of the node changes (new
depreciation, a different energy price) or the throughput does (an engine optimisation). It is
not a constant; it is the output of OpenCost and of the benchmark, and it is recalculated
whenever either of the two changes. Automating that recalculation, from node cost and measured
throughput to custom pricing, is what keeps cost dashboards honest.&lt;/p>
&lt;hr>
&lt;h2 id="cost-per-token-changes-with-throughput-read-it-off-the-sweep">Cost per token changes with throughput: read it off the sweep&lt;/h2>
&lt;p>Because throughput is the denominator, cost per token is not a point, it is a curve over the
concurrency sweep. On the ~11 €/hour node:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Concurrency&lt;/th>
&lt;th>Throughput (tok/s)&lt;/th>
&lt;th>Cost per 1M tokens&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>350&lt;/td>
&lt;td>&lt;strong>~8.73 €&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>8&lt;/td>
&lt;td>2,100&lt;/td>
&lt;td>&lt;strong>~1.46 €&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>16&lt;/td>
&lt;td>3,330 (goodput)&lt;/td>
&lt;td>&lt;strong>~0.92 €&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>24&lt;/td>
&lt;td>3,900 raw / 2,420 goodput&lt;/td>
&lt;td>~0.78 € raw / &lt;strong>~1.26 € on goodput&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Important readings: at low concurrency the cost per token is sky-high (the fixed cost of the
node is shared among few tokens); cost falls as occupancy rises. But watch the last row: if you
compute cost on raw throughput (3,900) you get 0.78 €, whereas if you compute it on
goodput (2,420, the part that meets the SLO) you get 1.26 €, and the latter is the real
cost, because requests that violate the SLO do not count as useful production. An honest cost
per token is computed on &lt;strong>goodput&lt;/strong>, not on catalogue throughput. This is where the cost track
meets the benchmarking one: the correct denominator is goodput.&lt;/p>
&lt;hr>
&lt;h2 id="cost-per-request-not-only-per-token">Cost per request: not only per token&lt;/h2>
&lt;p>Cost per token is the unit; cost per request is what a complete request bills. A request
consumes &lt;strong>input tokens (prompt) plus output tokens (generation)&lt;/strong>, and both count:&lt;/p>
$$\text{cost per request} = (\text{input tokens} + \text{output tokens}) \times \text{cost per token}$$
&lt;p>With nuances: in many engines the prefill (input) and the decode (output) have different
costs per token (decode is memory-bound and more expensive per token), so a fine-grained cost
model distinguishes the two. For most cases a weighted average cost per token will do; to
optimise, it pays to separate prefill and decode. LiteLLM records input and output tokens
separately in its spend logs, so the data is there to refine with.&lt;/p>
&lt;p>Cost per request is what connects to the product: if a feature consumes 1,500 tokens on
average (1,200 of prompt plus 300 of output) and the cost is 1.09 €/1M, each use costs
~0.0016 €, the basis for setting margin, as seen in the FinOps introduction.&lt;/p>
&lt;hr>
&lt;h2 id="cost-per-model-and-per-tier">Cost per model and per tier&lt;/h2>
&lt;p>A platform does not serve a single model. Cost per token varies by model and by
configuration, and the gateway tells them apart. An 8B and a 70B on the same node have very
different costs per token: the 8B yields far more throughput (more tokens/s) for the same
GPU-hour, so its cost per token is a fraction of the 70B&amp;rsquo;s. The design consequence: routing
each request to the cheapest model that meets the quality bar is a direct cost lever, since
serving a 70B where an 8B suffices means overpaying per token.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Model (example, same node)&lt;/th>
&lt;th>Relative throughput&lt;/th>
&lt;th>Relative cost per token&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>8B&lt;/td>
&lt;td>high&lt;/td>
&lt;td>low&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>70B FP8&lt;/td>
&lt;td>medium&lt;/td>
&lt;td>medium&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>70B FP16&lt;/td>
&lt;td>low&lt;/td>
&lt;td>high&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The gateway, with its per-model custom pricing, makes this difference visible and enables
&lt;strong>cost-based routing&lt;/strong>: classify the request and send it to the appropriate &lt;em>tier&lt;/em>. It connects
with the L7 router of the serving track: the gateway not only measures cost, it can decide
on the basis of it. And quantisation (FP16→FP8) shows up again as a lever: the same model in FP8
raises throughput and lowers cost per token, moving the figure without changing model.&lt;/p>
&lt;hr>
&lt;h2 id="attribution-from-cost-to-team-and-product">Attribution: from cost to team and product&lt;/h2>
&lt;p>The reason for putting a gateway in place is not only to measure total cost, it is to share it
out. By tagging each request with team, product and environment, LiteLLM builds the split by
business dimension:&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 200" role="img" aria-label="Cost per token attribution: the gateway tags each request by team and product, aggregates spend and produces chargeback with budgets and caps" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#am)}&lt;/style>
&lt;defs>&lt;marker id="am" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="20" y="50" width="150" height="44" rx="6"/>&lt;text x="32" y="70" class="tl">request + tags&lt;/text>&lt;text x="32" y="86" class="ts">team · product&lt;/text>
&lt;path class="ar" d="M170,72 L215,72"/>
&lt;rect class="bx" x="215" y="50" width="160" height="44" rx="6"/>&lt;text x="227" y="70" class="tl">spend logs&lt;/text>&lt;text x="227" y="86" class="ts">tokens · cost · key&lt;/text>
&lt;path class="ar" d="M375,72 L420,72"/>
&lt;rect class="bx" x="420" y="50" width="160" height="44" rx="6"/>&lt;text x="432" y="70" class="tl">aggregation&lt;/text>&lt;text x="432" y="86" class="ts">€/team · €/product&lt;/text>
&lt;path class="ar" d="M580,72 L625,72"/>
&lt;rect class="bx" x="625" y="50" width="135" height="44" rx="6"/>&lt;text x="637" y="70" class="tl">chargeback&lt;/text>&lt;text x="637" y="86" class="ts">+ budgets&lt;/text>
&lt;text x="20" y="135" class="ts">Hard caps per key and budget alerts (Slack) close the loop: measure → attribute → govern.&lt;/text>
&lt;text x="20" y="160" class="ts">This is the token side of chargeback; the iron side comes from OpenCost. Together: cost per token per team.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;p>With per-team budgets and &lt;strong>hard caps&lt;/strong> per key, the gateway does not only report: it
governs. A team that goes over budget gets an alert; a key with a hard cap cannot spend any
more. It is the FinOps &lt;em>Operate&lt;/em> phase applied to the token.&lt;/p>
&lt;h3 id="a-combined-report-example">A combined report example&lt;/h3>
&lt;p>Joining the iron (OpenCost) and the tokens (gateway), the monthly cost-per-token-per-team report
on the example node:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Team&lt;/th>
&lt;th>Tokens/month&lt;/th>
&lt;th>Applied cost per token&lt;/th>
&lt;th>Charged cost&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>A · chat-prod&lt;/td>
&lt;td>240M&lt;/td>
&lt;td>1.09 €/1M (70B FP8)&lt;/td>
&lt;td>~262 €&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>B · batch&lt;/td>
&lt;td>90M&lt;/td>
&lt;td>0.40 €/1M (8B)&lt;/td>
&lt;td>~36 €&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>C · experimentation&lt;/td>
&lt;td>15M&lt;/td>
&lt;td>1.09 €/1M (70B)&lt;/td>
&lt;td>~16 € + idle&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>What it reveals: A consumes a lot but at an efficient cost (FP8, high utilisation); B uses a
cheap model (8B) for its workload; C consumes little but, as we saw in A2, drags along the idle
cost of its underused GPU. The token report plus the OpenCost iron report give the full
picture: who spends, on which model, with what efficiency. It is the chargeback that neither
half would produce alone. And the per-team figure is what gets taken into the budget
conversation: not &amp;ldquo;the cluster costs X&amp;rdquo;, but &amp;ldquo;your team consumed Y million tokens at Z €/million&amp;rdquo;.&lt;/p>
&lt;hr>
&lt;h2 id="governing-spend-budgets-caps-and-alerts">Governing spend: budgets, caps and alerts&lt;/h2>
&lt;p>Measuring without governing is a dashboard; the value lies in closing the loop. LiteLLM allows
three levels of control over spend:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Control&lt;/th>
&lt;th>What it does&lt;/th>
&lt;th>When&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Soft budget&lt;/strong>&lt;/td>
&lt;td>alert (Slack) when a threshold is crossed&lt;/td>
&lt;td>tracking teams&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Rate limit&lt;/strong>&lt;/td>
&lt;td>limits requests/tokens per minute&lt;/td>
&lt;td>avoiding cost spikes&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Hard cap&lt;/strong>&lt;/td>
&lt;td>the key cannot spend any more&lt;/td>
&lt;td>keys that must never overrun&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The healthy pattern: soft budgets with alerts for the teams (so they adjust their consumption),
rate limits to smooth spikes, and hard caps only on critical keys (a service that must not run
away). With this, cost per token stops being an after-the-fact figure and becomes a real-time
control: the FinOps &lt;em>Operate&lt;/em> phase, applied to inference.&lt;/p>
&lt;hr>
&lt;h2 id="on-prem-vs-european-cloud-comparison-the-reason-for-all-of-it">On-prem vs European cloud comparison (the reason for all of it)&lt;/h2>
&lt;p>Cost per token exists to answer one question: is it cheaper to serve on my own iron or to
rent? With the identity and European figures:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Option&lt;/th>
&lt;th>Cost per 1M tokens&lt;/th>
&lt;th>Notes&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Depreciated on-prem (8×H100, 2,800 tok/s)&lt;/td>
&lt;td>&lt;strong>~1.09 €&lt;/strong>&lt;/td>
&lt;td>your iron, your sovereignty&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>European cloud Scaleway (8×H100, on-demand)&lt;/td>
&lt;td>&lt;strong>~2.17 €&lt;/strong>&lt;/td>
&lt;td>EU, no iron to operate&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>External API (proprietary model)&lt;/td>
&lt;td>provider tariff&lt;/td>
&lt;td>no data sovereignty&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Cost per token is what makes the incomparable comparable: your variable cost (iron ÷
throughput) against a provider&amp;rsquo;s fixed tariff. And it exposes the lever: if an optimisation
raises your throughput from 2,800 to 4,200 tok/s, your on-prem cost drops to ~0.73 €/1M,
widening the advantage over renting. That is why benchmarking (track B) is, indirectly, the tool
that moves cost per token the most: every goodput improvement translates into this number.&lt;/p>
&lt;hr>
&lt;h2 id="from-cost-per-token-to-product-price">From cost per token to product price&lt;/h2>
&lt;p>Cost per token closes the loop with the business when it becomes cost per unit of product.
The chain: cost per token (from the identity) × tokens per use of a feature = marginal cost of
that feature. With that, three business decisions become data-backed:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Setting a price.&lt;/strong> If serving a feature costs 0.0016 € per use, the price to the customer
has to cover it with margin; cost per token is the floor of &lt;em>pricing&lt;/em>.&lt;/li>
&lt;li>&lt;strong>Spotting loss-making features.&lt;/strong> A feature that consumes many tokens (long prompts, lots of
output) may cost more than it contributes; cost per request reveals it before you scale.&lt;/li>
&lt;li>&lt;strong>Comparing build vs buy at product level.&lt;/strong> On-prem cost per token against an API tariff,
for that specific workload, decides whether to serve in house or consume externally.&lt;/li>
&lt;/ol>
&lt;p>This is the ultimate reason for the whole FinOps track: it is not infrastructure accounting, it
is the quantitative basis for product and architecture decisions. A measured and attributed cost
per token turns &amp;ldquo;is this profitable?&amp;rdquo; from an intuition into a calculation.&lt;/p>
&lt;hr>
&lt;h2 id="detailed-comparison-on-prem-european-cloud-and-api">Detailed comparison: on-prem, European cloud and API&lt;/h2>
&lt;p>Extending the comparison with scenarios, for the same job (1M tokens):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Option&lt;/th>
&lt;th>Cost/1M tok&lt;/th>
&lt;th>Sovereignty&lt;/th>
&lt;th>Where it fits&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Depreciated on-prem, high utilisation&lt;/td>
&lt;td>&lt;strong>~0.7–1.1 €&lt;/strong>&lt;/td>
&lt;td>full (EU)&lt;/td>
&lt;td>high, sustained volume&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Depreciated on-prem, low utilisation&lt;/td>
&lt;td>&lt;strong>~2–4 €&lt;/strong>&lt;/td>
&lt;td>full (EU)&lt;/td>
&lt;td>bad: idle drives cost up&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>European cloud (Scaleway, on-demand)&lt;/td>
&lt;td>&lt;strong>~2.2 €&lt;/strong>&lt;/td>
&lt;td>EU&lt;/td>
&lt;td>variable volume, no iron to operate&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>European cloud (reserved/committed)&lt;/td>
&lt;td>&lt;strong>~1.5–1.8 €&lt;/strong>&lt;/td>
&lt;td>EU&lt;/td>
&lt;td>medium committed volume&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>External proprietary API&lt;/td>
&lt;td>provider tariff&lt;/td>
&lt;td>&lt;strong>non-EU&lt;/strong>&lt;/td>
&lt;td>prototype / no sovereignty requirement&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The table shows two things. First, &lt;strong>on-prem only wins if utilisation is high&lt;/strong>, since at low
occupancy idle makes it dearer than cloud, which connects cost per token with scheduling and
utilisation (the idle of A2). Second, the &lt;strong>external API&lt;/strong>, however competitive its tariff,
&lt;strong>loses data sovereignty&lt;/strong>, an axis that for GDPR data is not negotiable. Cost per token is the
metric that puts the first three on the same scale; sovereignty is the constraint that rules out
the last one for certain kinds of data.&lt;/p>
&lt;hr>
&lt;h2 id="prompt-caching-and-effective-cost">Prompt caching and effective cost&lt;/h2>
&lt;p>One nuance refines the real cost per token: &lt;strong>prefix caching&lt;/strong>. When many requests share the
same prefix (a long system prompt, a repeated context), the engine caches its prefill compute
and &lt;strong>does not recompute it&lt;/strong> on every request. That means cached input tokens &lt;strong>cost almost
zero&lt;/strong> the second time and thereafter, so the effective cost per token of a workload with a high
cache &lt;em>hit rate&lt;/em> is &lt;strong>lower&lt;/strong> than the nominal cost. External APIs already reflect this with a
reduced price for cached tokens; in self-hosted the effect is that throughput rises (less
prefill to recompute), which by the identity lowers cost per token.&lt;/p>
&lt;p>The implication for the cost model: if your workload has shared prefixes (RAG over the same
corpus, agents with the same system prompt), the real cost per token is &lt;strong>lower&lt;/strong> than the naive
calculation gives, and it pays to measure the prefix caching &lt;em>hit rate&lt;/em> so as not to overestimate
cost. And the reverse: a workload of unique, never-repeated prompts gains nothing from the cache,
and its cost per token is the full nominal figure. Cost per token, once again, is not a constant:
it depends on the model, the precision, the utilisation, the goodput &lt;strong>and&lt;/strong> the reuse pattern of
the workload. Measuring it on your real traffic, not on a synthetic benchmark without a cache, is
what gives the number you actually pay.&lt;/p>
&lt;hr>
&lt;h2 id="state-of-the-art-2026">State of the art 2026&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>The gateway as standard&lt;/strong>: LiteLLM (and alternatives) are consolidating as the layer that
measures tokens, attributes cost and governs budgets in the LLM stack.&lt;/li>
&lt;li>&lt;strong>FOCUS for tokens&lt;/strong>: layers on top of the gateway generate FOCUS-compatible logs, integrating
AI cost with the rest of cloud spend (FinOps introduction).&lt;/li>
&lt;li>&lt;strong>Custom pricing as a bridge&lt;/strong>: the OpenCost→gateway connection via custom pricing is the
standard way to give self-hosted models a real cost.&lt;/li>
&lt;li>&lt;strong>Cost per token as a business KPI&lt;/strong>: increasingly, cost per token (and per product) is the
metric the business demands, not the cost of the pod.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="limits-and-traps-data-driven">Limits and traps (data-driven)&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>Forgotten custom pricing.&lt;/strong> Without declaring to LiteLLM the real cost of your self-hosted
token, the &lt;code>response_cost&lt;/code> of your own models is zero or someone else&amp;rsquo;s price. Close the
OpenCost→gateway bridge.&lt;/li>
&lt;li>&lt;strong>Static throughput.&lt;/strong> Cost per token changes with throughput; if you optimise the engine but
do not update the custom pricing, the reported cost drifts out of date.&lt;/li>
&lt;li>&lt;strong>Forgetting prefill/decode.&lt;/strong> An average cost per token is fine for reporting; to optimise,
separate input and output.&lt;/li>
&lt;li>&lt;strong>Measuring without governing.&lt;/strong> Spend logs without budgets or caps make a pretty dashboard;
the value lies in closing the loop with alerts and caps.&lt;/li>
&lt;li>&lt;strong>Comparing tariffs with costs without matching assumptions.&lt;/strong> Your 1.09 €/1M assumes a
utilisation and a throughput; the provider&amp;rsquo;s tariff does not. Fix the assumptions before
comparing.&lt;/li>
&lt;/ol>
&lt;p>With cost per token solved, the FinOps track has its central metric; the following articles (A5
multi-tenant chargeback, A8 TCO model) build on it. The full chain, iron (OpenCost) ÷ throughput
(benchmark) = cost per token, measured and attributed by the gateway, is what turns the cost of
AI into a defensible number, in euros and per team.&lt;/p>
&lt;h2 id="closing">Closing&lt;/h2>
&lt;p>Cost per token is the metric that reconciles the three tracks of the series into a single
number, and its underlying lesson is counter-intuitive: for your own inference, &lt;strong>the cost of a
token is not a price, it is the reflection of your efficiency&lt;/strong>. It comes from dividing the cost
of the iron (OpenCost) by useful throughput (the goodput of your benchmark), and it becomes
visible and governable with a gateway (LiteLLM) that counts the tokens, attributes them by team
and applies budgets. The mistake that invalidates the whole exercise is leaving custom pricing at
zero and believing your own inference is &amp;ldquo;free&amp;rdquo;; the right move is to close the OpenCost→gateway
bridge and keep the number up to date when the node cost or the throughput changes. Done that
way, cost per token answers with data the one question the business keeps repeating, is it worth
serving this on my own iron, and it does so in euros, per team and per product, comparable
against European cloud and against any API. For a sovereign architecture proposal, it is the
column of the dashboard that translates all the cost engineering into the sentence that closes a
budget meeting: &lt;strong>this is the cost per token, this is how it is measured, and here is the bench
to reproduce it&lt;/strong>.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-chargeback-showback-multi-tenancy/">GPU chargeback and showback&lt;/a> — sharing cost out per team (OpenCost + LiteLLM + Kueue) once you have the cost per token.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-idle-cost-not-on-any-invoice/">GPU utilisation as a FinOps lever&lt;/a> — why cost per token depends on occupancy: the cost of idle.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/cloud-gpu-on-demand-reserved-spot-neoclouds-2026-prices/">Cloud GPU: a comparison of prices, commitment and sovereign neoclouds&lt;/a> — the alternative €/GPU-hour: on-demand, spot and reserved prices from European cloud providers against on-premise.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/full-tco-on-premise-gpu-cluster-capex-gpu-hour-break-even/">TCO of an on-premise GPU cluster: depreciation, energy and infrastructure&lt;/a> — the reference €/GPU-hour in your own infrastructure: CAPEX, energy, networking and staff with the full spreadsheet.&lt;/li>
&lt;/ul>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>LiteLLM · Spend Tracking — &lt;a href="https://docs.litellm.ai/docs/proxy/cost_tracking">https://docs.litellm.ai/docs/proxy/cost_tracking&lt;/a>&lt;/li>
&lt;li>LiteLLM · Custom Pricing (modelos self-hosted) — &lt;a href="https://docs.litellm.ai/docs/proxy/custom_pricing">https://docs.litellm.ai/docs/proxy/custom_pricing&lt;/a>&lt;/li>
&lt;li>LiteLLM · Logging — &lt;a href="https://docs.litellm.ai/docs/proxy/logging">https://docs.litellm.ai/docs/proxy/logging&lt;/a>&lt;/li>
&lt;li>LiteLLM · documentación general — &lt;a href="https://docs.litellm.ai/docs/">https://docs.litellm.ai/docs/&lt;/a>&lt;/li>
&lt;li>Statsig · LiteLLM cost tracking — &lt;a href="https://www.statsig.com/perspectives/litellm-cost-tracking">https://www.statsig.com/perspectives/litellm-cost-tracking&lt;/a>&lt;/li>
&lt;li>StackPulsar · LiteLLM production monitoring (2026) — &lt;a href="https://stackpulsar.com/blog/litellm-production-monitoring/">https://stackpulsar.com/blog/litellm-production-monitoring/&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Kubecost vs OpenCost vs the alternatives: what the commercial layer adds and when it is worth paying for</title><link>https://blog.lo0.es/en/posts/kubecost-vs-opencost-vs-alternatives/</link><pubDate>Sun, 14 Jun 2026 02:30:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/kubecost-vs-opencost-vs-alternatives/</guid><description>&lt;blockquote>
&lt;p>Notation: amounts in &lt;strong>euros (N €)&lt;/strong>, decimals with a point; when a source quotes dollars it is
marked &amp;ldquo;USD&amp;rdquo;. The dollar sign is not used (on this site it is a formula delimiter).&lt;/p>
&lt;/blockquote>
&lt;h2 id="what-this-article-covers">What this article covers&lt;/h2>
&lt;p>Third article in the &lt;strong>FinOps&lt;/strong> track (A3). A2 covered how OpenCost allocates cost, the free
base. This article answers the question that comes next: &lt;strong>is it worth paying for Kubecost or a
commercial alternative, or is OpenCost enough?&lt;/strong> It is a &lt;strong>build-vs-buy&lt;/strong> decision, operating the
open source tool yourself against buying a product, and the answer depends on your scale, your
audience and your appetite for operating infrastructure. No universal recommendations: here are the
facts (what each one adds, what it costs, when it fits) and, for a European platform, the nuance of
&lt;strong>cost data sovereignty&lt;/strong> that the American comparisons do not mention.&lt;/p>
&lt;hr>
&lt;h2 id="the-axis-of-the-decision-build-vs-buy">The axis of the decision: build vs buy&lt;/h2>
&lt;p>OpenCost is free (Apache 2.0), but &amp;ldquo;free&amp;rdquo; means operating it yourself: deploying it,
configuring the node price, keeping Prometheus with enough retention, building the Grafana panels
and the alerts. Kubecost (and the alternatives) charge for taking that work away and adding
capabilities OpenCost does not ship. The decision, therefore, is not &amp;ldquo;free vs expensive&amp;rdquo;: it is
your own operating cost vs a licence.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Axis&lt;/th>
&lt;th>Leans towards OpenCost&lt;/th>
&lt;th>Leans towards commercial&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Platform team&lt;/td>
&lt;td>you have someone to operate it&lt;/td>
&lt;td>you do not want to operate anything&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Scale (cloud/GPU spend)&lt;/td>
&lt;td>small to medium&lt;/td>
&lt;td>large (the saving pays the licence)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Report audience&lt;/td>
&lt;td>engineers&lt;/td>
&lt;td>finance / management&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Number of clusters&lt;/td>
&lt;td>one&lt;/td>
&lt;td>many (multi-cluster)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Need for automatic optimisation&lt;/td>
&lt;td>you do it by hand&lt;/td>
&lt;td>you want it out of the box&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>OpenCost is the open source core; Kubecost is the enterprise product built on that core,
with proprietary features added; Kubecost was the original developer of the engine before releasing
it, and IBM acquired the company (&lt;a href="https://www.cloudzero.com/blog/kubecost-vs-opencost/">CloudZero · Kubecost vs OpenCost&lt;/a>).
In other words: both share the same allocation engine; what you pay for is the layer on top.&lt;/p>
&lt;hr>
&lt;h2 id="what-kubecost-adds-on-top-of-opencost">What Kubecost adds on top of OpenCost&lt;/h2>
&lt;p>On top of allocation (which is common to both), Kubecost adds a layer of &lt;strong>optimisation, governance
and enterprise features&lt;/strong> (&lt;a href="https://www.cloudzero.com/blog/kubecost-vs-opencost/">CloudZero&lt;/a>, &lt;a href="https://www.finout.io/blog/kubecost-vs-opencost">Finout&lt;/a>):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Capability&lt;/th>
&lt;th>OpenCost&lt;/th>
&lt;th>Kubecost&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Cost allocation (CPU/GPU/mem/PV)&lt;/td>
&lt;td>✓&lt;/td>
&lt;td>✓ (same engine)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>GPU via DCGM&lt;/td>
&lt;td>✓&lt;/td>
&lt;td>✓ (3.0)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Invoice reconciliation&lt;/strong> (discounts, RI, spot)&lt;/td>
&lt;td>—&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Rightsizing&lt;/strong> (recommendations)&lt;/td>
&lt;td>—&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Anomaly detection&lt;/strong>&lt;/td>
&lt;td>—&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Budget alerts&lt;/strong>&lt;/td>
&lt;td>manual&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>RBAC&lt;/strong>&lt;/td>
&lt;td>—&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Multi-cluster aggregation&lt;/strong>&lt;/td>
&lt;td>—&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Hosted&lt;/strong> option (SaaS)&lt;/td>
&lt;td>—&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Long historical retention&lt;/td>
&lt;td>your Prometheus&lt;/td>
&lt;td>included&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Support&lt;/td>
&lt;td>community&lt;/td>
&lt;td>commercial (IBM)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 250" role="img" aria-label="OpenCost as the allocation core and Kubecost as commercial layers on top: reconciliation, rightsizing, anomalies, governance and support" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}&lt;/style>
&lt;rect class="bx" x="180" y="180" width="420" height="48" rx="6"/>
&lt;text x="390" y="200" text-anchor="middle" class="tl">OpenCost — allocation engine (Apache 2.0)&lt;/text>
&lt;text x="390" y="217" text-anchor="middle" class="ts">node price · split by usage · Allocation API&lt;/text>
&lt;rect class="dsh" x="180" y="40" width="420" height="124" rx="6"/>
&lt;text x="390" y="60" text-anchor="middle" class="tl">Kubecost (IBM) — commercial layer&lt;/text>
&lt;rect class="bx" x="200" y="74" width="180" height="34" rx="5"/>&lt;text x="290" y="95" text-anchor="middle" class="ts">invoice reconciliation&lt;/text>
&lt;rect class="bx" x="400" y="74" width="180" height="34" rx="5"/>&lt;text x="490" y="95" text-anchor="middle" class="ts">rightsizing + anomalies&lt;/text>
&lt;rect class="bx" x="200" y="116" width="180" height="34" rx="5"/>&lt;text x="290" y="137" text-anchor="middle" class="ts">RBAC · budgets&lt;/text>
&lt;rect class="bx" x="400" y="116" width="180" height="34" rx="5"/>&lt;text x="490" y="137" text-anchor="middle" class="ts">multi-cluster · support&lt;/text>
&lt;text x="390" y="246" text-anchor="middle" class="ts">Same engine underneath; what you pay for is the optimisation, governance and enterprise layer on top.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;h3 id="invoice-reconciliation">Invoice reconciliation&lt;/h3>
&lt;p>The capability that most justifies the price in cloud: OpenCost allocates on list rates;
Kubecost reconciles against the real invoice, which includes discounts, reserved instances and
spot prices (&lt;a href="https://www.finout.io/blog/kubecost-vs-opencost">Finout&lt;/a>). The difference can be
large: a cost allocated at list rates can be 30–50 % above what you actually pay after discounts.
On-prem this matters less (you declare the node&amp;rsquo;s real price), but in cloud or hybrid,
reconciliation is the difference between a &amp;ldquo;theoretical&amp;rdquo; cost and the cost that shows up on the
invoice.&lt;/p>
&lt;h3 id="rightsizing-and-anomaly-detection">Rightsizing and anomaly detection&lt;/h3>
&lt;p>Kubecost recommends resizing (rightsizing) underused resources, via the integration with IBM
Turbonomic, and detects spend anomalies automatically. OpenCost gives you the data to do it
by hand; Kubecost automates it. For a GPU fleet, rightsizing and anomalous idle detection are
exactly where the saving of the &lt;em>Optimize&lt;/em> phase lives.&lt;/p>
&lt;hr>
&lt;h2 id="the-price-of-kubecost-and-the-build-vs-buy-economics">The price of Kubecost (and the build-vs-buy economics)&lt;/h2>
&lt;p>Kubecost&amp;rsquo;s price starts at 449 USD/month for &lt;em>business&lt;/em> use, with enterprise options on request
(&lt;a href="https://www.cloudzero.com/blog/kubecost-vs-opencost/">source&lt;/a>). The right question is not &amp;ldquo;is 449
USD expensive?&amp;rdquo;, but &amp;ldquo;does operating OpenCost myself cost more or less than that?&amp;rdquo;. The
build-vs-buy calculation:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Cost&lt;/th>
&lt;th>OpenCost (build)&lt;/th>
&lt;th>Kubecost (buy)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Licence&lt;/td>
&lt;td>0&lt;/td>
&lt;td>from ~449 USD/month (business)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Engineering time&lt;/td>
&lt;td>deployment + maintenance + panels&lt;/td>
&lt;td>minimal&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Historical retention&lt;/td>
&lt;td>your Prometheus/Thanos cost&lt;/td>
&lt;td>included&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Support&lt;/td>
&lt;td>your team&lt;/td>
&lt;td>included&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>If one platform person spends a few hours a month operating OpenCost, that time can already exceed
449 USD; if your cluster is small and the operating cost is nearly nil (you set it up once and it
runs), OpenCost wins. The market rule of thumb: if &lt;strong>monthly Kubernetes spend is below ~10,000
USD&lt;/strong>, the cloud-native tools or open source (OpenCost) usually suffice; above that, the saving the
commercial tool captures pays for its licence ([search]).&lt;/p>
&lt;hr>
&lt;h3 id="worked-example-build-vs-buy">Worked example: build vs buy&lt;/h3>
&lt;p>An illustrative calculation for a platform with a medium-sized GPU cluster:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Item&lt;/th>
&lt;th>OpenCost (build)&lt;/th>
&lt;th>Kubecost (buy)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Annual licence&lt;/td>
&lt;td>0&lt;/td>
&lt;td>~449 USD/month × 12 = ~5,400 USD (~5,000 €)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Initial deployment&lt;/td>
&lt;td>~2–3 days of engineering&lt;/td>
&lt;td>~half a day&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maintenance&lt;/td>
&lt;td>~4–8 h/month (panels, alerts, upgrades)&lt;/td>
&lt;td>minimal&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Operating cost (at ~60 €/h)&lt;/td>
&lt;td>~240–480 €/month&lt;/td>
&lt;td>~marginal&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Historical retention&lt;/td>
&lt;td>cost of your own Thanos/Mimir&lt;/td>
&lt;td>included&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>If OpenCost&amp;rsquo;s operating cost is around 240–480 €/month, it is in the same order as the Kubecost
licence (~415 €/month). The decision, then, is not set by the price but by the added value: if
invoice reconciliation, automatic rightsizing and the finance-facing UI save you or give you more
than that difference, Kubecost wins; if your team already operates Prometheus/Grafana and your
audience is engineers, OpenCost wins. For a large multi-cluster estate, the saving Kubecost
captures usually far exceeds the licence; for a small and stable one, operating OpenCost is almost
free. The number that decides is not 449 USD, it is &lt;strong>your operating cost against that added
value&lt;/strong>.&lt;/p>
&lt;hr>
&lt;h3 id="migration-and-reversibility-an-argument-for-starting-with-opencost">Migration and reversibility: an argument for starting with OpenCost&lt;/h3>
&lt;p>A rarely mentioned advantage of Kubecost being built on OpenCost: migrating between the two is
low risk. Starting with OpenCost and, if scale justifies it, moving up to Kubecost later does
not force you to redo the allocation, it is the same engine, the same concepts, the same
Prometheus/DCGM instrumentation. What changes is the layer on top. This reduces &lt;em>lock-in&lt;/em>: it is
not an irreversible bet.&lt;/p>
&lt;p>For a platform just starting out, the low-risk strategy is clear: &lt;strong>stand up self-hosted OpenCost
first&lt;/strong>, get the allocation right with the node price in euros, live with it for a few months, and
only then decide whether invoice reconciliation, automatic rightsizing and the finance-facing UI
justify paying for Kubecost. Starting with the commercial product &amp;ldquo;just in case&amp;rdquo; is paying before
knowing whether you need it; starting with OpenCost and moving up if necessary is the option that
keeps reversibility and discovers the real value before the invoice. And since both are
self-hosted, neither route gives up data sovereignty.&lt;/p>
&lt;hr>
&lt;h2 id="the-alternatives-cloudzero-vantage-finout">The alternatives: CloudZero, Vantage, Finout&lt;/h2>
&lt;p>Kubecost is not the only commercial option; there is a category of cost platforms that operate
at a different level (closer to the business than to Kubernetes):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Tool&lt;/th>
&lt;th>Focus&lt;/th>
&lt;th>Differentiator&lt;/th>
&lt;th>Layer&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>CloudZero&lt;/strong>&lt;/td>
&lt;td>unit economics&lt;/td>
&lt;td>cost per feature/product/customer&lt;/td>
&lt;td>business&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Vantage&lt;/strong>&lt;/td>
&lt;td>multi-cloud (20+ integrations)&lt;/td>
&lt;td>breadth (incl. OpenAI invoice)&lt;/td>
&lt;td>business&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Finout&lt;/strong>&lt;/td>
&lt;td>multi-cloud&lt;/td>
&lt;td>virtual tagging (without touching resources)&lt;/td>
&lt;td>business&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Kubecost&lt;/strong>&lt;/td>
&lt;td>Kubernetes&lt;/td>
&lt;td>intra-cluster depth + optimisation&lt;/td>
&lt;td>resource+optim&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>OpenCost&lt;/strong>&lt;/td>
&lt;td>Kubernetes&lt;/td>
&lt;td>open source allocation&lt;/td>
&lt;td>resource&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The key distinction: Kubecost/OpenCost are Kubernetes-centred tools (intra-cluster depth);
CloudZero/Vantage/Finout are business cost platforms (multi-cloud breadth, cost per
product). They do not always compete: many organisations use OpenCost/Kubecost for the Kubernetes
detail and a business platform for the aggregate view.&lt;/p>
&lt;p>A short profile of each:&lt;/p>
&lt;ul>
&lt;li>CloudZero — a &lt;em>cost intelligence&lt;/em> platform with a dedicated Kubernetes visibility solution
for engineering teams. Its hallmark is unit economics: mapping cost to feature, product and
customer, answering &amp;ldquo;how much does it cost me to serve this customer?&amp;rdquo; more than &amp;ldquo;how much does
this pod cost?&amp;rdquo;. It fits when cost has to be taken to the product P&amp;amp;L.&lt;/li>
&lt;li>Vantage — breadth of integrations (more than 20 sources: AWS, Azure, GCP, Kubernetes,
Snowflake, Datadog and the invoice from LLM providers such as OpenAI). It is the option when
AI cost is spread across many providers and you want a single view, including the invoice from
the model APIs.&lt;/li>
&lt;li>Finout — multi-cloud with virtual tagging: it applies cost labels without modifying the
resources, which allows spend that was badly tagged at source to be allocated, and quick
deployment. It is among the top Kubernetes cost optimisation tools
(&lt;a href="https://www.cloudbolt.io/blog/top-kubecost-alternatives/">CloudBolt&lt;/a>, &lt;a href="https://www.finout.io/blog/kubecost-pros/cons-pricing-tutorial-alternatives-2026-guide">Finout&lt;/a>).&lt;/li>
&lt;/ul>
&lt;p>The usual pattern in a mature organisation: OpenCost/Kubecost for the Kubernetes and GPU detail,
and a business platform on top to cross that cost with the rest of the cloud spend and take it
to product. It is not &amp;ldquo;one or the other&amp;rdquo;: it is often &amp;ldquo;one and the other&amp;rdquo;, in layers.&lt;/p>
&lt;hr>
&lt;h2 id="decision-criteria">Decision criteria&lt;/h2>
&lt;p>Five questions that settle the choice without opinion:&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 250" role="img" aria-label="Decision tree: by scale, audience, multi-cluster and sovereignty, choose OpenCost, Kubecost or a business platform" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#km)}&lt;/style>
&lt;defs>&lt;marker id="km" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="20" y="100" width="150" height="50" rx="6"/>
&lt;text x="32" y="122" class="tl">Spend &amp;gt; 10k/month?&lt;/text>
&lt;text x="32" y="139" class="ts">and multi-cluster?&lt;/text>
&lt;path class="ar" d="M170,115 L230,70"/>
&lt;text x="180" y="80" class="ts">no&lt;/text>
&lt;path class="ar" d="M170,135 L230,180"/>
&lt;text x="180" y="170" class="ts">yes&lt;/text>
&lt;rect class="bx" x="230" y="48" width="180" height="44" rx="6"/>
&lt;text x="242" y="68" class="tl">OpenCost (self-host)&lt;/text>
&lt;text x="242" y="84" class="ts">allocation, free, sovereign&lt;/text>
&lt;rect class="bx" x="230" y="158" width="180" height="44" rx="6"/>
&lt;text x="242" y="178" class="tl">Kubecost&lt;/text>
&lt;text x="242" y="194" class="ts">optimisation + governance&lt;/text>
&lt;path class="ar" d="M410,180 L470,150"/>
&lt;text x="420" y="150" class="ts">cost per product?&lt;/text>
&lt;rect class="bx" x="470" y="120" width="200" height="44" rx="6"/>
&lt;text x="482" y="140" class="tl">+ business platform&lt;/text>
&lt;text x="482" y="156" class="ts">CloudZero / Vantage / Finout&lt;/text>
&lt;text x="20" y="235" class="ts">And a cross-cutting question for Europe: where does the cost data live? (see sovereignty below)&lt;/text>
&lt;/svg>
&lt;/div>
&lt;ol>
&lt;li>&lt;strong>How much do you spend?&lt;/strong> Below ~10k USD/month, OpenCost is enough; above that, the saving pays
for the commercial tool.&lt;/li>
&lt;li>&lt;strong>Who reads the report?&lt;/strong> Engineers → OpenCost; finance/management → Kubecost&amp;rsquo;s polished UI or a
business platform.&lt;/li>
&lt;li>&lt;strong>One cluster or many?&lt;/strong> Multi-cluster leans towards Kubecost.&lt;/li>
&lt;li>&lt;strong>Do you want to operate infrastructure?&lt;/strong> If not, buy; if you have a platform team, build with
OpenCost.&lt;/li>
&lt;li>&lt;strong>Where can the cost data live?&lt;/strong> The European question, below.&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="the-european-angle-cost-data-sovereignty">The European angle: cost data sovereignty&lt;/h2>
&lt;p>American comparisons leave out a criterion that for a sovereign platform is first-order: &lt;strong>where
the cost and usage data ends up&lt;/strong>. CloudZero, Vantage, Finout and Kubecost&amp;rsquo;s &lt;em>hosted&lt;/em> option are
SaaS, mostly American: you send them your telemetry of cost, usage, namespace names, teams and
products. That data, which describes your operation in detail, leaves for a jurisdiction subject to
the US CLOUD Act, with the same GDPR consideration as any other sensitive data sent to a
hyperscaler.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Option&lt;/th>
&lt;th>Where the cost data lives&lt;/th>
&lt;th>Sovereignty&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Self-hosted OpenCost&lt;/strong>&lt;/td>
&lt;td>in your cluster&lt;/td>
&lt;td>total&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Self-hosted Kubecost&lt;/strong>&lt;/td>
&lt;td>in your cluster&lt;/td>
&lt;td>total&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Hosted Kubecost (SaaS)&lt;/td>
&lt;td>the provider&amp;rsquo;s SaaS&lt;/td>
&lt;td>subject to the SaaS jurisdiction&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>CloudZero / Vantage / Finout&lt;/td>
&lt;td>SaaS (US)&lt;/td>
&lt;td>subject to the US CLOUD Act&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>It is worth being fair: cost data is not the same as user data. Spend telemetry per namespace is
less sensitive than the content of the inferences. But it does reveal the operation: which
teams exist, which products consume GPU, the size of the platform, and, crossed with namespace
names, information that taken together can be sensitive. Most SaaS FinOps tooling is American;
there are emerging European options, but few with the maturity of the big players. When in doubt,
and for data subject to GDPR, the minimisation principle advises &lt;strong>not taking out of the EU what
does not need to leave&lt;/strong>, and cost allocation, with self-hosted OpenCost/Kubecost, does not need to
leave.&lt;/p>
&lt;p>The consequence for the proposal: &lt;strong>self-hosted OpenCost or Kubecost keep the cost data under your
control&lt;/strong>, just as the cluster keeps the inference data. If data sovereignty is a requirement (it
is for GDPR data, see &lt;a href="https://blog.lo0.es/en/posts/technical-controls-ens-iso-42001-eu-ai-act-cross-mapping/">ENS × 42001 × EU AI
Act controls&lt;/a>), the American SaaS platforms
run into the same conflict as a hyperscaler, however good their UI is. For Fibercli and any
sovereign platform, this tilts the balance towards &lt;strong>self-hosted&lt;/strong>, with OpenCost as the base and
self-hosted Kubecost if the enterprise layer is wanted without giving up the data.&lt;/p>
&lt;hr>
&lt;h2 id="ai-cost-what-none-of-them-ships-out-of-the-box">AI cost: what none of them ships out of the box&lt;/h2>
&lt;p>One point the generalist comparisons do not highlight and that is central for an LLM platform:
none of these tools gives cost per token out of the box. OpenCost and Kubecost reach the &lt;strong>pod
cost&lt;/strong> (per resource/usage); CloudZero, Vantage and Finout reach the &lt;strong>resource or invoice cost&lt;/strong>
(including the OpenAI one, in Vantage&amp;rsquo;s case). But the jump from &amp;ldquo;this vLLM pod cost X €/hour&amp;rdquo; to
&amp;ldquo;this request from this team cost Y&amp;rdquo; requires intercepting the inference traffic with a gateway
(LiteLLM) that counts tokens per request and per team, as developed in the FinOps introduction.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Layer&lt;/th>
&lt;th>What it gives&lt;/th>
&lt;th>Who covers it&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Resource/pod cost&lt;/td>
&lt;td>€/hour per pod, namespace, team&lt;/td>
&lt;td>OpenCost, Kubecost&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cloud/LLM invoice cost&lt;/td>
&lt;td>€/month per provider&lt;/td>
&lt;td>CloudZero, Vantage, Finout&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Cost per token&lt;/strong>&lt;/td>
&lt;td>€/1M tokens per team/model&lt;/td>
&lt;td>&lt;strong>gateway (LiteLLM) + any of the above&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The implication for tool selection: cost per token, the metric that compares on-prem against cloud,
is not solved by any tool on its own, but by the combination of allocation
(OpenCost/Kubecost) with token measurement (gateway). When evaluating a commercial tool, the AI
question is not &amp;ldquo;does it give the pod cost?&amp;rdquo; (they all do, one way or another), but &amp;ldquo;does it
integrate well with my gateway to reach the token?&amp;rdquo;. Vantage, by ingesting the OpenAI invoice,
gets close from the external API consumption side; for your own inference, the gateway remains
essential.&lt;/p>
&lt;hr>
&lt;h2 id="state-of-the-art-2026">State of the art 2026&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Consolidation under IBM&lt;/strong>: Kubecost/OpenCost integrated into IBM&amp;rsquo;s FinOps Suite alongside
Cloudability and Turbonomic; OpenCost remains the CNCF allocation standard.&lt;/li>
&lt;li>&lt;strong>First-class GPU&lt;/strong>: Kubecost 3.0 and OpenCost allocate GPU via DCGM; GPU FinOps stops being a
special case.&lt;/li>
&lt;li>&lt;strong>Towards the token and FOCUS&lt;/strong>: the strong platforms track cost at token level, and the
FOCUS standard (v1.3, Dec 2025) is extending to AI workloads, which will push
interoperability between these tools.&lt;/li>
&lt;li>&lt;strong>A category of AI cost platforms&lt;/strong>: specific &lt;em>AI cost observability&lt;/em> tooling is emerging that
combines resource, invoice and token; it is worth demanding FOCUS compatibility so as not to
couple to one provider.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="selection-checklist">Selection checklist&lt;/h2>
&lt;p>To decide without opinion, in order:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Step&lt;/th>
&lt;th>Question&lt;/th>
&lt;th>If&amp;hellip;&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>Do I have a team to operate OpenCost?&lt;/td>
&lt;td>no → commercial / hosted&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td>Spend &amp;gt; ~10k USD/month and multi-cluster?&lt;/td>
&lt;td>yes → Kubecost&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td>Is the report for finance/management?&lt;/td>
&lt;td>yes → Kubecost UI or business platform&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4&lt;/td>
&lt;td>Do I need cost per product/customer?&lt;/td>
&lt;td>yes → CloudZero/Vantage/Finout on top&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5&lt;/td>
&lt;td>Can the cost data go to a US SaaS?&lt;/td>
&lt;td>no → self-hosted (OpenCost / Kubecost)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>6&lt;/td>
&lt;td>Do I need cost per token?&lt;/td>
&lt;td>yes → any of them &lt;strong>+ gateway&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Step 5 is the filter for a sovereign platform: if the cost data cannot leave the EU jurisdiction,
the list shrinks to the &lt;strong>self-hosted&lt;/strong> options, with OpenCost as the base.&lt;/p>
&lt;hr>
&lt;h2 id="pricing-models-of-commercial-tooling">Pricing models of commercial tooling&lt;/h2>
&lt;p>For those that charge by saving or by percentage of spend:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Model&lt;/th>
&lt;th>How it charges&lt;/th>
&lt;th>Range&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Fixed licence (Kubecost)&lt;/td>
&lt;td>monthly rate&lt;/td>
&lt;td>from ~449 USD/month (business)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Savings-based&lt;/td>
&lt;td>% of the savings delivered&lt;/td>
&lt;td>15–35 %&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Fixed-fee&lt;/td>
&lt;td>% of annual cloud spend&lt;/td>
&lt;td>1–3 %&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The implication: at large spend, a 1–3 % &lt;em>fixed-fee&lt;/em> can exceed Kubecost&amp;rsquo;s fixed licence; with a
lot of waste, &lt;em>savings-based&lt;/em> aligns incentives but can come out expensive if the saving is large.
OpenCost, free, changes the equation if you have someone to operate it.&lt;/p>
&lt;hr>
&lt;h2 id="coexistence-the-reality-is-layered">Coexistence: the reality is layered&lt;/h2>
&lt;p>In mature organisations, these tools are not chosen against each other, they are stacked. The
usual pattern:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Layer&lt;/th>
&lt;th>Tool&lt;/th>
&lt;th>Answers&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Intra-Kubernetes allocation&lt;/td>
&lt;td>OpenCost / Kubecost&lt;/td>
&lt;td>how much does each pod/team/GPU cost?&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Per-token measurement&lt;/td>
&lt;td>gateway (LiteLLM)&lt;/td>
&lt;td>how much does each request/team cost?&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cost per product / multi-cloud&lt;/td>
&lt;td>CloudZero / Vantage / Finout&lt;/td>
&lt;td>how much does it cost to serve this product/customer?&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Each layer solves a different question and feeds off the one below: the pod cost (OpenCost) plus the
tokens (gateway) give the cost per token; that cost per token, aggregated by a business platform,
gives the cost per product. Trying to make a single tool cover all three layers usually ends in
compromises: the Kubernetes ones do not reach the business, the business ones do not reach the pod,
and none reaches the token without the gateway. The healthy architecture is &lt;strong>layers that
integrate&lt;/strong>, not one tool that does everything by halves. And the glue between layers, in 2026, is
FOCUS: demanding FOCUS compatibility from each piece is what allows the data to flow between
them without being rewritten.&lt;/p>
&lt;hr>
&lt;h2 id="summary-by-organisation-profile">Summary by organisation profile&lt;/h2>
&lt;p>To get your bearings quickly, which stack fits each profile (indicative, not prescriptive):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Profile&lt;/th>
&lt;th>Scale&lt;/th>
&lt;th>Stack that usually fits&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Small team with a platform&lt;/td>
&lt;td>1 cluster, low spend&lt;/td>
&lt;td>&lt;strong>OpenCost&lt;/strong> self-hosted + Grafana&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Scale-up with several teams&lt;/td>
&lt;td>multi-team, medium spend&lt;/td>
&lt;td>OpenCost + gateway; Kubecost if time is short&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Multi-cluster enterprise&lt;/td>
&lt;td>many clusters, high spend&lt;/td>
&lt;td>&lt;strong>Kubecost&lt;/strong> + business platform&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Sovereign platform (Fibercli)&lt;/strong>&lt;/td>
&lt;td>GDPR, data in the EU&lt;/td>
&lt;td>&lt;strong>self-hosted OpenCost/Kubecost&lt;/strong> + gateway; no US cost SaaS&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The sovereign profile is the one that changes the answer relative to the standard guides: however
much an American SaaS platform wins on features or on UI, the requirement to keep cost data under
EU jurisdiction rules it out for GDPR data. For Fibercli, the bottom row is the one that rules, and
that is why this series&amp;rsquo; FinOps track is built on &lt;strong>self-hosted&lt;/strong> tools.&lt;/p>
&lt;hr>
&lt;h2 id="limits-and-traps-data-driven">Limits and traps (data-driven)&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>&amp;ldquo;Free&amp;rdquo; is not free.&lt;/strong> OpenCost has an operating cost; count it in the build-vs-buy or you are
fooling yourself comparing 0 with 449 USD.&lt;/li>
&lt;li>&lt;strong>Reconciliation only matters in cloud.&lt;/strong> In pure on-prem, you declare the node&amp;rsquo;s real price and
Kubecost&amp;rsquo;s reconciliation adds less.&lt;/li>
&lt;li>&lt;strong>Cost SaaS = cost data outside.&lt;/strong> For a sovereign platform, sending cost telemetry to an
American SaaS reintroduces the jurisdiction problem that on-prem avoided.&lt;/li>
&lt;li>&lt;strong>Same engine, different UI.&lt;/strong> A good part of what you pay for in Kubecost is the presentation
and governance layer; if your audience is engineers, it may not pay off.&lt;/li>
&lt;li>&lt;strong>Do not confuse layers.&lt;/strong> OpenCost/Kubecost (Kubernetes) and CloudZero/Vantage/Finout
(business) solve different problems; sometimes they complement each other, they do not compete.&lt;/li>
&lt;/ol>
&lt;p>With the allocation tooling decision settled, the FinOps track moves on to cost per token (A4) and
the full TCO model (A8). The foundation is the one from A2 and A3: correct allocation, with the
node price in euros, in a tool that respects data sovereignty.&lt;/p>
&lt;h2 id="closing">Closing&lt;/h2>
&lt;p>The OpenCost vs Kubecost vs commercial platform choice is sold as a feature comparison, and is in
reality a build-vs-buy decision with a sovereignty constraint on top. The allocation engine is
the same (OpenCost) in the first two; what you pay for in Kubecost is the optimisation, governance
and presentation layer, which pays off when scale is large, the audience is financial or you do not
want to operate infrastructure. The business platforms (CloudZero, Vantage, Finout) solve a
different problem, cost per product, multi-cloud, and often coexist in layers with the Kubernetes
ones rather than competing. But for a European sovereign platform there is a criterion no American
comparison puts first and that for Fibercli comes first: where the cost data lives. Sending
your spend, team and product telemetry to an American SaaS reintroduces, through the back door, the
jurisdiction problem that on-prem avoided. The conclusion the data supports: &lt;strong>self-hosted OpenCost
as the base, self-hosted Kubecost if the enterprise layer is wanted, and the gateway to reach the
token&lt;/strong>, a stack that keeps cost measured, in euros, and under EU jurisdiction. Expensive or cheap
is secondary; sovereign or not is not.&lt;/p>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>CloudZero · Kubecost vs OpenCost (2026) — &lt;a href="https://www.cloudzero.com/blog/kubecost-vs-opencost/">https://www.cloudzero.com/blog/kubecost-vs-opencost/&lt;/a>&lt;/li>
&lt;li>Finout · Kubecost vs OpenCost (6 diferencias) — &lt;a href="https://www.finout.io/blog/kubecost-vs-opencost">https://www.finout.io/blog/kubecost-vs-opencost&lt;/a>&lt;/li>
&lt;li>Finout · Kubecost: pros/cons, pricing, alternativas (2026) — &lt;a href="https://www.finout.io/blog/kubecost-pros/cons-pricing-tutorial-alternatives-2026-guide">https://www.finout.io/blog/kubecost-pros/cons-pricing-tutorial-alternatives-2026-guide&lt;/a>&lt;/li>
&lt;li>CloudBolt · Top Kubecost Alternatives (2026) — &lt;a href="https://www.cloudbolt.io/blog/top-kubecost-alternatives/">https://www.cloudbolt.io/blog/top-kubecost-alternatives/&lt;/a>&lt;/li>
&lt;li>Amnic · OpenCost vs Kubecost — &lt;a href="https://amnic.com/blogs/opencost-vs-kubecost">https://amnic.com/blogs/opencost-vs-kubecost&lt;/a>&lt;/li>
&lt;li>Clanker Cloud · Best tools for managing GPU usage in Kubernetes (2026) — &lt;a href="https://clankercloud.ai/blog/best-tools-managing-gpu-usage-kubernetes-2025-2026-cost-roi">https://clankercloud.ai/blog/best-tools-managing-gpu-usage-kubernetes-2025-2026-cost-roi&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>OpenCost in depth: how GPU cost is allocated in Kubernetes</title><link>https://blog.lo0.es/en/posts/opencost-gpu-cost-allocation-kubernetes/</link><pubDate>Sun, 14 Jun 2026 02:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/opencost-gpu-cost-allocation-kubernetes/</guid><description>&lt;blockquote>
&lt;p>Notation: amounts in &lt;strong>euros (N €)&lt;/strong>, decimals with a point. European references (OVH is among
the supported providers). The dollar sign is not used (on this site it is a formula
delimiter).&lt;/p>
&lt;/blockquote>
&lt;h2 id="what-this-article-covers">What this article covers&lt;/h2>
&lt;p>Second article in the &lt;strong>FinOps&lt;/strong> track (A2), and the first tool deep dive. The
&lt;a href="https://blog.lo0.es/en/posts/gpu-llm-finops-frameworks-metrics-state-of-the-art/">FinOps introduction&lt;/a> established that
OpenCost is the CNCF standard for cost allocation; here the box gets opened: how it allocates
cost internally, where it gets its data from, how on-prem prices are configured in euros, what its
API exposes, and where the traps are. Understanding the mechanics matters because &lt;strong>it defines what
any tool on top (Kubecost included) can and cannot do&lt;/strong>, and because a badly set base price
invalidates the whole split. No recommendations; only the mechanics and the methodology.&lt;/p>
&lt;hr>
&lt;h2 id="what-opencost-is">What OpenCost is&lt;/h2>
&lt;p>OpenCost is a vendor-neutral, Apache 2.0 project, originally built by Kubecost and donated to
the CNCF (incubating project). It is a cost allocation layer for Kubernetes: it reads
resource usage from the cluster, joins it with a price, and splits the cost across Kubernetes
dimensions down to the container (&lt;a href="https://github.com/opencost/opencost">OpenCost · GitHub&lt;/a>).
It supports dynamic pricing via the billing APIs of AWS, Azure and GCP, &lt;strong>and custom prices for
on-prem clusters&lt;/strong> (&lt;a href="https://opencost.io/docs/configuration/">OpenCost · configuration&lt;/a>).&lt;/p>
&lt;p>What it is &lt;strong>not&lt;/strong>: it is not an optimiser, nor a governance system, nor a product unit economics
tool. It is the piece that answers &amp;ldquo;how much does each namespace/pod/team cost?&amp;rdquo;, and leaves the
rest to the layers above. That is why it is the foundation of the FinOps track: without correct
allocation, there is no cost per token and no TCO model worth anything.&lt;/p>
&lt;hr>
&lt;h2 id="the-cost-model-node-level-allocation">The cost model: node-level allocation&lt;/h2>
&lt;p>The key to OpenCost is that the model works at node level. It starts from the node&amp;rsquo;s &lt;strong>resource
capacity&lt;/strong> (CPU, RAM, GPU, storage) and its &lt;strong>total price&lt;/strong>, and splits that price across the
resources. When the provider does not give explicit per-resource prices, OpenCost uses the &lt;strong>ratio
of a set of base prices&lt;/strong> (marginal rates, customisable) and &lt;strong>normalises them so that the sum of
the components equals the node&amp;rsquo;s total price&lt;/strong> (&lt;a href="https://opencost.io/docs/configuration/on-prem/">OpenCost · on-prem&lt;/a>).&lt;/p>
&lt;p>This is what makes it work on-prem: you declare the node cost (depreciated capex + opex), and
OpenCost splits it without needing a cloud invoice. The normalisation guarantees that no cost is
&amp;ldquo;lost&amp;rdquo; or &amp;ldquo;invented&amp;rdquo;: what you pay for the node is exactly what gets split across its resources.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 250" role="img" aria-label="OpenCost cost model: total node price split and normalised across CPU, GPU, RAM and disk, and then allocated by usage to each pod" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#om)}&lt;/style>
&lt;defs>&lt;marker id="om" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="20" y="40" width="170" height="60" rx="6"/>
&lt;text x="32" y="63" class="tl">Node price&lt;/text>
&lt;text x="32" y="81" class="ts">depreciated capex&lt;/text>
&lt;text x="32" y="95" class="ts">+ opex (€/hour)&lt;/text>
&lt;path class="ar" d="M190,70 L235,70"/>
&lt;rect class="bx" x="235" y="40" width="210" height="60" rx="6"/>
&lt;text x="247" y="63" class="tl">Split + normalisation&lt;/text>
&lt;text x="247" y="81" class="ts">CPU / GPU / RAM / disk&lt;/text>
&lt;text x="247" y="95" class="ts">sum = total price&lt;/text>
&lt;path class="ar" d="M445,70 L490,70"/>
&lt;rect class="bx" x="490" y="40" width="270" height="60" rx="6"/>
&lt;text x="502" y="63" class="tl">Allocation by USAGE&lt;/text>
&lt;text x="502" y="81" class="ts">GPU half used = half the cost&lt;/text>
&lt;text x="502" y="95" class="ts">per pod / namespace / team&lt;/text>
&lt;rect class="dsh" x="20" y="130" width="740" height="96" rx="6"/>
&lt;text x="34" y="152" class="tl">What OpenCost guarantees: no cost is lost and none is invented.&lt;/text>
&lt;text x="34" y="172" class="ts">· On-prem: you declare the node cost; OpenCost splits it (no cloud invoice needed).&lt;/text>
&lt;text x="34" y="190" class="ts">· GPU is allocated by USAGE, not presence: a GPU at 50 % charges half its cost.&lt;/text>
&lt;text x="34" y="208" class="ts">· Trap: if the default base price is wrong, the WHOLE split is wrong (typical on-prem under-pricing).&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="where-the-data-comes-from-prometheus">Where the data comes from: Prometheus&lt;/h2>
&lt;p>OpenCost instruments nothing of its own: it reads from Prometheus, which is a prerequisite
of the installation (&lt;a href="https://github.com/opencost/opencost">OpenCost · GitHub&lt;/a>). The sources:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Source&lt;/th>
&lt;th>What it provides&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>kube-state-metrics&lt;/code>&lt;/td>
&lt;td>state of K8s objects (pods, requests/limits)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>node-exporter&lt;/code>&lt;/td>
&lt;td>node resources and capacity&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>cAdvisor&lt;/code>&lt;/td>
&lt;td>real CPU/memory usage per container&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>dcgm-exporter&lt;/code> (NVIDIA)&lt;/td>
&lt;td>&lt;strong>GPU&lt;/strong> usage, memory and power&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>With those series, OpenCost automates the join between Kubernetes resource usage and the
provider price, reducing the custom PromQL you would otherwise write by hand (&lt;a href="https://grafana.com/docs/grafana-cloud/monitor-infrastructure/kubernetes-monitoring/manage-costs/">Grafana ·
manage costs&lt;/a>).
The &lt;strong>GPU&lt;/strong> signal comes from DCGM via the &lt;code>dcgm-exporter&lt;/code> (part of the NVIDIA GPU Operator),
the same base as &lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability&lt;/a>. Without
Prometheus and without DCGM exporting, OpenCost does not see the GPU.&lt;/p>
&lt;hr>
&lt;h2 id="architecture-the-pieces">Architecture: the pieces&lt;/h2>
&lt;p>OpenCost is not a monolith; it is three responsibilities worth telling apart:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Piece&lt;/th>
&lt;th>Function&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Cost model&lt;/strong>&lt;/td>
&lt;td>resolves the node price and splits/normalises it across resources&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Allocation API&lt;/strong>&lt;/td>
&lt;td>serves the allocated cost per dimension (&lt;code>/allocation&lt;/code> and endpoints)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Exporter&lt;/strong>&lt;/td>
&lt;td>publishes cost metrics on &lt;code>/metrics&lt;/code> for Prometheus/Grafana&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The data flow: Prometheus holds the usage series (from kube-state-metrics, cAdvisor,
dcgm-exporter); the cost model joins them with the resolved price; the Allocation API
serves them aggregated by whatever dimension you ask for; and the exporter returns them to
Prometheus so that Grafana can plot them. It is a cycle: metrics come in from Prometheus and cost
goes back to Prometheus enriched. That symmetry is what lets you reuse your observability stack
without standing up a new database: OpenCost lives on top of Prometheus, not beside it.&lt;/p>
&lt;p>An operational note: historical analysis depends on Prometheus retention. For cost reports
spanning months, a long-term backend behind it (Thanos, Mimir, VictoriaMetrics) is advisable, or
periodically exporting the allocations to a store of your own.&lt;/p>
&lt;hr>
&lt;h2 id="on-prem-prices-in-euros-the-piece-that-decides-everything">On-prem prices in euros: the piece that decides everything&lt;/h2>
&lt;p>On-prem, the most important figure, and the most neglected, is the &lt;strong>node price&lt;/strong>. It is configured
per provider; the options are &lt;code>alibaba&lt;/code>, &lt;code>aws&lt;/code>, &lt;code>azure&lt;/code>, &lt;code>gcp&lt;/code>, &lt;code>oracle&lt;/code>, &lt;strong>&lt;code>ovh&lt;/code>&lt;/strong> or &lt;strong>&lt;code>default&lt;/code>&lt;/strong>
(on-prem) (&lt;a href="https://opencost.io/docs/configuration/">OpenCost · configuration&lt;/a>).
For on-prem you use &lt;code>default&lt;/code>, supplying base prices in a &lt;code>default.json&lt;/code> (or by overriding the Helm
&lt;code>values.yaml&lt;/code>); anything you do not override uses the chart&amp;rsquo;s value (&lt;a href="https://opencost.io/docs/configuration/on-prem/">OpenCost · on-prem&lt;/a>).&lt;/p>
&lt;p>To set the node price in euros, the calculation is the TCO model one: depreciated capex + opex. An
example of an &lt;strong>8×H100&lt;/strong> node:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Component&lt;/th>
&lt;th>Calculation&lt;/th>
&lt;th>€/hour&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Capex (node ~240,000 €, 36 months)&lt;/td>
&lt;td>240,000 ÷ 26,280 h&lt;/td>
&lt;td>~9.13&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Energy (5.6 kW × PUE 1.4 × 0.058 €/kWh, France)&lt;/td>
&lt;td>~0.455 €/h&lt;/td>
&lt;td>~0.46&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Maintenance, networking, operations&lt;/td>
&lt;td>estimate&lt;/td>
&lt;td>~1.5&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Node total&lt;/strong>&lt;/td>
&lt;td>&lt;/td>
&lt;td>&lt;strong>~11.1 €/h&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>That ~11 €/h is the number you put into OpenCost, and everything is split from it. And here is
the documented trap: with the default pricing configuration, OpenCost &lt;strong>under-prices CPU and
GPU on-prem&lt;/strong> (&lt;a href="https://github.com/opencost/opencost/issues/3781">issue #3781&lt;/a>).
If you do not adjust the base prices to your real cost, the split will be systematically low and
the cost per token you report will be unreal. &lt;strong>Configuring the node price is not optional: it is
the figure everything else hangs from.&lt;/strong>&lt;/p>
&lt;hr>
&lt;h3 id="configuring-the-price-an-example">Configuring the price: an example&lt;/h3>
&lt;p>The base price is given in the Helm &lt;code>values.yaml&lt;/code> (or a &lt;code>default.json&lt;/code>), in euros per hour and per
unit of resource, derived from the node&amp;rsquo;s total cost:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="c"># values.yaml — on-prem prices in €/hour (8xH100 node, France)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">opencost&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">customPricing&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enabled&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">provider&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">custom&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">costModel&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">description&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;On-prem 8xH100 node&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">CPU&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;0.030&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/CPU-hour&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">RAM&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;0.004&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/GB-hour&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">GPU&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;1.30&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/GPU-hour ← the figure that moves cost/token the most&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">storage&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;0.0002&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># €/GB-hour&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>OpenCost normalises those values so that, multiplied by the node capacity, they add up to the
total price you declared (~11 €/h in the example). The number to be most careful with is the
&lt;strong>GPU&lt;/strong> one: at 1.30 €/GPU-hour, the 8 cards are ~10.4 €/h, the bulk of the node&amp;rsquo;s cost. A badly set
GPU base shifts the whole cost per token. Always review the resolved prices in
&lt;code>/allNodePricing&lt;/code> after configuring, because the default under-pricing bug bites exactly here.&lt;/p>
&lt;hr>
&lt;h2 id="allocation-by-usage-not-by-presence">Allocation: by usage, not by presence&lt;/h2>
&lt;p>The behaviour that has changed most and that matters most for GPU: in recent versions, &lt;strong>the cost
allocated to a GPU is determined by its usage, not its presence&lt;/strong>. If a GPU costing 100 €/month is
only half used, the allocated cost is ~50 € ([search]). This aligns allocation with reality,
you pay for what you use, but it has a consequence: the other half does not disappear, it is
&lt;strong>idle&lt;/strong> that somebody keeps paying for. OpenCost exposes it, and that is where the optimisation
lever comes from.&lt;/p>
&lt;p>OpenCost allocates to any Kubernetes dimension: &lt;strong>cluster, node, namespace, controller
(deployment, statefulset and so on), service, pod and container&lt;/strong>, and by &lt;strong>labels&lt;/strong> (team,
product). Access is through the Allocation API and several endpoints that expose the mechanics:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Endpoint&lt;/th>
&lt;th>What it returns&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>/allocation&lt;/code>&lt;/td>
&lt;td>cost allocated by the dimension you ask for&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/costDataModel&lt;/code>&lt;/td>
&lt;td>the resolved node price&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/allNodePricing&lt;/code>&lt;/td>
&lt;td>hourly prices per node&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/pricingSourceSummary&lt;/code>&lt;/td>
&lt;td>summary of the pricing source&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>/metrics&lt;/code>&lt;/td>
&lt;td>cost metrics for Prometheus&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The &lt;code>/metrics&lt;/code> endpoint is what turns OpenCost into a Prometheus exporter: once there, you can
write PromQL to calculate the cost and efficiency of any Kubernetes concept and build panels in
Grafana (&lt;a href="https://opencost.io/docs/integrations/opencost-exporter/">OpenCost · exporter&lt;/a>).&lt;/p>
&lt;h3 id="allocation-api-parameters">Allocation API parameters&lt;/h3>
&lt;p>&lt;code>/allocation&lt;/code> is controlled by a handful of parameters worth knowing, because they define which
number you get:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>What it controls&lt;/th>
&lt;th>Example&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>window&lt;/code>&lt;/td>
&lt;td>time range&lt;/td>
&lt;td>&lt;code>7d&lt;/code>, &lt;code>today&lt;/code>, specific dates&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>aggregate&lt;/code>&lt;/td>
&lt;td>aggregation dimension&lt;/td>
&lt;td>&lt;code>namespace&lt;/code>, &lt;code>label:team&lt;/code>, &lt;code>pod&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>accumulate&lt;/code>&lt;/td>
&lt;td>sum the range or break it per interval&lt;/td>
&lt;td>&lt;code>true&lt;/code> (total) / &lt;code>false&lt;/code> (series)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>idle&lt;/code>&lt;/td>
&lt;td>include idle cost or not&lt;/td>
&lt;td>&lt;code>true&lt;/code> / &lt;code>false&lt;/code> / &lt;code>separate&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>filter&lt;/code>&lt;/td>
&lt;td>filter by namespace, label and so on&lt;/td>
&lt;td>&lt;code>namespace:&amp;quot;llm-prod&amp;quot;&lt;/code>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The &lt;strong>&lt;code>idle&lt;/code>&lt;/strong> parameter is the most revealing: with &lt;code>idle=separate&lt;/code>, OpenCost returns the idle
cost as a separate row, which lets you see at a glance how much is being paid for unused
capacity. A query with &lt;code>aggregate=label:team&lt;/code> and &lt;code>idle=separate&lt;/code> over &lt;code>window=30d&lt;/code> is, literally,
the monthly chargeback report with the waste highlighted.&lt;/p>
&lt;hr>
&lt;h2 id="gpu-in-depth-dcgm-usage-mig-and-idle">GPU in depth: DCGM, usage, MIG and idle&lt;/h2>
&lt;p>The GPU is the expensive resource, so its allocation deserves detail:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Usage signal&lt;/strong>: &lt;code>dcgm-exporter&lt;/code> gives &lt;code>DCGM_FI_DEV_GPU_UTIL&lt;/code> (utilisation), &lt;code>DCGM_FI_DEV_FB_USED&lt;/code>
(memory), and power. OpenCost uses utilisation to allocate by usage.&lt;/li>
&lt;li>&lt;strong>MIG (Multi-Instance GPU)&lt;/strong>: an A100 is split into up to 7 isolated instances, which allows
cutting idle from 50 % to almost 0 % by sharing one card across small workloads
([search]; see &lt;a href="https://blog.lo0.es/en/posts/sharing-one-gpu-time-slicing-mps-mig/">sharing the GPU: time-slicing, MPS and MIG&lt;/a>).
The cost allocation of each MIG instance follows the same usage logic.&lt;/li>
&lt;li>&lt;strong>Idle&lt;/strong>: the reliable detection pattern combines three pieces, DCGM metrics in Prometheus, an
alert that fires when &lt;code>DCGM_FI_DEV_GPU_UTIL &amp;lt; 10&lt;/code> for more than 15 minutes, and routing of
that alert to the team that owns the namespace ([search]).&lt;/li>
&lt;/ul>
&lt;p>An attribution nuance worth knowing: MIG creates isolated instances that Kubernetes sees as
distinct resources, so OpenCost allocates them cleanly, each one to its pod. Time-slicing, by
contrast, shares the same physical GPU across several pods with no compute isolation: there,
per-pod utilisation is harder to separate, and cost attribution becomes approximate (the GPU is
split across the pods sharing it, according to their measured usage). The practical rule: if you
need exact per-team chargeback on a shared GPU, MIG gives cleaner attribution than
time-slicing, at the price of rigid fixed partitions. It is a trade-off between cost accuracy and
flexibility that is better decided before, not after, building the split.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 220" role="img" aria-label="GPU allocation by usage in OpenCost: used cost charged to the pod, idle cost flagged to the namespace owner, and MIG splitting one card across workloads" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#om2)}&lt;/style>
&lt;defs>&lt;marker id="om2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="20" y="40" width="170" height="70" rx="6"/>
&lt;text x="32" y="63" class="tl">GPU (DCGM)&lt;/text>
&lt;text x="32" y="81" class="ts">util, memory, power&lt;/text>
&lt;text x="32" y="98" class="ts">→ to Prometheus&lt;/text>
&lt;path class="ar" d="M190,75 L235,60"/>
&lt;path class="ar" d="M190,80 L235,150"/>
&lt;rect class="bx" x="235" y="34" width="240" height="44" rx="6"/>
&lt;text x="247" y="54" class="tl">USED cost → pod / team&lt;/text>
&lt;text x="247" y="70" class="ts">charged by utilisation&lt;/text>
&lt;rect class="dsh" x="235" y="128" width="240" height="44" rx="6"/>
&lt;text x="247" y="148" class="tl">IDLE cost → namespace owner&lt;/text>
&lt;text x="247" y="164" class="ts">alert util &amp;lt; 10 % &amp;gt; 15 min&lt;/text>
&lt;rect class="bx" x="520" y="80" width="240" height="50" rx="6"/>
&lt;text x="532" y="100" class="tl">MIG: 1 A100 → up to 7&lt;/text>
&lt;text x="532" y="118" class="ts">splits the card, idle 50%→~0&lt;/text>
&lt;text x="20" y="200" class="ts">Usage allocation reveals idle; MIG and scheduling recover it. OpenCost measures; other layers act.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="efficiency-the-number-that-triggers-action">Efficiency: the number that triggers action&lt;/h2>
&lt;p>With cost allocated by usage, OpenCost lets you calculate efficiency: how much of the allocated
cost corresponds to useful work against the total. A GPU at 30 % utilisation has an efficiency of
30 %: the remaining 70 % is idle cost that somebody pays without receiving work. That figure, per
team and per namespace, is what turns a dashboard into a chargeback conversation: &amp;ldquo;your namespace
has 5 GPUs allocated at 25 % efficiency; either you raise utilisation or you release three cards&amp;rdquo;.
It connects with &lt;a href="https://blog.lo0.es/en/posts/finops-multi-tenancy-gpu-cluster-who-pays/">FinOps and multi-tenancy&lt;/a>:
allocation locates the waste; scheduling and co-residency recover it.&lt;/p>
&lt;hr>
&lt;h2 id="worked-example-the-allocation-report">Worked example: the allocation report&lt;/h2>
&lt;p>On the ~11 €/h node (8×H100), three teams share the cluster for a month. What a
&lt;code>/allocation?aggregate=label:team&amp;amp;idle=separate&amp;amp;window=30d&lt;/code> query returns:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Team&lt;/th>
&lt;th>GPU-hours&lt;/th>
&lt;th>Avg. util.&lt;/th>
&lt;th>Allocated cost (€)&lt;/th>
&lt;th>Efficiency&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>A · chat-prod&lt;/td>
&lt;td>2,880 (4 GPU)&lt;/td>
&lt;td>78 %&lt;/td>
&lt;td>~3,744&lt;/td>
&lt;td>high&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>B · batch&lt;/td>
&lt;td>1,440 (2 GPU)&lt;/td>
&lt;td>55 %&lt;/td>
&lt;td>~1,872&lt;/td>
&lt;td>medium&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>C · experimentation&lt;/td>
&lt;td>1,440 (2 GPU)&lt;/td>
&lt;td>22 %&lt;/td>
&lt;td>~1,872&lt;/td>
&lt;td>&lt;strong>low&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>idle&lt;/strong> (separate)&lt;/td>
&lt;td>—&lt;/td>
&lt;td>—&lt;/td>
&lt;td>&lt;strong>~1,100&lt;/strong>&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>What the report reveals: the cost allocated to A, B and C comes out of their GPU-hours and the node
price; but the &lt;strong>idle&lt;/strong> row (~1,100 €/month) is capacity nobody used and everyone pays for in the
pro rata. And the efficiency column points at C: 2 GPUs at 22 % is ~1,560 € a month of which
only ~340 € is useful work. That is the actionable figure: C does not have a model problem, it has
a utilisation problem. Without OpenCost, those ~1,100 € of idle and C&amp;rsquo;s inefficiency stay diluted
in an aggregate invoice nobody questions. With it, they are a named row and a number in euros.&lt;/p>
&lt;hr>
&lt;h2 id="useful-promql-queries">Useful PromQL queries&lt;/h2>
&lt;p>As a Prometheus exporter, OpenCost lets you build the panels by hand. Some reference queries (exact
metric names vary by version; check in your &lt;code>/metrics&lt;/code>):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-promql" data-lang="promql">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Cost per node and hour (resolved price)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nv">node_total_hourly_cost&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># GPU cost allocated per namespace (€/hour)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">sum&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">by&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">namespace&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nv">container_gpu_allocation&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">*&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">on&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">node&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">group_left&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nv">node_gpu_hourly_cost&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># Average GPU utilisation per namespace (for efficiency)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">avg&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">by&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">namespace&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="nv">DCGM_FI_DEV_GPU_UTIL&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1"># Idle GPUs: utilisation &amp;lt; 10 % sustained&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nv">DCGM_FI_DEV_GPU_UTIL&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">10&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The last one, wrapped in an alert with &lt;code>for: 15m&lt;/code> and routed to the namespace owner, is the
standard idle detection pattern. With these series in Grafana you have cost per team, efficiency
and waste on one dashboard, the &amp;ldquo;Inform report&amp;rdquo; of the FinOps phase in real time.&lt;/p>
&lt;hr>
&lt;h2 id="dynamic-cloud-prices-vs-custom-on-prem-prices">Dynamic cloud prices vs custom on-prem prices&lt;/h2>
&lt;p>The difference is worth understanding, because it changes how reliable the figure is:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Cloud&lt;/strong> (aws/azure/gcp/oracle/ovh): OpenCost obtains the price dynamically from the
provider&amp;rsquo;s billing API, so the allocated cost reflects the real rate (including discounts, spot
and so on) without you declaring anything.&lt;/li>
&lt;li>&lt;strong>On-prem&lt;/strong> (&lt;code>default&lt;/code>/&lt;code>custom&lt;/code>): you declare the price, derived from your TCO model. The
advantage is total control; the risk is that a badly calculated price skews everything. That is
why the TCO model (depreciated capex + opex) is not an academic exercise: it is literally
OpenCost&amp;rsquo;s &lt;em>input&lt;/em>.&lt;/li>
&lt;/ul>
&lt;p>The &lt;strong>&lt;code>ovh&lt;/code>&lt;/strong> provider among those supported is relevant for a European platform: if part of the
workload goes to a European sovereign cloud, OpenCost can allocate its cost with dynamic pricing,
and mix it with on-prem in the same allocation view.&lt;/p>
&lt;hr>
&lt;h2 id="from-pod-cost-to-cost-per-token">From pod cost to cost per token&lt;/h2>
&lt;p>OpenCost gets as far as &amp;ldquo;this vLLM pod cost X €/hour&amp;rdquo;. The &lt;strong>cost per token&lt;/strong>, the metric that
compares on-prem against cloud, needs one more piece: the &lt;strong>gateway&lt;/strong> (LiteLLM) that counts tokens
per request and per team, as covered in the &lt;a href="https://blog.lo0.es/en/posts/gpu-llm-finops-frameworks-metrics-state-of-the-art/">FinOps introduction&lt;/a>.
The full chain is: OpenCost gives the pod cost by usage → the gateway gives the tokens per team →
dividing them gives the cost per token per team. OpenCost is the hardware half of that
equation; without it, you would know the tokens but not their real cost. That is why A2 (allocation)
is the foundation the whole cost per token of the proposal hangs from.&lt;/p>
&lt;hr>
&lt;h2 id="deployment-helm--prometheus">Deployment: Helm + Prometheus&lt;/h2>
&lt;p>The typical deployment is via Helm, with Prometheus as a prerequisite (for scraping and
series storage). Conceptual steps:&lt;/p>
&lt;ol>
&lt;li>Have Prometheus with &lt;code>kube-state-metrics&lt;/code>, &lt;code>node-exporter&lt;/code>, &lt;code>cAdvisor&lt;/code> and &lt;code>dcgm-exporter&lt;/code>.&lt;/li>
&lt;li>Install OpenCost with Helm, pointing it at your Prometheus.&lt;/li>
&lt;li>Configure the &lt;strong>node price&lt;/strong> in euros (&lt;code>default.json&lt;/code> / &lt;code>values.yaml&lt;/code>), the step most often
neglected.&lt;/li>
&lt;li>Expose &lt;code>/metrics&lt;/code> and build panels in Grafana with PromQL over the cost metrics.&lt;/li>
&lt;/ol>
&lt;p>As a Prometheus exporter, OpenCost lets you &lt;strong>write PromQL for the cost and efficiency of any
concept&lt;/strong> and create bespoke dashboards (&lt;a href="https://opencost.io/docs/integrations/opencost-exporter/">OpenCost · exporter&lt;/a>).
It reuses infrastructure a GPU cluster already has for observability (DCGM, Prometheus,
Grafana): OpenCost only adds the pricing and allocation layer.&lt;/p>
&lt;hr>
&lt;h2 id="opencost-vs-kubecost-just-the-essentials">OpenCost vs Kubecost (just the essentials)&lt;/h2>
&lt;p>OpenCost is the free base; Kubecost (IBM) is the commercial product built on it. Briefly,
what the commercial one adds:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Capability&lt;/th>
&lt;th>OpenCost&lt;/th>
&lt;th>Kubecost&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Cost allocation (CPU/GPU/mem/PV)&lt;/td>
&lt;td>✓&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>GPU via DCGM&lt;/td>
&lt;td>✓&lt;/td>
&lt;td>✓ (3.0)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Long historical retention&lt;/td>
&lt;td>depends on your Prometheus&lt;/td>
&lt;td>included&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Automatic rightsizing&lt;/td>
&lt;td>—&lt;/td>
&lt;td>✓ (Turbonomic)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Governance, alerts, enterprise RBAC&lt;/td>
&lt;td>basic&lt;/td>
&lt;td>✓&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Commercial support&lt;/td>
&lt;td>community&lt;/td>
&lt;td>✓ (IBM)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>For most on-prem clusters with a platform team, OpenCost covers allocation; Kubecost adds value
when you want automated optimisation and enterprise features without operating it yourself. The
detail of the comparison, and when paying is worth it, is article &lt;strong>A3&lt;/strong>.&lt;/p>
&lt;hr>
&lt;h2 id="implementation-checklist">Implementation checklist&lt;/h2>
&lt;p>For OpenCost to give a defensible per-team cost, order matters:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Step&lt;/th>
&lt;th>Action&lt;/th>
&lt;th>Verification&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>Prometheus with kube-state-metrics, node-exporter, cAdvisor&lt;/td>
&lt;td>series present&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td>NVIDIA GPU Operator + dcgm-exporter&lt;/td>
&lt;td>&lt;code>DCGM_FI_DEV_GPU_UTIL&lt;/code> in Prometheus&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td>Install OpenCost (Helm) pointing at Prometheus&lt;/td>
&lt;td>&lt;code>/allocation&lt;/code> responds&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4&lt;/td>
&lt;td>&lt;strong>Configure the node price in €&lt;/strong> (capex+opex)&lt;/td>
&lt;td>&lt;code>/allNodePricing&lt;/code> shows the real one&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5&lt;/td>
&lt;td>Label pods/namespaces by team and product&lt;/td>
&lt;td>&lt;code>aggregate=label:team&lt;/code> splits correctly&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>6&lt;/td>
&lt;td>Grafana panels for cost, efficiency and idle&lt;/td>
&lt;td>the waste is visible&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>7&lt;/td>
&lt;td>Idle alert (&lt;code>util&amp;lt;10&lt;/code> &lt;code>for: 15m&lt;/code>) to the owner&lt;/td>
&lt;td>the alert reaches the team&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>8&lt;/td>
&lt;td>(optional) long-retention backend&lt;/td>
&lt;td>months of history available&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Step 4 is the one most often skipped and the one that most invalidates the result. If you only do
one thing right, make it that one: without the correct node price in euros, steps 5 to 7 split a
wrong cost with great precision.&lt;/p>
&lt;hr>
&lt;h2 id="limits-and-traps-data-driven">Limits and traps (data-driven)&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>Default under-pricing.&lt;/strong> With the default pricing config, OpenCost underestimates on-prem
CPU and GPU (&lt;a href="https://github.com/opencost/opencost/issues/3781">#3781&lt;/a>). Adjust the base prices
to your real cost or the whole split will come out low.&lt;/li>
&lt;li>&lt;strong>It depends on Prometheus and DCGM.&lt;/strong> Without the right series (especially &lt;code>dcgm-exporter&lt;/code>),
there is no GPU allocation. Input data quality rules.&lt;/li>
&lt;li>&lt;strong>Allocation by usage ≠ total cost.&lt;/strong> A GPU at 50 % charges half; the other half is idle that
still costs. Do not confuse &amp;ldquo;allocated cost&amp;rdquo; with &amp;ldquo;cost paid&amp;rdquo;.&lt;/li>
&lt;li>&lt;strong>Prometheus retention.&lt;/strong> Historical cost analysis depends on how much your Prometheus retains;
for long series, plan a long-term backend.&lt;/li>
&lt;li>&lt;strong>Allocation, not per-token measurement.&lt;/strong> OpenCost reaches the pod; cost per token needs the
gateway (LiteLLM) above it, as covered in the FinOps introduction.&lt;/li>
&lt;/ol>
&lt;p>With OpenCost&amp;rsquo;s mechanics clear, the next article (A3) compares what Kubecost and the commercial
alternatives add, to decide which FinOps stack to adopt. But the foundation, correct allocation
with the node price properly set in euros, is this one.&lt;/p>
&lt;h2 id="closing">Closing&lt;/h2>
&lt;p>OpenCost looks like &amp;ldquo;installing a cost tool&amp;rdquo; and is, in reality, &lt;strong>declaring what your hardware is
worth and letting it split itself&lt;/strong>. That simplicity is its strength, it lives on top of the
Prometheus and DCGM you already have, with no new database, and also its trap: the split is only as
good as the node price you declare, and the default value under-prices on-prem GPU. Properly
configured in euros, OpenCost turns the cluster&amp;rsquo;s aggregate invoice into a split per team, per
product and per GPU, separates used cost from idle, and exposes the efficiency that triggers
chargeback conversations. It is the hardware half of the cost per token equation, the other half,
the tokens, is supplied by the gateway, and without this half there is no TCO model or on-prem vs
cloud comparison that holds up. For a sovereign architecture proposal, OpenCost is the piece that
makes cost stop being an intuition and become a table in euros, reproducible and auditable, with
the idle GPU named and identified. The &lt;em>Inform&lt;/em> phase of GPU FinOps starts here, and everything
else hangs on this number being right.&lt;/p>
&lt;h2 id="see-also">See also&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-chargeback-showback-multi-tenancy/">GPU chargeback and showback&lt;/a> — from OpenCost&amp;rsquo;s cost allocation to the per-team split with budgets (Kueue) and token attribution (LiteLLM).&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/gpu-idle-cost-not-on-any-invoice/">GPU utilisation as a FinOps lever&lt;/a> — the cost of idle and how occupancy moves the allocated cost.&lt;/li>
&lt;li>&lt;a href="https://blog.lo0.es/en/posts/full-tco-on-premise-gpu-cluster-capex-gpu-hour-break-even/">TCO of an on-premise GPU cluster: depreciation, energy and infrastructure&lt;/a> — the CAPEX, the depreciation and the €/GPU-hour that OpenCost needs as a base price when the node is not cloud but your own on-premise hardware.&lt;/li>
&lt;/ul>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>OpenCost · GitHub (CNCF, Apache 2.0) — &lt;a href="https://github.com/opencost/opencost">https://github.com/opencost/opencost&lt;/a>&lt;/li>
&lt;li>OpenCost · configuración (proveedores: aws/azure/gcp/oracle/ovh/default) — &lt;a href="https://opencost.io/docs/configuration/">https://opencost.io/docs/configuration/&lt;/a>&lt;/li>
&lt;li>OpenCost · configuración on-prem (precios personalizados) — &lt;a href="https://opencost.io/docs/configuration/on-prem/">https://opencost.io/docs/configuration/on-prem/&lt;/a>&lt;/li>
&lt;li>OpenCost · exportador de Prometheus — &lt;a href="https://opencost.io/docs/integrations/opencost-exporter/">https://opencost.io/docs/integrations/opencost-exporter/&lt;/a>&lt;/li>
&lt;li>OpenCost · issue #3781 (infra-precio CPU/GPU on-prem por defecto) — &lt;a href="https://github.com/opencost/opencost/issues/3781">https://github.com/opencost/opencost/issues/3781&lt;/a>&lt;/li>
&lt;li>NVIDIA · dcgm-exporter — &lt;a href="https://github.com/NVIDIA/dcgm-exporter">https://github.com/NVIDIA/dcgm-exporter&lt;/a>&lt;/li>
&lt;li>Grafana · manage costs (OpenCost + Kubernetes) — &lt;a href="https://grafana.com/docs/grafana-cloud/monitor-infrastructure/kubernetes-monitoring/manage-costs/">https://grafana.com/docs/grafana-cloud/monitor-infrastructure/kubernetes-monitoring/manage-costs/&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>GPU/LLM FinOps: frameworks, metrics and state of the art (tool by tool)</title><link>https://blog.lo0.es/en/posts/gpu-llm-finops-frameworks-metrics-state-of-the-art/</link><pubDate>Sat, 13 Jun 2026 03:00:00 +0200</pubDate><guid>https://blog.lo0.es/en/posts/gpu-llm-finops-frameworks-metrics-state-of-the-art/</guid><description>&lt;blockquote>
&lt;p>Notation: amounts in &lt;strong>euros (N €)&lt;/strong>, decimals with a point. The references are &lt;strong>European&lt;/strong>
(providers and prices from FR/DE/ES), as this is a sovereign proposal; when a source quotes
dollars it is marked &amp;ldquo;USD&amp;rdquo;. The dollar sign is not used (on this site it is a formula
delimiter).&lt;/p>
&lt;/blockquote>
&lt;h2 id="what-this-introduction-covers">What this introduction covers&lt;/h2>
&lt;p>Second article in the data series, and the first pillar &lt;em>deep dive&lt;/em>. Here the &lt;strong>FinOps&lt;/strong> tooling
for GPU/LLM infrastructure is inventoried with the detail an architecture decision needs: what
metrics each tool handles, how it allocates cost internally, what GPU support it has, under
what licence and pricing model it operates, and where its limits are. It is the natural
continuation of the &lt;a href="https://blog.lo0.es/en/posts/cost-performance-energy-three-axes-llm-inference/">opening article&lt;/a>,
which established that cost per token is the unit that allows on-prem and cloud to be compared.
No recommendations: the final choice is settled in the synthesis article with the Pareto table;
here there are only facts and methodology.&lt;/p>
&lt;hr>
&lt;h2 id="why-gpu-finops-is-a-different-problem">Why GPU FinOps is a different problem&lt;/h2>
&lt;p>Classic cloud FinOps was born to split CPU, memory and storage, cheap and elastic resources. The
GPU breaks three assumptions at once, and that is why it needs its own treatment:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>It is expensive and discrete.&lt;/strong> An H100 costs on the order of 2.7 to 7 €/hour in European
cloud (Scaleway from 2.73 €/h; OVHcloud somewhat more), or its depreciated capex on-prem; it is
not a resource that gets split in trivial fractions. A 10 % allocation error across a GPU fleet
is real money.&lt;/li>
&lt;li>&lt;strong>It is easily underused.&lt;/strong> Unlike the CPU, a GPU draws its power even when idle, and
average occupancy in ungoverned clusters is notoriously low. The cost of &lt;em>idle&lt;/em>, the GPU
powered on without working, is waste number one, and it is invisible if it is not measured.&lt;/li>
&lt;li>&lt;strong>It is hard to attribute.&lt;/strong> Who owns the cost of a GPU shared by &lt;em>time-slicing&lt;/em> or MIG across
several pods from several teams? Without an allocation layer, GPU spend is a black hole nobody
claims and nobody optimises.&lt;/li>
&lt;/ol>
&lt;p>The goal of GPU FinOps is to turn that black hole into an attributed, measured and actionable
invoice: knowing what each team, each model and, in the end, each token costs.&lt;/p>
&lt;hr>
&lt;h2 id="the-finops-metrics">The FinOps metrics&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Metric&lt;/th>
&lt;th>Definition&lt;/th>
&lt;th>Unit&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>CPM&lt;/strong> (cost/1M tokens)&lt;/td>
&lt;td>cluster cost ÷ tokens produced&lt;/td>
&lt;td>€ / 1M tok&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cost per request&lt;/td>
&lt;td>cost charged to a complete request&lt;/td>
&lt;td>€ / req&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>€/GPU-hour&lt;/td>
&lt;td>hourly cost of a GPU (depreciated or rented)&lt;/td>
&lt;td>€/h&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Utilisation&lt;/strong>&lt;/td>
&lt;td>fraction of the GPU actually used&lt;/td>
&lt;td>% (MFU, GPU-hour util)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cost of idle&lt;/td>
&lt;td>GPU powered on without useful work&lt;/td>
&lt;td>€/h wasted&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Showback&lt;/td>
&lt;td>reporting the cost to each team (without charging)&lt;/td>
&lt;td>€ / team&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Chargeback&lt;/td>
&lt;td>charging the cost to each team&lt;/td>
&lt;td>€ / team&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cost efficiency&lt;/td>
&lt;td>real cost ÷ cost if it were at 100 %&lt;/td>
&lt;td>%&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The metric that closes the loop with the business is cost per token (or per request): it is the
only one that can be compared across providers, across models and against the price of an external
API. All GPU FinOps tooling exists to reach, one way or another, that number.&lt;/p>
&lt;hr>
&lt;h2 id="the-three-finops-phases-finops-foundation">The three FinOps phases (FinOps Foundation)&lt;/h2>
&lt;p>The FinOps Foundation framework organises the work in a three-phase cycle. Applied to GPU:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Phase&lt;/th>
&lt;th>Goal&lt;/th>
&lt;th>Typical GPU action&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Inform&lt;/strong>&lt;/td>
&lt;td>visibility and allocation&lt;/td>
&lt;td>measure cost per namespace/team/model/token&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Optimize&lt;/strong>&lt;/td>
&lt;td>reduce spend&lt;/td>
&lt;td>rightsizing, spot, quotas, switch off the idle, quantise&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Operate&lt;/strong>&lt;/td>
&lt;td>continuous governance&lt;/td>
&lt;td>budgets, idle alerts, automated chargeback&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The common mistake is jumping to &lt;em>Optimize&lt;/em> without having done &lt;em>Inform&lt;/em>: GPUs get bought or
replicas get adjusted without knowing where the money really goes. Allocation (the Inform phase) is
the prerequisite for everything else, and it is where the tooling comes in.&lt;/p>
&lt;hr>
&lt;h2 id="how-cost-is-allocated-in-kubernetes-opencosts-mechanics">How cost is allocated in Kubernetes: OpenCost&amp;rsquo;s mechanics&lt;/h2>
&lt;p>OpenCost is the de facto standard, so it is worth understanding how it allocates cost,
because that defines what any tool on top can and cannot do. It is a vendor-neutral, Apache 2.0
project, originally built by Kubecost and donated to the CNCF (incubating project)
(&lt;a href="https://github.com/opencost/opencost">OpenCost · GitHub&lt;/a>).&lt;/p>
&lt;p>The model works at node level: it starts from the node&amp;rsquo;s resource capacity (CPU, RAM, GPU,
storage) and its total price, and splits that price across the resources. When the provider does
not give explicit CPU/GPU/RAM prices, OpenCost uses the ratio of a set of base prices (the
provider&amp;rsquo;s marginal rates, customisable) and &lt;strong>normalises them so that the sum of the components
equals the node&amp;rsquo;s total price&lt;/strong>
(&lt;a href="https://opencost.io/docs/configuration/on-prem/">OpenCost · on-prem&lt;/a>). This is key on-premise:
you define the node cost (depreciated capex + opex) and OpenCost splits it.&lt;/p>
&lt;p>It obtains utilisation by scraping Prometheus: &lt;code>kube-state-metrics&lt;/code>, &lt;code>node-exporter&lt;/code>
and &lt;code>cAdvisor&lt;/code> give it the real consumption per pod, and with that it allocates cost per
cluster, node, namespace, controller, service or pod (&lt;a href="https://opencost.io/docs/integrations/opencost-exporter/">OpenCost · exporter&lt;/a>).
For the GPU, the signal comes from DCGM (via the NVIDIA GPU Operator) exported to
Prometheus, the same base as &lt;a href="https://blog.lo0.es/en/posts/gpu-observability-llm-inference-twelve-dcgm-vllm-metrics/">GPU observability&lt;/a>.
A common idle detection pattern: an alert when &lt;code>DCGM_FI_DEV_GPU_UTIL &amp;lt; 10&lt;/code>
for more than 15 minutes, routed to the team that owns the namespace.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 250" role="img" aria-label="OpenCost cost allocation mechanics: utilisation metrics from Prometheus and DCGM, node-level pricing model, and allocation per namespace, team and pod" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#fm)}&lt;/style>
&lt;defs>&lt;marker id="fm" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;text x="20" y="26" class="tl">Utilisation metrics (Prometheus)&lt;/text>
&lt;rect class="bx" x="20" y="36" width="200" height="84" rx="6"/>
&lt;text x="32" y="58" class="ts">kube-state-metrics&lt;/text>
&lt;text x="32" y="76" class="ts">node-exporter · cAdvisor&lt;/text>
&lt;text x="32" y="94" class="ts">DCGM (GPU, via GPU Operator)&lt;/text>
&lt;text x="32" y="112" class="ts">usage per pod&lt;/text>
&lt;path class="ar" d="M220,78 L265,78"/>
&lt;rect class="bx" x="265" y="36" width="210" height="84" rx="6"/>
&lt;text x="277" y="58" class="tl">Pricing model (per node)&lt;/text>
&lt;text x="277" y="78" class="ts">total node price split&lt;/text>
&lt;text x="277" y="96" class="ts">across CPU/GPU/RAM/disk&lt;/text>
&lt;text x="277" y="114" class="ts">normalised so sum = total&lt;/text>
&lt;path class="ar" d="M475,78 L520,78"/>
&lt;rect class="bx" x="520" y="36" width="240" height="84" rx="6"/>
&lt;text x="532" y="58" class="tl">Allocation&lt;/text>
&lt;text x="532" y="78" class="ts">per cluster / node / namespace&lt;/text>
&lt;text x="532" y="96" class="ts">controller / service / pod&lt;/text>
&lt;text x="532" y="114" class="ts">→ cost per team&lt;/text>
&lt;rect class="dsh" x="20" y="150" width="740" height="74" rx="6"/>
&lt;text x="34" y="172" class="tl">On-premise you define the node cost (depreciated capex + opex); OpenCost only splits it.&lt;/text>
&lt;text x="34" y="192" class="ts">GPU idle: alert if DCGM_FI_DEV_GPU_UTIL &amp;lt; 10 for &amp;gt;15 min → route to the namespace owner.&lt;/text>
&lt;text x="34" y="210" class="ts">What OpenCost allocates per resource, the layers above enrich into cost per token.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="frameworks-tool-by-tool">Frameworks, tool by tool&lt;/h2>
&lt;h3 id="opencost--the-allocation-standard-cncf-apache-20">OpenCost — the allocation standard (CNCF, Apache 2.0)&lt;/h3>
&lt;p>What it measures: allocated cost of in-cluster resources (CPU, GPU, memory, volumes) by any
Kubernetes dimension. Method: node-level pricing model + Prometheus scraping (above). GPU: yes,
via DCGM. Licence: Apache 2.0, free. It can run as a metrics exporter to Prometheus with no
further dependencies. Limit: it is the allocation layer, it brings no optimisation, governance
or product unit economics; for that you put something on top of it.&lt;/p>
&lt;h3 id="kubecost--the-commercial-product-on-opencost-ibm">Kubecost — the commercial product on OpenCost (IBM)&lt;/h3>
&lt;p>What it measures: what OpenCost does (it is built on it) plus enterprise capabilities. &lt;strong>Kubecost
3.0 (2025)&lt;/strong> added GPU monitoring via &lt;strong>NVIDIA DCGM&lt;/strong> and integration with &lt;strong>IBM
Turbonomic&lt;/strong> for automatic &lt;em>rightsizing&lt;/em>, and extended its scope from Kubernetes to cloud service
cost. IBM acquired Kubecost and integrated Kubecost/OpenCost into its FinOps Suite alongside
Cloudability and Turbonomic (&lt;a href="https://www.cloudzero.com/blog/kubecost-vs-opencost/">CloudZero · Kubecost vs OpenCost&lt;/a>).
Differentiator: rightsizing, governance, support. Limit: it is a commercial product; the bulk of
the value over free OpenCost is the optimisation and enterprise layer.&lt;/p>
&lt;h3 id="cloudzero--unit-economics-and-cost-per-product">CloudZero — unit economics and cost per product&lt;/h3>
&lt;p>What it measures: it maps cloud cost to features, products, teams and customers, not just to
resources. Method: it ingests multi-cloud billing and models it in business dimensions.
Differentiator: the deepest allocation and the unit economics approach (cost per business
unit). Limit: less focused on intra-Kubernetes mechanics than OpenCost/Kubecost; it is the
&amp;ldquo;cost to business&amp;rdquo; layer.&lt;/p>
&lt;h3 id="vantage--multi-cloud-with-many-integrations">Vantage — multi-cloud with many integrations&lt;/h3>
&lt;p>What it measures: multi-cloud cost with more than 20 native integrations (AWS, Azure, GCP,
Kubernetes, Snowflake, Datadog, OpenAI and so on). Differentiator: breadth of sources, including
the invoice from LLM providers (OpenAI), which brings it closer to end-to-end AI cost. Limit:
the depth of intra-cluster allocation is lower than that of K8s-native tools.&lt;/p>
&lt;h3 id="finout--virtual-tagging-fast-deployment">Finout — virtual tagging, fast deployment&lt;/h3>
&lt;p>What it measures: multi-cloud cost with virtual tagging: it applies cost labels &lt;strong>without
modifying the real resources&lt;/strong>, which allows spend that was not properly tagged at source to be
allocated. Differentiator: fast deployment and flexible reallocation without touching the infra.
Limit: like the others in its category, it depends on the quality of the billing data it ingests.&lt;/p>
&lt;h3 id="comparison-table">Comparison table&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Tool&lt;/th>
&lt;th>Scope&lt;/th>
&lt;th>GPU&lt;/th>
&lt;th>Licence / model&lt;/th>
&lt;th>Differentiator&lt;/th>
&lt;th>Layer&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>OpenCost&lt;/strong>&lt;/td>
&lt;td>Kubernetes&lt;/td>
&lt;td>Yes (DCGM)&lt;/td>
&lt;td>Apache 2.0 (CNCF), free&lt;/td>
&lt;td>allocation standard&lt;/td>
&lt;td>resource&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Kubecost&lt;/strong>&lt;/td>
&lt;td>K8s + cloud&lt;/td>
&lt;td>Yes (DCGM, 3.0)&lt;/td>
&lt;td>commercial (IBM)&lt;/td>
&lt;td>rightsizing, enterprise&lt;/td>
&lt;td>resource+optim&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>CloudZero&lt;/strong>&lt;/td>
&lt;td>multi-cloud&lt;/td>
&lt;td>indirect&lt;/td>
&lt;td>commercial&lt;/td>
&lt;td>unit economics per product&lt;/td>
&lt;td>business&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Vantage&lt;/strong>&lt;/td>
&lt;td>multi-cloud (20+)&lt;/td>
&lt;td>via K8s/provider&lt;/td>
&lt;td>commercial&lt;/td>
&lt;td>breadth (incl. OpenAI)&lt;/td>
&lt;td>business&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Finout&lt;/strong>&lt;/td>
&lt;td>multi-cloud&lt;/td>
&lt;td>via K8s/provider&lt;/td>
&lt;td>commercial&lt;/td>
&lt;td>virtual tagging&lt;/td>
&lt;td>business&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="pricing-models-of-commercial-tooling">Pricing models of commercial tooling&lt;/h2>
&lt;p>They are worth knowing because the cost of the FinOps tool is also FinOps:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Model&lt;/th>
&lt;th>How it charges&lt;/th>
&lt;th>Range&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Savings-based&lt;/td>
&lt;td>% of the savings delivered&lt;/td>
&lt;td>&lt;strong>15–35 %&lt;/strong>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Fixed-fee&lt;/td>
&lt;td>% of annual cloud spend&lt;/td>
&lt;td>&lt;strong>1–3 %&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>(&lt;a href="https://www.cloudzero.com/blog/finops-tools/">CloudZero · FinOps Tools&lt;/a>). The implication: at
large cloud spend, a 1–3 % &lt;em>fixed-fee&lt;/em> can exceed the &lt;em>savings-based&lt;/em> model; at small spend with a
lot of waste, &lt;em>savings-based&lt;/em> aligns incentives. OpenCost, being free, changes the equation for
whoever has a team to operate it.&lt;/p>
&lt;hr>
&lt;h2 id="focus-the-cost-data-standard">FOCUS: the cost data standard&lt;/h2>
&lt;p>The cross-cutting problem of multi-source FinOps is that each provider bills in its own format.
&lt;strong>FOCUS&lt;/strong> (FinOps Open Cost and Usage Specification) is the open technical specification that
defines requirements so that providers produce uniform billing datasets
(&lt;a href="https://focus.finops.org/focus-specification/">FOCUS · FinOps Foundation&lt;/a>).
The committee ratified FOCUS v1.3 on 4 December 2025.&lt;/p>
&lt;p>What is relevant for this series: at &lt;strong>FinOps X 2026&lt;/strong> the focus has been put on &lt;strong>extending FOCUS
to AI workloads&lt;/strong>, with token economics pushing the specification, and the expansion requests
include AI, datacenter and SaaS/PaaS workloads (&lt;a href="https://siliconangle.com/2026/06/08/focus-specification-ai-cost-accountability-finopsx/">SiliconANGLE&lt;/a>).
In other words, the standard that normalises cloud cost is being stretched to cover AI cost per
token. For an architecture proposal, betting on tools that emit and consume FOCUS is betting on
future interoperability.&lt;/p>
&lt;hr>
&lt;h2 id="from-resource-to-token-cost-per-token-with-a-gateway">From resource to token: cost per token with a gateway&lt;/h2>
&lt;p>Resource allocation (OpenCost) gets as far as &amp;ldquo;this vLLM pod cost X €/hour&amp;rdquo;. To get to &amp;ldquo;this
request from this team cost Y&amp;rdquo; you have to intercept the inference traffic. That is where the
gateway comes in.&lt;/p>
&lt;p>Tools such as LiteLLM sit between the application and the LLM provider/engine, and &lt;strong>intercept
every request to record tokens, latency and cost in real time&lt;/strong>. Layers above (for instance
OpenLM&amp;rsquo;s AI Gateway) generate usage logs compatible with FOCUS (v1.0 to 1.3) and map spend to
team, product, customer or feature, enabling showback or chargeback
(&lt;a href="https://www.openlm.com/enable-ai-finops-with-real-time-token-attribution/">OpenLM · token attribution&lt;/a>).
This links up with &lt;a href="https://blog.lo0.es/en/posts/finops-multi-tenancy-gpu-cluster-who-pays/">FinOps and multi-tenancy of the GPU cluster&lt;/a>,
where the gateway is the piece that splits cost between tenants.&lt;/p>
&lt;div class="diagram" style="max-width:780px;margin:1rem auto;">
&lt;svg viewBox="0 0 780 230" role="img" aria-label="From GPU-hour to cost per token: OpenCost allocates the pod cost, the LiteLLM gateway intercepts requests and counts tokens, and cost is split per team and product" xmlns="http://www.w3.org/2000/svg">
&lt;style>.bx{fill:none;stroke:currentColor;stroke-width:1.3}.dsh{fill:none;stroke:currentColor;stroke-width:1.3;stroke-dasharray:5 3}.tl{font:600 12px sans-serif;fill:currentColor}.ts{font:11px sans-serif;fill:currentColor}.ar{fill:none;stroke:currentColor;stroke-width:1.3;marker-end:url(#fm2)}&lt;/style>
&lt;defs>&lt;marker id="fm2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">&lt;path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>&lt;/marker>&lt;/defs>
&lt;rect class="bx" x="20" y="40" width="160" height="58" rx="6"/>
&lt;text x="32" y="63" class="tl">OpenCost&lt;/text>
&lt;text x="32" y="82" class="ts">vLLM pod cost (€/h)&lt;/text>
&lt;path class="ar" d="M180,69 L225,69"/>
&lt;rect class="bx" x="225" y="40" width="180" height="58" rx="6"/>
&lt;text x="237" y="63" class="tl">Gateway (LiteLLM)&lt;/text>
&lt;text x="237" y="82" class="ts">intercepts · counts tokens&lt;/text>
&lt;path class="ar" d="M405,69 L450,69"/>
&lt;rect class="bx" x="450" y="40" width="150" height="58" rx="6"/>
&lt;text x="462" y="63" class="tl">FOCUS logs&lt;/text>
&lt;text x="462" y="82" class="ts">tokens · latency · cost&lt;/text>
&lt;path class="ar" d="M600,69 L645,69"/>
&lt;rect class="bx" x="645" y="40" width="115" height="58" rx="6"/>
&lt;text x="657" y="63" class="tl">Showback&lt;/text>
&lt;text x="657" y="82" class="ts">per team&lt;/text>
&lt;rect class="dsh" x="20" y="130" width="740" height="72" rx="6"/>
&lt;text x="34" y="152" class="tl">Two halves that have to be joined: allocation per resource (OpenCost) + measurement per token (gateway).&lt;/text>
&lt;text x="34" y="172" class="ts">Without the gateway you know the pod's cost, not the request's. Without OpenCost you know the tokens, not the real hardware cost.&lt;/text>
&lt;text x="34" y="190" class="ts">FOCUS is the common format that lets them be crossed with the rest of the cloud spend.&lt;/text>
&lt;/svg>
&lt;/div>
&lt;hr>
&lt;h2 id="worked-example-chargeback-of-a-multi-tenant-cluster">Worked example: chargeback of a multi-tenant cluster&lt;/h2>
&lt;p>To see the two halves joined, a split over an example node (&lt;strong>4×H100&lt;/strong>, depreciated cost
12 €/hour) shared by three teams via namespaces and MIG:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Team&lt;/th>
&lt;th>GPU-hours allocated (OpenCost)&lt;/th>
&lt;th>Hardware cost (€/h)&lt;/th>
&lt;th>Tokens/day (gateway)&lt;/th>
&lt;th>Cost/1M tok&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>A · chat product&lt;/td>
&lt;td>50 %&lt;/td>
&lt;td>6.00&lt;/td>
&lt;td>8M&lt;/td>
&lt;td>~0.75 €&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>B · nightly batch&lt;/td>
&lt;td>30 %&lt;/td>
&lt;td>3.60&lt;/td>
&lt;td>3M&lt;/td>
&lt;td>~1.20 €&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>C · experimentation&lt;/td>
&lt;td>20 %&lt;/td>
&lt;td>2.40&lt;/td>
&lt;td>0.5M&lt;/td>
&lt;td>~4.80 €&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>How it comes out: OpenCost splits the node&amp;rsquo;s 12 €/h according to the GPU-hours each namespace
consumes (half for A → 6 €/h). The gateway supplies the tokens per team. Each one&amp;rsquo;s cost per
million tokens is its hardware cost divided by its output, and it reveals something neither half
would see alone: team &lt;strong>C pays 6× more per token than A&lt;/strong>, not because its model is worse, but
because its GPU is underused (a lot of allocated GPU-hours for few tokens). That 4.80 €/1M is
the chargeback signal that triggers an optimisation conversation: either C raises its utilisation,
or it releases the GPU. Without crossing allocation and tokens, that waste stays hidden in a
cluster average.&lt;/p>
&lt;hr>
&lt;h2 id="the-hidden-cost-utilisation">The hidden cost: utilisation&lt;/h2>
&lt;p>Optimisation lever number one is not changing GPU, it is stopping paying for an idle GPU. As
seen in the opening article, the electricity cost per token at 80 % utilisation is a quarter of
what it is at 20 %, and utilisation spreads all the fixed cost (capex + energy) over more tokens.
Measuring idle is, therefore, the highest-return action of the &lt;em>Optimize&lt;/em> phase:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Signal&lt;/th>
&lt;th>Source&lt;/th>
&lt;th>Typical threshold&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Idle GPU&lt;/td>
&lt;td>&lt;code>DCGM_FI_DEV_GPU_UTIL&lt;/code>&lt;/td>
&lt;td>&amp;lt; 10 % for &amp;gt; 15 min&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Unused GPU memory&lt;/td>
&lt;td>&lt;code>DCGM_FI_DEV_FB_USED&lt;/code>&lt;/td>
&lt;td>reserved but not used&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Pods with no traffic&lt;/td>
&lt;td>gateway metrics&lt;/td>
&lt;td>0 requests, GPU allocated&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Allocation (OpenCost) locates whose the idle GPU is; scheduling and co-residency
(&lt;a href="https://blog.lo0.es/en/posts/sharing-one-gpu-time-slicing-mps-mig/">sharing the GPU: time-slicing, MPS and MIG&lt;/a>)
recover it. FinOps closes the loop: measure → attribute → optimise → govern.&lt;/p>
&lt;hr>
&lt;h2 id="optimize-the-saving-levers-with-data">Optimize: the saving levers (with data)&lt;/h2>
&lt;p>Once cost is allocated (Inform), the &lt;em>Optimize&lt;/em> phase has a bounded repertoire of levers. Ordered
by typical return:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Lever&lt;/th>
&lt;th>Typical saving&lt;/th>
&lt;th>Mechanism&lt;/th>
&lt;th>Cost/risk&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Recover idle&lt;/strong>&lt;/td>
&lt;td>the largest&lt;/td>
&lt;td>switch off/share the idle GPU&lt;/td>
&lt;td>requires measuring utilisation&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Quantisation (FP8/INT4)&lt;/strong>&lt;/td>
&lt;td>raises throughput, lowers VRAM&lt;/td>
&lt;td>more tokens per GPU-hour&lt;/td>
&lt;td>possible quality cost&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Reserved commitment&lt;/strong>&lt;/td>
&lt;td>&lt;strong>20–40 %&lt;/strong> over on-demand&lt;/td>
&lt;td>reserve capacity&lt;/td>
&lt;td>less elasticity&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Spot/preemptible&lt;/strong>&lt;/td>
&lt;td>the deepest discount&lt;/td>
&lt;td>interruptible capacity&lt;/td>
&lt;td>you have to tolerate cuts&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Rightsizing&lt;/strong>&lt;/td>
&lt;td>variable&lt;/td>
&lt;td>match GPU type/count to the SLO&lt;/td>
&lt;td>requires benchmarks&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Autoscaling (HPA/KEDA)&lt;/strong>&lt;/td>
&lt;td>variable&lt;/td>
&lt;td>scale replicas with demand&lt;/td>
&lt;td>tuning metrics&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>On commitment, the 2026 cloud data is conclusive: reserved plans give 20–40 % saving
against on-demand, and spot the deepest discount in exchange for interruptibility; the price of
the H100 fell 64–75 % between Q4 2024 and the start of 2026
(&lt;a href="https://www.spheron.network/blog/gpu-cloud-pricing-comparison-2026/">Spheron · GPU Cloud Pricing&lt;/a>).
Rightsizing and autoscaling connect with cluster scheduling: fitting the workload onto the
right GPU and scaling replicas with demand are, at the same time, performance and cost levers.
Quantisation appears here because it raises throughput, and, by the identity from the opening
article, lowers cost and energy per token at the same time.&lt;/p>
&lt;hr>
&lt;h2 id="gpu-finops-maturity">GPU FinOps maturity&lt;/h2>
&lt;p>A simple model to place where an organisation is, and what it is missing:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Level&lt;/th>
&lt;th>State&lt;/th>
&lt;th>What is missing to move up&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>0 · blind&lt;/td>
&lt;td>aggregate invoice, no attribution&lt;/td>
&lt;td>instrument OpenCost + DCGM&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1 · visibility&lt;/td>
&lt;td>cost per namespace/team&lt;/td>
&lt;td>per-token measurement (gateway)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2 · unit economics&lt;/td>
&lt;td>cost per token and per product&lt;/td>
&lt;td>idle alerts and budgets&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3 · optimisation&lt;/td>
&lt;td>idle recovered, commitment, rightsizing&lt;/td>
&lt;td>automated chargeback&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4 · governance&lt;/td>
&lt;td>chargeback + budgets + FOCUS&lt;/td>
&lt;td>continuous improvement&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Most organisations with GPUs are at level 0 or 1: they see a big invoice but do not know whose
each euro is. The value jump is in reaching level 2, cost per token and per product, which is
exactly where the tooling in this article stops being optional. The series&amp;rsquo; FinOps track walks that
ladder up to the full TCO model and the comparable cost/token that underpins the architecture
proposal.&lt;/p>
&lt;hr>
&lt;h2 id="the-minimum-stack-to-reach-level-2">The minimum stack to reach level 2&lt;/h2>
&lt;p>Bringing the previous pieces together into a concrete toolchain, all open source, that takes you
from blindness (level 0) to cost per token and per product (level 2):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Piece&lt;/th>
&lt;th>Function&lt;/th>
&lt;th>Alternative&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>NVIDIA GPU Operator + DCGM&lt;/strong>&lt;/td>
&lt;td>exports GPU metrics (usage, memory, power)&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Prometheus&lt;/strong>&lt;/td>
&lt;td>stores the usage and cost series&lt;/td>
&lt;td>VictoriaMetrics&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>OpenCost&lt;/strong>&lt;/td>
&lt;td>allocates cost per resource and dimension&lt;/td>
&lt;td>Kubecost (commercial)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Gateway (LiteLLM)&lt;/strong>&lt;/td>
&lt;td>counts tokens per team/model&lt;/td>
&lt;td>OpenLM AI Gateway&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Grafana&lt;/strong>&lt;/td>
&lt;td>cost, utilisation and idle panels&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>It is, deliberately, infrastructure many clusters already have for observability (DCGM,
Prometheus, Grafana); GPU FinOps reuses that base and adds OpenCost and the gateway to it. It is
not a new product, it is a layer on top of what exists.&lt;/p>
&lt;h3 id="kpis-to-watch">KPIs to watch&lt;/h3>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>KPI&lt;/th>
&lt;th>What it indicates&lt;/th>
&lt;th>Typical target&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Average GPU utilisation&lt;/td>
&lt;td>waste&lt;/td>
&lt;td>&amp;gt;70–80 % sustained&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cost per 1M tokens (per model)&lt;/td>
&lt;td>economic efficiency&lt;/td>
&lt;td>compare against cloud rental&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>% of GPU-hours idle&lt;/td>
&lt;td>money thrown away&lt;/td>
&lt;td>minimise (&amp;lt;10–15 %)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Cost per team/product&lt;/td>
&lt;td>attribution&lt;/td>
&lt;td>fair split, no surprises&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Deviation against budget&lt;/td>
&lt;td>governance&lt;/td>
&lt;td>alert before it is exceeded&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>These five KPIs are what turn GPU FinOps from a pretty dashboard into a decision tool: if you watch
them, you know at all times what each thing costs and where the waste is.&lt;/p>
&lt;hr>
&lt;h2 id="state-of-the-art-2026">State of the art 2026&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Consolidation in Kubernetes&lt;/strong>: OpenCost is the CNCF allocation standard; Kubecost
(IBM) the reference commercial product, already with GPU via DCGM and rightsizing through
Turbonomic.&lt;/li>
&lt;li>&lt;strong>From resource to token&lt;/strong>: the strong platforms of 2026 track cost at token and GPU level,
combining resource allocation (OpenCost) with gateway measurement (LiteLLM); it is the only route
to a comparable cost/token for on-prem against cloud.&lt;/li>
&lt;li>&lt;strong>FOCUS v1.3&lt;/strong> (Dec 2025) as the interoperability layer, extending to AI at
FinOps X 2026: the cloud cost standard absorbs token economics.&lt;/li>
&lt;li>&lt;strong>Mature GPU FinOps&lt;/strong>: instrumentation leans on DCGM (the same base as observability), and idle
detection by a utilisation threshold is common practice.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="cost-per-token-the-bridge-to-the-business-decision">Cost per token: the bridge to the business decision&lt;/h2>
&lt;p>All the previous tooling exists to produce a number the business understands: cost per token
(or per request). It is the one that lets you answer the three questions that underpin an
architecture proposal:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Build or buy?&lt;/strong> On-prem cost/token (depreciated capex + opex, at real utilisation) against the
price of an external API or of cloud rental. Below the volume threshold (~2M tokens/day) buying
usually wins; above it, building.&lt;/li>
&lt;li>&lt;strong>How do you price a product?&lt;/strong> If a feature consumes N tokens per use and each million costs C,
the marginal cost per use is N·C/10⁶, the basis of any margin.&lt;/li>
&lt;li>&lt;strong>Where is the waste?&lt;/strong> Cost/token per team (the chargeback example) points at whoever underuses
the GPU before the aggregate invoice hides it.&lt;/li>
&lt;/ol>
&lt;p>The trap: comparing cost/token across scenarios without fixing the assumptions (utilisation,
precision, ownership model). An on-prem cost/token calculated at 80 % utilisation is not comparable
with one at 20 %, nor an FP16 with an FP8. That is why allocation (Inform) is not an end in itself:
it is the raw material of a cost model with explicit assumptions, which is what the synthesis
article turns into the &amp;ldquo;build vs buy&amp;rdquo; argument with defensible numbers. GPU FinOps is not
accounting; it is the quantitative basis of the architecture decision.&lt;/p>
&lt;hr>
&lt;h2 id="limits-and-traps-data-driven">Limits and traps (data-driven)&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>Allocation ≠ per-token measurement.&lt;/strong> OpenCost splits the resource cost; without a gateway you
do not reach the request. They are two halves that have to be joined explicitly.&lt;/li>
&lt;li>&lt;strong>Badly set base prices = badly set allocation.&lt;/strong> On-prem, OpenCost splits the cost &lt;strong>you
declare&lt;/strong> for the node; if the depreciated capex/opex is wrong, the whole split is wrong. Input
data quality rules.&lt;/li>
&lt;li>&lt;strong>Invisible idle.&lt;/strong> Without DCGM exported to Prometheus and without utilisation alerts, waste
number one does not appear on any dashboard.&lt;/li>
&lt;li>&lt;strong>Cost of the tool.&lt;/strong> A 1–3 % &lt;em>fixed-fee&lt;/em> on large spend is real money; compare the tooling cost
with the saving it delivers (it is FinOps on top of FinOps).&lt;/li>
&lt;li>&lt;strong>Proprietary formats.&lt;/strong> Tools that do not emit/consume FOCUS tie you to their data model; in
2026 the robust bet is FOCUS interoperability.&lt;/li>
&lt;/ol>
&lt;p>The next article in the series (A2) goes into OpenCost in depth; this one fixes the map. With
allocation settled, the rest of the FinOps track builds the TCO model and the cost/token the
proposal needs.&lt;/p>
&lt;h2 id="sources">Sources&lt;/h2>
&lt;ul>
&lt;li>OpenCost · GitHub (CNCF, Apache 2.0) — &lt;a href="https://github.com/opencost/opencost">https://github.com/opencost/opencost&lt;/a>&lt;/li>
&lt;li>OpenCost · documentación on-prem (modelo de precio por nodo) — &lt;a href="https://opencost.io/docs/configuration/on-prem/">https://opencost.io/docs/configuration/on-prem/&lt;/a>&lt;/li>
&lt;li>OpenCost · exporter de Prometheus — &lt;a href="https://opencost.io/docs/integrations/opencost-exporter/">https://opencost.io/docs/integrations/opencost-exporter/&lt;/a>&lt;/li>
&lt;li>CloudZero · Kubecost vs OpenCost (2026) — &lt;a href="https://www.cloudzero.com/blog/kubecost-vs-opencost/">https://www.cloudzero.com/blog/kubecost-vs-opencost/&lt;/a>&lt;/li>
&lt;li>CloudZero · FinOps Tools: Definitive Guide (2026) — &lt;a href="https://www.cloudzero.com/blog/finops-tools/">https://www.cloudzero.com/blog/finops-tools/&lt;/a>&lt;/li>
&lt;li>FOCUS · especificación (FinOps Foundation) — &lt;a href="https://focus.finops.org/focus-specification/">https://focus.finops.org/focus-specification/&lt;/a>&lt;/li>
&lt;li>SiliconANGLE · FOCUS y la economía de tokens de IA (FinOps X 2026) — &lt;a href="https://siliconangle.com/2026/06/08/focus-specification-ai-cost-accountability-finopsx/">https://siliconangle.com/2026/06/08/focus-specification-ai-cost-accountability-finopsx/&lt;/a>&lt;/li>
&lt;li>OpenLM · atribución de tokens en tiempo real (LiteLLM + FOCUS) — &lt;a href="https://www.openlm.com/enable-ai-finops-with-real-time-token-attribution/">https://www.openlm.com/enable-ai-finops-with-real-time-token-attribution/&lt;/a>&lt;/li>
&lt;li>Finout · Best AI Cost Observability Tools (2026) — &lt;a href="https://www.finout.io/blog/best-ai-cost-observability-tools-in-2026">https://www.finout.io/blog/best-ai-cost-observability-tools-in-2026&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>