unalloc
Open-source AI cost attribution · v0.2.1

Find the AI spend nobody owns.

unalloc joins OpenCost Kubernetes allocations with LiteLLM, OpenAI and Anthropic bills into one exact ledger and reports how much of your AI spend has no owner. Six case studies, one of them on a real H100, show where that attribution breaks.

pip install unallocPreprint, not yet peer revieweddoi:10.5281/zenodo.22761013
AI spend · sample month15 lines · 4 sources
  1. opencost · inference/vllm-llama-70b$19,147.10→ no owner
  2. opencost · inference/llm-d-gateway$9,961.12→ platform
  3. opencost · __idle__$6,070.00→ no owner
  4. litellm · claude-opus-5$5,412.75→ no owner
  5. opencost · batch/embeddings-worker$4,598.50→ no owner
  6. anthropic · claude-sonnet-4-6 input$4,102.18→ no owner
  7. litellm · claude-sonnet-4-6$3,204.90→ platform
  8. + 8 smaller lines$14,133.83
team: platform$13,166.02
team: search$4,481.22
total$66,630.38
no owner · 73.5%$48,983.14

$ unalloc report --fixtures --dimension team

Findings

Where attribution breaks

Most failures happen where systems meet, not inside any one of them. Each number is read from the study's results when this page is built, and links to them.

  • 66%

    of a distributed deployment's GPU bill had no owner when team was set only on LeaderWorkerSet leader pods.

  • 61%

    of that bill resolved to a Helm chart name after the obvious fallback label, while the headline unallocated share fell to 4%.

  • 12–14 pts

    difference in a retrieval-heavy tenant's share between a token meter and an equal time-share meter, on an H100 running vLLM, at every load tested.

  • 97–99%

    GPU utilization at every load while throughput rose 7×. Power draw (469 W → 660 W) tracked the work; utilization did not.

  • $11,815

    of gateway spend counted twice when the gateway and the provider bills were both turned on, in a $41,420 month.

  • 24%

    of true provider spend reported by billing adapters that read only the first page of results. Fixed in 0.2.0.

Case studies

Six studies, one ledger

Each study emits payloads in the providers' own formats and runs them through unalloc's real adapters. Raw data and scripts are in the repository.

Figure from the Real vLLM on an H100 studyreal serving

Real vLLM on an H100

vLLM 0.29.0 serving Qwen2.5-7B-Instruct on a DigitalOcean H100, driven with four tenants at 2–16 requests/s. 6,241 requests, 0 errors, about $2.15.

Token and time-share meters disagree by 12–14 points on the RAG tenant; utilization reads 97–99% at every load.

Code and data →
Figure from the Distributed inference studyreal inference

Distributed inference

Tensor- and pipeline-parallel inference on torch.distributed, verified token-identical to a single process, then a month of LeaderWorkerSet allocations.

Leader-only labels leave 66% unowned; falling back to name sends 61% to a chart name.

Code and data →
Figure from the A transformer with a real KV cache studyreal inference · CPU

A transformer with a real KV cache

A from-scratch PyTorch decoder serving a 96-request, four-tenant trace, with cached decoding checked against recomputation.

Token counting and measured compute disagree by 33 points of the pool; less on a batching GPU.

Code and data →
Figure from the A shared vLLM-style pod studysimulation

A shared vLLM-style pod

Discrete-event engine with paged KV blocks, prefix caching, chunked prefill and continuous batching, metered five ways.

Step time sees almost no idle capacity; KV memory leaves 83% of the bill with no request.

Code and data →
Figure from the Joining gateway and provider ledgers studyreal CLI · synthetic spend

Joining gateway and provider ledgers

The unmodified CLI against mock OpenCost, LiteLLM, OpenAI and Anthropic APIs with real auth schemes and cursor pagination.

Every source on double counts all gateway spend; the gateway alone covers 72% of invoices.

Code and data →
Figure from the Use cases studymixed

Use cases

Labeling Pareto, per-feature unit economics, self-host break-even and a CI budget gate on the same ledger.

Three label fixes take a 67%-unallocated org to 1.9%.

Code and data →
Use cases

What to do with the joined ledger

Fix the labels that matter

Sort unowned spend by dollars. In the hybrid-org study three label changes took unallocated spend from 66.9% to 1.9%.

unalloc labels --dimension team

Cost a feature end to end

Join cluster and API rows on a feature label. A RAG answer cost $22.32 per 1k requests with its vector database, $13.38 counting the LLM bill alone.

unalloc report --dimension feature

Decide build versus buy

One self-hosted GPU beat a mid-tier API above about 0.23 requests/s and a small-tier API above about 1.7 requests/s in the simulation. Utilization decides it, not list price.

python -m case_studies.use_cases

Gate deploys on ownership

Fail CI when too much spend has no owner. Exit code 2 above the budget.

unalloc report -D team --budget 10
Read

Paper, posts and runbook

Cite

Citing unalloc

Release 0.2.1 is archived on Zenodo at doi:10.5281/zenodo.22761013, the code the paper describes.

@software{urista_unalloc_2026,
  author  = {Urista, Timothy},
  title   = {unalloc: find the AI spend nobody owns},
  version = {0.2.1},
  year    = {2026},
  doi     = {10.5281/zenodo.22761013},
  url     = {https://github.com/timurista/unalloc}
}