The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(proxy): skip allowlist rewrite when the model name is unchanged
ryande0047c802d9
diff --git a/litellm/proxy/management_helpers/model_allowlist_rename_sync.py b/litellm/proxy/management_helpers/model_allowlist_rename_sync.pyindex d0857aae748..1e92c383f01 100644--- a/litellm/proxy/management_helpers/model_allowlist_rename_sync.py+++ b/litellm/proxy/management_helpers/model_allowlist_rename_sync.py@@ -95,6 +95,8 @@ async def sync_model_allowlists_for_renamed_model(llm_router: Router | None,user_api_key_cache: UserApiKeyCache,) -> None:+ if old_name == new_name:+ returnexecutor: Final = raw_executor(prisma_client)old_name_still_backed: Final = await still_backed(executor, llm_router, old_name, model_id)for allowlist in _ALLOWLIST_TABLES:diff --git a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.pyindex d164fa28c10..0f273ebce84 100644--- a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py@@ -6315,6 +6315,28 @@ class TestAccessGroupModelSync:assert 'WHERE $1 = ANY("models") AND NOT ($2 = ANY("models"))' in update_call.args[0]assert update_call.args[1:] == ("gpt-5.6", "gpt-5.6-eu")+ @pytest.mark.asyncio+ async def test_unchanged_name_never_touches_allowlists(self):+ from litellm.proxy.management_helpers.model_allowlist_rename_sync import (+ sync_model_allowlists_for_renamed_model,+ )++ mock_prisma = self._prisma_with_row("m-rename", "gpt-5.6", deployment_count=0)+ evict = AsyncMock()++ with patch(self._EVICT, new=evict):+ await sync_model_allowlists_for_renamed_model(+ prisma_client=mock_prisma,+ model_id="m-rename",+ old_name="gpt-5.6",+ new_name="gpt-5.6",+ llm_router=None,+ user_api_key_cache=MagicMock(),+ )++ assert self._allowlist_updates(mock_prisma) == {}+ evict.assert_not_awaited()+class TestTeamMemberAutoRouterWrites:@pytest.fixture(autouse=True)