LLM MeasurementGitHub
Guides

How do I detect anomalies in LLM token consumption?

Scan retained summary windows to find unusual token use, concentrated users or sessions, tool errors and gaps in usage reporting.

Start retaining windows

Set up summary export and retention with collector v0.7.4 / chart 0.7.5. When upgrading from 0.6.x, review the private-key and NetworkPolicy requirements before deploying. Schedule scans as new windows arrive.

Security

See the security reference.

Try the sample

Linux or macOS; needs curl, gh, shasum and tar. The installer checks the release before unpacking it.

Go 1.26.9 or later generates the synthetic windows.

curl -fsSLo fleetdiff-source.tar.gz https://github.com/llm-measurement/fleetdiff/archive/refs/tags/v0.14.1.tar.gz
tar -xzf fleetdiff-source.tar.gz
cd fleetdiff-0.14.1
sh scripts/install.sh v0.14.1 ./release
GOWORK=off go run ./examples/scan --out ./synthetic-windows
./release/fleetdiff scan ./synthetic-windows --expected app --recent 2 \
  --as-of 2026-10-04T00:30:00Z

What you'll see

Example output from this synthetic sample; your values will reflect your input.

The example history produces two unusual windows.

2 unusual windows among 2 checked.

In the first window, tokens per attempt rise to 3.1 times the baseline and one session now holds 62% of tokens.

2026-10-04T00:28:00Z
  reported tokens per attempt: 310.00; typical 100.00 (3.10x).
  session-1 now holds 62% of tokens (newly prominent in this scan).

The following window has missing usage on 40% of attempts. This is a coverage change, not evidence of lower usage.

2026-10-04T00:29:00Z
  Missing usage: 40.00% of model attempts; typical 0.00% (coverage change, not lower usage).

When a window reports missing usage, check the fields in a local capture: Do my LLM traces record token usage and user IDs?

Exit code 3 means findings were detected; 0 means none were found.

The fixed --as-of date reproduces this sample.

Source and reproduction: released history generator and tests. Verification record.

What the numbers mean

This example checks planted changes. Review any flag against your own history; sessions that turn over often can look newly prominent.
Measurement notes

evijay+fleetdiff@gmail.com · Questions · Ran it on your data? Tell us what it found · Security issues (private)