From b601d8855b111069faf1d205f3bed322ed78f476 Mon Sep 17 00:00:00 2001 From: Milan Date: Thu, 19 Feb 2026 00:54:39 +0200 Subject: [PATCH] fix(router): resolve litellm_credential_name in get_deployment_credentials_with_provider When models are created via UI with pre-existing credentials, they use litellm_credential_name to reference credentials stored separately. The batch file upload endpoint uses get_deployment_credentials_with_provider() to retrieve model credentials, but this method was returning the credential reference name instead of resolving it to actual API keys and endpoints. This fix adds credential resolution using CredentialAccessor.get_credential_values() to ensure UI-created models work the same as YAML-configured models for batch file uploads and other passthrough endpoints. Fixes: Batch file uploads failing with 'Missing credentials' error for UI models --- litellm/router.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/litellm/router.py b/litellm/router.py index 4e268a94a2d..52ada36abf8 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -6750,6 +6750,13 @@ class Router: **deployment.litellm_params.model_dump(exclude_none=True) ).model_dump(exclude_none=True) + # Resolve litellm_credential_name to actual credentials + if deployment.litellm_params.litellm_credential_name is not None: + credential_values = CredentialAccessor.get_credential_values( + deployment.litellm_params.litellm_credential_name + ) + credentials.update(credential_values) + # Add custom_llm_provider if deployment.litellm_params.custom_llm_provider: credentials[