litellm/enterprise/litellm_enterprise/proxy
devin-ai-integration[bot] b2aff8be0f
fix(proxy): claim batch cost rows atomically so multi-pod polling can't double-bill (#37685)
Every pod and uvicorn worker schedules its own CheckBatchCost poller against the
shared managed-object table, so two of them can select the same completed batch in
one polling window and both write an aretrieve_batch spend log for it, counting
that batch's cost twice.

Claim the row with a compare-and-swap on batch_processed, and skip the batch when
another pod already holds it. The claim sits immediately before the spend log is
written rather than before the results fetch, because batch_processed is also what
blocks deletion of the files the fetch reads and what keeps an unbilled row
selectable by later poll cycles, so claiming up front would strand the spend of any
worker that died mid-fetch. A failed spend log write hands the row back.

Co-authored-by: Yassin Kortam <yassin@berri.ai>
2026-08-20 16:21:04 -07:00
..
auth chore(auth): require trusted proxy for header identity auth 2026-04-29 21:20:21 -07:00
common_utils fix(proxy): claim batch cost rows atomically so multi-pod polling can't double-bill (#37685) 2026-08-20 16:21:04 -07:00
hooks Merge pull request #37198 from BerriAI/litellm_lit5660_batches_limit_400 2026-08-17 15:53:46 -07:00
management_endpoints chore(typing): drop 1.3k basedpyright errors across 30 Any hotspot files 2026-08-16 03:56:02 +00:00
ui_crud_endpoints [Refactor] Proxy: tighten UI settings extras registry 2026-04-13 21:58:02 -07:00
vector_stores chore(typing): drop 1.3k basedpyright errors across 42 Any hotspot files 2026-08-19 01:12:41 +00:00
__init__.py Normalize OpenAI SDK BaseModel choices/messages to avoid Pydantic serializer warnings (#18972) 2026-01-14 03:40:11 +05:30
audit_logging_endpoints.py fix(audit): AND semantics for combined JSON filters; remove unused allTeams prop 2026-03-03 14:24:55 -08:00
enterprise_routes.py [Refactor] Proxy: move projects management to enterprise package 2026-04-13 21:41:12 -07:00
proxy_server.py build(ui/): UI - Public Model Hub v2 (#12532) 2025-07-11 22:24:31 -07:00
readme.md Expose /list and /info endpoints for Audit Log events (#11102) 2025-05-23 22:54:59 -07:00
utils.py [Refactor] Move enterprise_routes within litellm_enterprise (#10860) 2025-05-15 10:34:26 -07:00

LiteLLM Proxy Enterprise Features - Readme

Overview

This directory contains enterprise features used on the LiteLLM proxy.

Format

Create a file for every group of endpoints (e.g. key_management_endpoints.py, user_management_endpoints.py, etc.)

If there is a broader semantic group of endpoints, create a folder for that group (e.g. management_endpoints, auth_endpoints, etc.)