litellm/enterprise
Yassin Kortam 90e941a3f8 fix(proxy): attribute passthrough batch-cost spend to creating key/team/tags
Vertex and Anthropic passthrough batches built a UserAPIKeyAuth with an empty
api_key and forwarded no tags, so the managed-object row that CheckBatchCost
later reads carried no identity. At cost time the poller had a blank key, so
the batch-cost SpendLogs row was attributed to nobody (or dropped), leaving the
creating key at $0 with blank api_key/team_id/request_tags.

The request metadata already carries the authenticated hashed key, the
user/team ids and the request tags; the old handlers threw them away. Add
user_api_key and request_tags columns to LiteLLM_ManagedObjectTable (schema,
migration, Pydantic model) and persist them in store_unified_object_id, keeping
the identity in the DB row rather than the cached pydantic model. Both
passthrough handlers now go through one shared helper,
store_batch_managed_object, that reads the real identity out of the request
metadata. At cost time CheckBatchCost._build_creator_attribution_metadata
rebuilds the spend-tracking metadata from the row, resolving the key alias from
the hashed token and the team alias from the team id, so the batch-cost row is
attributed exactly like a non-batch request. _get_user_info short-circuits a
null user_id so the poller no longer issues find_unique(where={"user_id": None}),
and every lookup falls back gracefully for older rows that predate the two new
columns.
2026-07-15 13:45:52 -07:00
..
cloudformation_stack (fix) litellm cloud formation stack 2024-03-07 18:06:59 -08:00
dist BUMP Enterprise PIP 2026-02-14 13:40:48 -08:00
enterprise_hooks fix(guardrails): align banned_keywords + azure_content_safety call_type gates with runtime route_type 2026-05-04 21:27:24 +00:00
enterprise_ui Update README.md 2024-02-21 22:11:39 -08:00
litellm_enterprise fix(proxy): attribute passthrough batch-cost spend to creating key/team/tags 2026-07-15 13:45:52 -07:00
__init__.py (fix) error cli users see when importing enterprise folder 2024-03-15 08:10:45 -07:00
LICENSE.md docs: document new github + gitlab ci scripts 2026-03-25 20:17:10 -07:00
pyproject.toml bump: litellm-enterprise 0.1.49 -> 0.1.50, litellm-proxy-extras 0.4.76 -> 0.4.77, litellm 1.93.0 -> 1.94.0 (#33229) 2026-07-14 09:51:23 -07:00
README.md Fix enterprise doc link (#31815) 2026-07-09 11:48:11 -07:00

LiteLLM Enterprise

Code in this folder is licensed under a commercial license. Please review the LICENSE file within the /enterprise folder

These features are covered under the LiteLLM Enterprise contract

👉 Using in an Enterprise / Need specific features ? Meet with us here

See all Enterprise Features here 👉 Docs