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
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_bedrock_sign_request_off_loop
mateo-berri6bfcfdbc5013
diff --cc litellm/llms/bedrock/embed/embedding.pyindex e5f94e51e6d,d3725434498..d0e8d734c5e--- a/litellm/llms/bedrock/embed/embedding.py+++ b/litellm/llms/bedrock/embed/embedding.py@@@ -42,20 -41,6 +42,20 @@@ if TYPE_CHECKINGfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj+def _sign_get_request(+ credentials: Credentials, url: str, headers: Mapping[str, str], aws_region_name: str+) -> AWSPreparedRequest:+ try:+ from botocore.auth import SigV4Auth+ from botocore.awsrequest import AWSRequest+ except ImportError:+ raise ImportError("Missing boto3 to call bedrock. Run 'pip install boto3'.")+- request: Final = AWSRequest(method="GET", url=url, data=None, headers=dict(headers))++ request: Final = AWSRequest(method="GET", url=url, data=None, headers=headers)+ SigV4Auth(credentials, "bedrock", aws_region_name).add_auth(request)+ return request.prepare()++class BedrockEmbedding(BaseAWSLLM):@overloaddef _load_credentials(diff --cc litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.pyindex 6eb7b5d8541,2ea46b740a8..6085bc2bfce--- a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py+++ b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py@@@ -1178,25 -1177,6 +1178,25 @@@ async def bedrock_proxy_routereturn received_value+def _sign_aws_json_post(+ get_credentials: Callable[[], Credentials],+ service_name: str,+ aws_region_name: str | None,+ url: str,+ body: str,+ headers: Mapping[str, str],+) -> AWSPreparedRequest:+ try:+ from botocore.auth import SigV4Auth+ from botocore.awsrequest import AWSRequest+ except ImportError:+ raise ImportError(f"Missing boto3 to call {service_name}. Run 'pip install boto3'.")+- aws_request: Final = AWSRequest(method="POST", url=url, data=body, headers=dict(headers))++ aws_request: Final = AWSRequest(method="POST", url=url, data=body, headers=headers)+ SigV4Auth(get_credentials(), service_name, aws_region_name).add_auth(aws_request)+ return aws_request.prepare()++COMPREHEND_MEDICAL_TARGET_PREFIX: Final = "ComprehendMedical_20181030"diff --cc tests/test_litellm/llms/custom_httpx/test_llm_http_handler.pyindex 6799850c4ae,98a5f4b2db5..b5eb98c4ce6--- a/tests/test_litellm/llms/custom_httpx/test_llm_http_handler.py+++ b/tests/test_litellm/llms/custom_httpx/test_llm_http_handler.py@@@ -29,9 -29,7 +29,10 @@@ from litellm.llms.custom_httpx.llm_http_rust_responses_websocket_enabled,)from litellm.llms.azure.videos.transformation import AzureVideoConfig+from litellm.llms.bedrock.messages.invoke_transformations.anthropic_claude3_transformation import (+ AmazonAnthropicClaudeMessagesConfig,+)+ from litellm.llms.mistral.ocr.transformation import MistralOCRConfigfrom litellm.llms.openai.videos.transformation import OpenAIVideoConfigfrom litellm.types.llms.openai import ResponsesAPIResponsefrom litellm.types.router import GenericLiteLLMParams