mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-29 09:08:27 +00:00
f351bbdb36
Instead of hardcoding SPEND_PER_REQUEST (which broke when the model changed from gpt-3.5-turbo-0301 to gpt-3.5-turbo), make a single calibration request first, poll for its spend, and use that as the per-request cost. Fails fast with pytest.fail() after 5 retries if calibration cannot determine the cost. Also fixes a bug in test_basic_spend_accuracy where the user spend assertion error message referenced user_info['info'] instead of user_info['user_info']. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>