From 03fc76ed8d2209a59d6df3b8c7ea44ee6d9aede5 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 6 Nov 2026 14:31:42 -0800 Subject: [PATCH] fix(bedrock): keep skipping a non-string runtime endpoint Backport to lts/1.108.x ahead of its main PR. Cherry-picked from ec312bb5e9 (litellm_fix_bedrock_empty_api_base). --- litellm/llms/bedrock/base_aws_llm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/llms/bedrock/base_aws_llm.py b/litellm/llms/bedrock/base_aws_llm.py index 2c72a491b3c..0c4151b4b1b 100644 --- a/litellm/llms/bedrock/base_aws_llm.py +++ b/litellm/llms/bedrock/base_aws_llm.py @@ -1526,7 +1526,10 @@ class BaseAWSLLM(SignsRequestsWithAWS): aws_region_name: str, endpoint_type: Literal["runtime", "agent", "agentcore"] | None = "runtime", ) -> tuple[str, str]: - runtime_endpoint: Final = aws_bedrock_runtime_endpoint or get_secret_str("AWS_BEDROCK_RUNTIME_ENDPOINT") + configured_endpoint: Final = ( + aws_bedrock_runtime_endpoint if isinstance(aws_bedrock_runtime_endpoint, str) else None + ) + runtime_endpoint: Final = configured_endpoint or get_secret_str("AWS_BEDROCK_RUNTIME_ENDPOINT") endpoint_url: Final = ( api_base or runtime_endpoint