litellm/enterprise/litellm_enterprise/proxy
ishaan-berri 7a9a9f0c79
fix: batch-limit stale managed object cleanup to prevent 300K row UPD… (#25258)
* fix: batch-limit stale managed object cleanup to prevent 300K row UPDATE (#25257)

* Add STALE_OBJECT_CLEANUP_BATCH_SIZE constant

Configurable batch limit (default 1000) for stale managed object cleanup,
preventing unbounded UPDATE queries from hitting 300K+ rows at once.

* Batch-limit stale managed object cleanup with single bounded SQL query

Two fixes to _cleanup_stale_managed_objects:

1. Replace unbounded update_many with a single execute_raw using a
   subquery LIMIT, capping each poll cycle to STALE_OBJECT_CLEANUP_BATCH_SIZE
   rows. Zero rows loaded into Python memory — everything stays in Postgres.
   Uses the same PostgreSQL raw-SQL pattern as spend_log_cleanup.py
   (the proxy requires PostgreSQL per schema.prisma).

2. Extract _expire_stale_rows as a separate method for testability.

Keeps the file_purpose='response' filter to avoid incorrectly expiring
long-running batch or fine-tune jobs that legitimately exceed the
staleness cutoff.

* docs: add STALE_OBJECT_CLEANUP_BATCH_SIZE to env vars reference

* test: remove deprecated embed-english-v2.0 cohere embedding tests
2026-04-06 19:11:55 -07:00
..
auth removed /models and v1/models from llm api routes (#20988) 2026-02-13 18:32:41 +05:30
common_utils fix: batch-limit stale managed object cleanup to prevent 300K row UPD… (#25258) 2026-04-06 19:11:55 -07:00
hooks feat(prometheus): add metrics for managed batch lifecycle 2026-03-27 20:30:09 +05:30
management_endpoints Org level tpm/rpm limits + Team tpm/rpm validation when assigned to org (#15549) 2025-10-25 13:40:29 -07:00
vector_stores litellm_fix(mypy): fix remaining type errors (#20164) 2026-01-31 10:25:23 -08: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 [Bug Fix] - Fix litellm_enterprise ensure imported routes exist (#17337) 2025-12-01 19:14:12 -08: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.)