LLM Measurement
LLM Measurement is a set of open-source tools for understanding LLM usage: what changed, who drove it, and whether the usage records support the answer. They work from the telemetry you already collect, without a metric label for every user, and their outputs carry keyed hashes instead of raw user or session IDs.
They are designed with care and built on peer-reviewed sketching algorithms. Rankings come with guaranteed bounds, distinct counts come with a known statistical error, and missing usage is counted separately as missing. Every result on this site comes with the commands to reproduce it.
Run it on your data
Choose the path for the data or application you already have.
Have LiteLLM spend logs?
Investigate directly from your LiteLLM database using approved read-only access, or use an existing spend.csv below. The database path exports and cleans up a private snapshot automatically. For a file, include 16 days for the default comparison.
curl -fsSLo install-fleetdiff.sh https://raw.githubusercontent.com/llm-measurement/fleetdiff/45f8d7aef43a88e1c24033a9f80c4a667f8dbad7/scripts/install.sh
sh install-fleetdiff.sh v0.14.1 ./bin
./bin/fleetdiff investigate --litellm-spend ./spend.csv --group-by user
Have OpenTelemetry traces?
Make a short local OTLP capture, save it as traces.jsonl, then use the same installed binary:
./bin/fleetdiff inspect ./traces.jsonl
For continuous measurement, deploy the collector in your own pipeline with Helm chart 0.7.5 and collector v0.7.4; keep your existing trace backend.
Use Python or Go?
Install llm-sketchkit v0.4.0 and supply your application's user IDs and token counts. The distinct-user and heaviest-user guides read a local CSV. Python requires 3.11+; Go requires 1.26+.
python3 -m venv .venv
.venv/bin/python -m pip install --no-cache-dir llm-sketchkit==0.4.0
mkdir measurement-go
cd measurement-go
go mod init example.com/measurement
go get github.com/llm-measurement/llm-sketchkit/go/sketchkit/...@v0.4.0
Built for enterprise review
- Analysis of local files you choose.
- Read-only SQL that excludes prompts and responses.
- Pseudonymous keyed identifiers.
- Signed releases with build provenance and SBOMs; Apache-2.0.
Guides
- Which user is driving my token spike?
Usage jumped? Compare two periods and see which users and sessions account for the increase.
- Who is tokenmaxxing? Find your heaviest AI token users
No spike needed: rank who uses the most tokens in a period, and see how concentrated usage is.
- Why did our LiteLLM usage jump, and are the spend logs complete?
The same comparison straight from LiteLLM's spend logs, plus a check on whether the records are complete.
- What changed in your Langfuse costs?
Compare a local export to find model and trace contributors to recorded cost and token changes.
- Which agent drove your LLM spend increase?
Compare recorded agent spend, with unknown and ambiguous identities kept in the totals.
- Are all our requests actually in the spend log?
Compare exported spend rows with LiteLLM's daily request counts and see any missing rows.
- Which models served each LiteLLM route?
Compare recorded model, token and spend shares by route or agent, with missing attribution and classifier overhead shown separately.
- What would switching models have cost?
Re-price recorded usage under a proposed model mix, with measured workload factors and explicit assumptions.
- LiteLLM session over its budget? Check what the budget counts
Review recorded session spend against a cap, shared session IDs and recorded rejections from a local LiteLLM spend export.
- Prompt cache hit rate dropped after an update? Find whose uncached input grew
Prompt cache hit rate dropped after an update? Compare recorded cache shares and find which keys or sessions added uncached input with fleetdiff.
- How do I see LLM usage per user without a metric label for every user?
Check a collector configuration with fleetdiff diagnose and keep user rankings out of metric labels.
- Which windows look unusual?
Scan usage history for changes in tokens, coverage and contributors.
- Do my LLM traces record token usage and user IDs?
Check a local OTLP capture for usage and identity fields that are present, missing or zero.
- How many distinct users were active?
Count with keyed measurements that can be merged across workers.
Why summaries instead of raw logs? See the measured sharing and retention properties, with source data and methods.
Studies
- Same Prompt, Same Cache, Opposite Bills
Prompt caching can raise an LLM bill. The break-even math, parallel sub-agents and the reads versus writes in your logs.
- Haiku 5.5 is 20× cheaper than Sonnet on paper, 3.4× on a Claude Code trace
A 233-session trace shows how the 100,000-token tier and cache-read discounts change the price-sheet comparison.

Choose a tool
fleetdiff investigates LiteLLM databases with explicit read-only access, or reads local spend exports, trace captures and summary files offline. The Collector connector creates metrics and summaries continuously. llm-sketchkit supplies the measurement library for Go services and Python analysis.