From 9aee0b4a0f2d24ae9edfcc5e5825025ac18ec63a Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Tue, 11 Jun 2024 16:34:32 +0000 Subject: [PATCH] fix(bedrock_httpx.py): Fix STS region endpoint for converse flow. --- litellm/llms/bedrock_httpx.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litellm/llms/bedrock_httpx.py b/litellm/llms/bedrock_httpx.py index 6d4c04fb1c6..ee0ae57b428 100644 --- a/litellm/llms/bedrock_httpx.py +++ b/litellm/llms/bedrock_httpx.py @@ -1446,7 +1446,11 @@ class BedrockConverseLLM(BaseLLM): status_code=401, ) - sts_client = boto3.client("sts") + sts_client = boto3.client( + "sts", + region_name=aws_region_name, + endpoint_url=f"https://sts.{aws_region_name}.amazonaws.com" + ) # https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts/client/assume_role_with_web_identity.html