litellm/litellm
Yucheng Zhu f82ef6adf3 fix(ptu): bound the sentinel prune to the deployments a run scanned
The prune decides a sentinel row is garbage on staleness alone, which holds only while
every run derives its charges from the same table. Once a run's charges can depend on
configuration that only one host holds, a row it never considered is not evidence of
anything, and deleting it drops a charge another host is responsible for.

The loader now returns the deployment ids it looked at alongside the models it priced, and
the delete is bounded to that set. The set is wider than the priced set on purpose, so a
deployment that still exists but no longer carries PTU config stays prunable, and it is a
guaranteed superset of the priced set so a run cannot write a charge outside its own
filter. The ids go out in chunks, since each one is a bind variable and the server refuses
a statement carrying more than 32767 of them.

Behaviour change worth calling out: a deployment deleted from the model table keeps the
day it was already charged for, because nothing scans it any more and so nothing may judge
its row. That day the reservation did exist, and no later run revisits the date regardless.
2026-08-19 14:01:43 -07:00
..
a2a_protocol chore(typing): drop 1.3k basedpyright errors across 42 Any hotspot files 2026-08-19 01:12:41 +00:00
anthropic_interface chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
assistants chore(lint): clear grandfathered over-limit lint drift and ratchet budgets down 2026-08-05 12:18:13 -07:00
batch_completion feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
batches fix(batches): accept litellm_proxy in files and batches provider type literals 2026-08-18 13:28:06 -07:00
caching Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_fable_round3 2026-08-19 01:12:45 +00:00
completion_extras Merge remote-tracking branch 'origin/litellm_internal_staging' into pr36032_drive 2026-08-17 12:52:12 -07:00
compression chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
containers chore(typing): drop 1.3k basedpyright errors across 30 Any hotspot files 2026-08-16 03:56:02 +00:00
endpoints/speech/speech_to_completion_bridge feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
evals chore(typing): remove 914 basedpyright Any errors across 16 hotspot files 2026-08-10 01:24:40 -07:00
experimental_mcp_client fix(mcp): bound MCP client requests with a session read timeout (#36675) 2026-08-12 12:36:24 -07:00
files fix(batches): accept litellm_proxy in files and batches provider type literals 2026-08-18 13:28:06 -07:00
fine_tuning Merge branch 'litellm_internal_staging' into litellm_remove_types_ruff_exclusion 2026-08-05 11:05:33 -07:00
google_genai chore(typing): drop 1.3k basedpyright errors across 42 Any hotspot files 2026-08-19 01:12:41 +00:00
images chore(typing): clear 1.6k basedpyright Any errors across 56 files 2026-08-11 06:47:39 -07:00
integrations Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_fable_round3 2026-08-19 00:59:46 -07:00
interactions Merge pull request #36763 from BerriAI/litellm_decrease_anys_fable7 2026-08-13 13:24:47 -07:00
litellm_core_utils Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_fable_round3 2026-08-19 00:59:46 -07:00
llms Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_fable_round3 2026-08-19 00:59:46 -07:00
models feat(spend-logs): add lifecycle timestamps 2026-08-18 14:16:08 -07:00
ocr fix(ocr): reject invalid req_format values as 400 on the SDK path 2026-08-17 15:49:18 -07:00
passthrough fix(passthrough): protect accept-encoding from x-pass- forwarding 2026-08-15 15:34:28 -07:00
proxy fix(ptu): bound the sentinel prune to the deployments a run scanned 2026-08-19 14:01:43 -07:00
proxy_auth feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
rag chore(typing): remove 914 basedpyright Any errors across 16 hotspot files 2026-08-10 01:24:40 -07:00
realtime_api chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
repositories chore(typing): drop 1.3k basedpyright errors across 42 Any hotspot files 2026-08-19 01:12:41 +00:00
rerank_api chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
responses fix(responses): keep websocket response.create pass-through semantics 2026-08-19 01:45:42 +00:00
router_strategy feat(complexity_router): custom classifier plugins via classifier_type 'custom' (#37249) 2026-08-18 14:09:19 -07:00
router_utils Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_fable_round3 2026-08-19 00:59:46 -07:00
rust_bridge feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
sandbox feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
search chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
secret_managers chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
skills chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
types Merge pull request #37377 from BerriAI/devin_ai_lit5757_dashscope_nested_cache_creation 2026-08-18 20:02:17 -07:00
vector_store_files chore(lint): clear grandfathered over-limit lint drift and ratchet budgets down 2026-08-05 12:18:13 -07:00
vector_stores chore(typing): drop 1.3k basedpyright errors across 30 Any hotspot files 2026-08-16 03:56:02 +00:00
videos chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
__init__.py feat(guardrails): count bedrock guardrail cost against spend and budgets 2026-08-18 14:16:07 -07:00
_internal_context.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
_lazy_imports.py fix(lint): bring basedpyright rule counts back under their budget limits 2026-08-05 10:23:02 -07:00
_lazy_imports_registry.py chore(lint): clear grandfathered over-limit lint drift and ratchet budgets down 2026-08-05 12:18:13 -07:00
_logging.py fix(logging): close three secret-leak paths in verbose logging (#37391) 2026-08-19 01:03:34 +00:00
_redis.py fix(redis): unwrap decorated __init__s when deriving the from_url kwargs allowlist (#36654) 2026-08-15 11:52:08 -07:00
_redis_credential_provider.py chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
_service_logger.py chore(lint): clear grandfathered over-limit lint drift and ratchet budgets down 2026-08-05 12:18:13 -07:00
_uuid.py chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
_version.py
anthropic_beta_headers_config.json fix(bedrock-invoke): retain clear_tool_uses_20250919 context_management edits and emit context-management-2025-06-27 beta (LIT-3393) (#32658) 2026-07-09 14:31:27 -07:00
anthropic_beta_headers_manager.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
blog_posts.json
budget_manager.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
constants.py feat(complexity_router): custom classifier plugins via classifier_type 'custom' (#37249) 2026-08-18 14:09:19 -07:00
cost.json
cost_calculator.py chore(typing): drop 1.3k basedpyright errors across 42 Any hotspot files 2026-08-19 01:12:41 +00:00
exceptions.py chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
main.py fix: accept bool thinking param instead of crashing with AttributeError 2026-08-18 19:44:31 -07:00
model_prices_and_context_window_backup.json fix(databricks): match the claude 4.6 context limits to Anthropic's published values 2026-08-18 17:55:45 -07:00
policy_templates_backup.json
provider_endpoints_support_backup.json fix: address OCR greptile feedback 2026-06-24 17:05:05 -07:00
py.typed
router.py Merge branch 'litellm_internal_staging' of https://github.com/BerriAI/litellm into litellm_replica_registry_read_through 2026-08-19 00:48:03 -07:00
scheduler.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
setup_wizard.py chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
timeout.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
utils.py fix: accept bool thinking param instead of crashing with AttributeError 2026-08-18 19:44:31 -07:00