litellm/tests/test_litellm/enterprise/proxy
yucheng-berri 8bfb7772e4
fix(batches): attribute Anthropic passthrough batch cost to the creating key, team and tags (#36468)
The Anthropic batch create never persisted the creating key's hashed token or its
request tags on the managed object, so when CheckBatchCost billed the batch hours
later there was nothing to attribute it to. Key spend, key budgets and tag spend
never moved for batch usage.

Persist both from the create, the way the Vertex passthrough already does, and
register the batch only from the collection route. An id-scoped route cannot
rebuild the unified object id, because it embeds the model and the model comes
from the create's request body, so it could only claim a row it did not create or
fail the model_object_id unique constraint.

The shared metadata helpers, the route predicate and the registration-result
logging now live in batch_attribution instead of being copied per provider. The
Anthropic write previously logged success unconditionally, before the
fire-and-forget task had run.

Resolves LIT-5288
2026-08-11 20:52:43 -07:00
..
__init__.py [Bug Fix] - Fix litellm_enterprise ensure imported routes exist (#17337) 2025-12-01 19:14:12 -08:00
test_afile_retrieve_returns_unified_id.py fix: afile_retrieve returns unified ID for batch output files 2026-02-14 10:07:12 -05:00
test_batch_retrieve_input_file_id.py fix: batch retrieve returns unified input_file_id 2026-02-14 11:24:08 -05:00
test_batch_retrieve_registers_missing_output_file_id.py fix(proxy): register managed batch output files on terminal retrieve (#34092) 2026-08-05 16:38:49 -07:00
test_batch_retrieve_returns_unified_input_file_id.py fix(proxy): register managed batch output files on terminal retrieve (#34092) 2026-08-05 16:38:49 -07:00
test_batch_update_db_managed_output_file_id.py fix(batches): keep batch state in sync on a poll without claiming attribution (#34456) 2026-08-08 16:01:47 -07:00
test_deleted_file_returns_403_not_404.py Addressed greptile comments to extract common helpers and return 404 2026-02-16 07:58:04 -05:00
test_enterprise_routes.py [Bug Fix] - Fix litellm_enterprise ensure imported routes exist (#17337) 2025-12-01 19:14:12 -08:00
test_file_deletion_blocking.py Fixes based on greptile reviews 2026-02-18 12:19:11 +05:30
test_managed_files_access_check.py fix(managed_batches): convert raw output_file_id to managed ID in CheckBatchCost poller (#27984) 2026-05-15 04:41:38 -07:00
test_managed_files_hook.py fix(batches): attribute Anthropic passthrough batch cost to the creating key, team and tags (#36468) 2026-08-11 20:52:43 -07:00