mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-01 01:18:34 +00:00
CheckBatchCost's cost-tracking path downloaded a completed batch's output file and parsed it into a List[dict], keeping the full base64 image payloads of Gemini image-gen responses resident on top of the raw bytes; two json.dumps(..., indent=4) debug calls also re-serialized that whole structure unconditionally because the argument was evaluated before the log-level check. The scheduled job had no leader election, so every worker/pod polled and buffered the same files at once. - add calculate_batch_cost_and_usage_from_content: a single-pass fold over the JSONL output that keeps peak memory bounded to the raw bytes plus one row, preserving cost/usage/model/status behavior across providers - guard the json.dumps debug serialization behind isEnabledFor(DEBUG) - gate the poll behind PodLockManager so only the lock holder runs each cycle when Redis is configured, injected via the constructor with a fallback to the shared manager; unchanged unlocked behavior with no Redis Fixes #33955 |
||
|---|---|---|
| .. | ||
| enterprise_callbacks | ||
| integrations | ||
| litellm_core_utils | ||
| proxy | ||
| types | ||
| __init__.py | ||