mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
The batches suite's test_rate_limited_batch_create_leaves_no_unattributed_spend_row snapshots every unattributed spend row twice through spend_logs(SpendLogsParams()), which used the deprecated, unpaginated /spend/logs. With no filter that endpoint runs find_all over the whole LiteLLM_SpendLogs table, heavy message/response columns included, so against a shared staging database the response OOM-killed the e2e pod mid-test and the run restarted from preflight every time, always dying at that same test Repoint Gateway.spend_logs at /spend/logs/v2, which is paginated, drops the heavy columns, and caps the row count. It walks every page over a bounded default window and returns the same list[SpendLogRow], so the ~15 poll_logs_for_key / spend_logs callers are untouched. v2 requires an explicit date window and matches the token as stored (a SHA-256 hash) rather than the raw sk- key, so spend_logs fills a bounded window when the caller gives none and hashes an sk- key the way the proxy hashes it; the window and pagination fields are added to SpendLogsParams |
||
|---|---|---|
| .. | ||
| access_control | ||
| batches | ||
| coverage_registry | ||
| llm_translation | ||
| logging | ||
| management | ||
| quota_management | ||
| bob_the_builder.py | ||
| CLAUDE.md | ||
| conftest.py | ||
| CONTRIBUTING.md | ||
| docker-compose.yml | ||
| e2e_config.py | ||
| e2e_gateway.py | ||
| e2e_http.py | ||
| lifecycle.py | ||
| models.py | ||
| pytest.ini | ||
| test_e2e_gateway.py | ||
| test_lifecycle.py | ||
| test_transport.py | ||
| transport.py | ||