OpenCost 1.121.0: per-model LLM token cost & utilization
Adds llm-d: per-model per-token and hourly LLM costs, allocation vs usage and utilization exposed. 109-GPU/30-model POC surfaces allocation waste to cut GPU spend.
In brief
- OpenCost 1.121.0 integrated with llm-d to link LLM token streams and GPU costs, publishing Prometheus metrics and REST outputs; POC validated metrics on 109 GPUs and 30 models.
- Operators and FinOps teams can now measure per-model hourly and per‑million‑token costs (labeled by model, version, namespace, cost_basis, workload_type), exposing allocation versus usage to quantify GPU allocation waste.
- Leaders should examine utilization (usage/allocation per million tokens), apply the diagnosis matrix for sizing, validate KV‑cache effects, and integrate metrics into team chargeback and autoscaling decisions.
The problem
OpenCost 1.121.0 integrates with llm-d to publish Prometheus metrics (llm_total_hourly_cost, llm_cost_per_million_tokens) and REST outputs labeled by model_name, model_version, namespace, cost_basis and workload_type, separating allocation‑based and usage‑based costs and exposing a utilization metric (usage/allocation per million tokens). Validated in a 109‑GPU, 30‑model proof‑of‑concept, those metrics let platform and FinOps leaders quantify per‑model GPU allocation waste, use the diagnosis matrix to distinguish sizing, KV‑cache and hardware issues, and prioritize rightsizing, cache tuning or decommissioning to cut recurring GPU spend.
Why this happens
OpenCost’s llm-d integration ties vLLM token throughput (vllm:prompt_tokens_total, vllm:generation_tokens_total) to GPU and infra costs so operators get both allocation‑ and usage‑based views: new Prometheus metrics and REST outputs (llm_total_hourly_cost, llm_cost_per_million_tokens) report costs per model/version/namespace with cost_basis labels, and utilization is defined as usage‑per‑million / allocation‑per‑million. Allocation here explicitly includes GPU memory reserved for weights, active inference compute and a share of common infra (Inference Scheduler, llm‑d gateway, KV cache storage treated as allocation, Workload Variant Autoscaler via SharedLabels), while usage excludes reserved allocation and reflects KV‑cache savings — the 109‑GPU/30‑model POC validated these metrics and the diagnosis matrix for sizing and cache/hardware issues. The common mistaken assumption is treating usage‑based per‑token cost as “the” cost signal and ignoring allocation definitions and shared allocations; because allocation includes reserved GPU memory and KV cache as allocation cost and SharedLabels can surface non-obvious shared charges, teams that focus only on token-level usage will under‑estimate allocation waste, mis-prioritise tuning (e.g., autoscaler thresholds) over rightsizing or decommissioning, and miss savings the utilization ratio and diagnosis matrix are designed to reveal.
Framework
Per‑model cost observability
Confirm OpenCost publishes llm_total_hourly_cost and llm_cost_per_million_tokens (with model_name, model_version, namespace, cost_basis, workload_type labels) to Prometheus and the REST API, validate scraping, retention and dashboards; having these signals—validated in the 109‑GPU/30‑model POC—gives operators and FinOps teams the granularity needed to charge, compare and prioritise model spend.
Allocation vs usage
Verify the allocation‑based and usage‑based cost definitions (reserved GPU memory for weights, KV cache treated as allocation, active inference compute versus actual token work), compute utilization = usage_per_million/allocation_per_million and apply the diagnosis matrix to decide rightsizing, autoscaler tuning or decommissioning; this prevents treating per‑token usage as the sole cost signal and missing allocation waste.
KV‑cache and token accounting
Validate vLLM token metrics (vllm:prompt_tokens_total, vllm:generation_tokens_total), ensure input/output costs are separated and KV‑cache hit effects are reflected in usage‑based metrics; accurate per‑token accounting changes cost-per‑token math and can reprioritise optimisations (cache tuning vs scaling vs model consolidation).
SharedLabels and attribution
Confirm llm‑d components are labeled at deployment and that OpenCost SharedLabels distribute shared component costs (Inference Scheduler, gateway, KV cache storage, Workload Variant Autoscaler) to workloads/teams, then reconcile those allocations into chargeback and capacity plans; surfacing hidden shared charges avoids mis‑assigned savings and supports correct organisational decisions (rightsizing, cost‑sharing or decommissioning).
How to get started
- Install OpenCost 1.121.0 in staging and integrate with llm-d for Prometheus and REST metrics.
- Annotate llm-d deployments with SharedLabels via Terraform/Terragrunt for scheduler, gateway and KV cache.
- Configure Prometheus scrape jobs, 90d retention, and dashboards for llm_total_hourly_cost and llm_cost_per_million_tokens.
- Baseline utilization per model: run 30-day query of usage/allocation per million tokens; record low-util models.
- Prioritise top 10 models with utilization <25% for rightsizing, cache tuning, or decommissioning trials.
Risks & trade-offs
Strategic zoom-out
OpenCost 1.121.0’s llm-d integration — publishing llm_total_hourly_cost, llm_cost_per_million_tokens and a usage/allocation utilization ratio (validated in a 109‑GPU/30‑model POC) changes the operating model: cost becomes a metric for model lifecycle decisions rather than an after‑the‑fact FinOps exercise. Practically, platform teams should treat these Prometheus signals as primary controls: enforce deployment labeling for SharedLabels via IaC, guarantee scrapes and 90‑day retention, and compute a 30‑day baseline utilization per model to power chargeback and procurement decisions. Governance should add measurable SLOs (for example, flag models with utilization <25% for review), a monthly diagnosis‑matrix review that drives rightsizing, cache‑tuning, autoscaler parameter changes, or decommissioning, and reconcile shared allocations in chargeback reports. Over the next 12–24 months this will shift investment toward metric pipelines, KV‑cache and scheduler improvements and systematic rightsizing, enabling measurable GPU fleet reductions or reallocation of budget to higher‑value models.
Next steps we recommend
Stage OpenCost 1.121.0 with llm‑d, verify Prometheus scrapes and REST outputs for llm_total_hourly_cost and llm_cost_per_million_tokens (model_name, model_version, namespace, cost_basis labels), enforce SharedLabels via Terraform/Terragrunt, and run a 30‑day utilization baseline to flag models under 25% for rightsizing, cache tuning or decommissioning.