From b77195d39d0bfb6779c6f51d20a258a63a5cb978 Mon Sep 17 00:00:00 2001 From: shivam Date: Thu, 10 Sep 2026 23:37:04 +0000 Subject: [PATCH] fix(proxy): preserve lint budget when clearing cache control points Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../model_management_endpoints.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/litellm/proxy/management_endpoints/model_management_endpoints.py b/litellm/proxy/management_endpoints/model_management_endpoints.py index b20f73b729b..46756c101cf 100644 --- a/litellm/proxy/management_endpoints/model_management_endpoints.py +++ b/litellm/proxy/management_endpoints/model_management_endpoints.py @@ -130,6 +130,9 @@ if TYPE_CHECKING: router: Final = APIRouter() CLEARABLE_LITELLM_PARAMS: Final = frozenset({"cache_control_injection_points"}) +NULL_CLEARABLE_LITELLM_PARAMS: Final = frozenset( + (*SPECIAL_MODEL_INFO_PARAMS, *CLEARABLE_LITELLM_PARAMS) +) async def update_team(*args, **kwargs): @@ -762,13 +765,12 @@ def update_db_model(db_model: Deployment, updated_patch: updateDeployment) -> Pr # CLEARABLE_LITELLM_PARAMS lists non-mirrored litellm_params that explicit null may clear. if updated_patch.litellm_params: for field in updated_patch.litellm_params.model_fields_set: - if getattr(updated_patch.litellm_params, field) is not None: - continue - if field in SPECIAL_MODEL_INFO_PARAMS: + if ( + getattr(updated_patch.litellm_params, field) is None + and field in NULL_CLEARABLE_LITELLM_PARAMS + ): merged_litellm_params.pop(field, None) merged_model_info.pop(field, None) - elif field in CLEARABLE_LITELLM_PARAMS: - merged_litellm_params.pop(field, None) if updated_patch.model_info: for field in updated_patch.model_info.model_fields_set: if field in SPECIAL_MODEL_INFO_PARAMS and getattr(updated_patch.model_info, field) is None: