LiteLLM session over its budget? Check what the budget counts
Review recorded session spend against a supplied cap, see which session IDs span keys or agents, and check whether the export records budget rejections.
What you'll see
Example output from the synthetic sample below; your numbers will reflect your export and supplied cap.
3 of 4 sessions with complete recorded spend exceed the supplied USD 1.00 cap.
The report prints the exact period immediately below its result. The short sample uses its observed span. Sessions active near an uncovered file edge are marked possibly clipped; a matching session ID with rows outside a selected period is marked clipped.
Observed session totals
Recorded USD: p50 1.10; p95 1.60; max 1.60 (n=4, exact nearest-rank).
Logged model calls: p50 2; p95 6; max 6 (n=4, exact nearest-rank).
Half the observed sessions have recorded spend at or below USD 1.10. Each distribution prints its own sample count; incomplete spend is kept separate. The largest sessions use keyed aliases.
Cap review
Above-cap sessions with no recorded session-budget rejection: 2.
Start with these review items. Check last-call or parallel-call overshoot, the counter window, agent budget configuration and failure logging. The report also counts sessions with recorded budget or iteration rejections.
Sessions spanning more than 3600 seconds between first and last positive-spend request starts: 1.
session-1: 4000 seconds.
This is the elapsed time in the records; the duration line alone cannot establish that a reset occurred.
Session IDs observed under multiple keys, teams or agents: 1. Each addresses the same counter key; shared storage and agent budget configuration determine actual tracking.
session-1: keys=2, teams=2, agents=2.
The same session ID can join activity across agents. Review these aliases when you expected separate session budgets.
Why sessions end up over the cap
- The pinned LiteLLM v1.104.0 limiter checks spend already recorded before each call (
current_spend >= max_budget) and adds positive cost after a successful call. The call that crosses the cap can run; concurrent calls can all pass while recorded spend is still below it. See the upstream concurrency report. - The counter key uses the session ID alone, so budget-tracked agents using that ID share the counter. See the upstream report on shared session limits across agents.
- LiteLLM documents a one-hour default counter expiry, configurable with
LITELLM_MAX_BUDGET_PER_SESSION_TTL.
No data handy? Try the sample
git clone --depth 1 --branch v0.8.0 https://github.com/llm-measurement/fleetdiff.git fleetdiff-session-budget
cd fleetdiff-session-budget
sh scripts/install.sh v0.8.0 ./release
./release/fleetdiff investigate --litellm-spend examples/litellm-spend/session-budget.csv \
--session-budget-usd 1.00
Recorded session totals are review evidence, not an enforcement verdict or completed-task costs. Missing identities stay unattributed; absent recorded rejections do not prove that no rejection occurred.
Measurement notes