From 0cedc7ed8046c71013f4e90a7f7b4388a0c6b5e0 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Thu, 8 Oct 2026 23:16:26 -0700 Subject: [PATCH] fix(proxy): ignore a display_name set on config credential_list entries so non-string values cannot fail boot --- litellm/proxy/proxy_server.py | 3 ++- .../proxy/proxy_server/test_proxy_config.py | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 4493f53e93a..67fec38e39e 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -6314,7 +6314,8 @@ class ProxyConfig: credential_list = [] if credential_list_dict: credential_list = [ - CredentialItem.model_validate({**cred, "source": "config"}) for cred in credential_list_dict + CredentialItem.model_validate({**cred, "display_name": None, "source": "config"}) + for cred in credential_list_dict ] return credential_list diff --git a/tests/unit/proxy/proxy_server/test_proxy_config.py b/tests/unit/proxy/proxy_server/test_proxy_config.py index 04a06454a8b..c8c89662583 100644 --- a/tests/unit/proxy/proxy_server/test_proxy_config.py +++ b/tests/unit/proxy/proxy_server/test_proxy_config.py @@ -1874,6 +1874,23 @@ def test_ProxyConfig_load_credential_list_tags_every_entry_as_config_defined(): assert [(cred.credential_name, cred.source) for cred in creds] == [("plain", "config"), ("claims-db", "config")] +@pytest.mark.parametrize("display_name", [2024, True, "Azure Prod"]) +def test_ProxyConfig_load_credential_list_ignores_a_display_name_set_in_config(display_name): + creds = ProxyConfig().load_credential_list( + { + "credential_list": [ + { + "credential_name": "azure_cred", + "display_name": display_name, + "credential_info": {}, + "credential_values": {"api_key": "sk-x"}, + } + ] + } + ) + assert [(cred.credential_name, cred.display_name) for cred in creds] == [("azure_cred", None)] + + def test_ProxyConfig_load_credential_list_invalid_entry_raises(): pc = ProxyConfig() with pytest.raises(ValidationError):