mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
Per-router auto-router savings were missing on proxies with disable_spend_logs and for requests without a session id under missing_session_id: omit. The router-day row is written by the auto-router turn, whose enqueue sat behind the spend-logs flag and whose builder dropped sessionless requests, while LiteLLM_DailyUserSpend has neither gate. That money then showed only as unattributed savings. Enqueue the turn whether or not spend logs are kept, and keep a sessionless turn with an empty session id that writes the router-day row while the session upserts skip it. The day and session rows still commit in one statement, so late baseline corrections keep their ordering. Without spend logs, write only the router-day aggregate: the turn drops its session id, so no per-session row is stored, and baseline capture is skipped, since a baseline observation can only publish once its request's spend log exists. The flag keeps its meaning of no per-request or per-session data, while the daily per-router money matches LiteLLM_DailyUserSpend. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| test_autorouter_session_rollup.py | ||
| test_baseline_accounting.py | ||
| test_cache_activity.py | ||