Skip to content

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]

Merge branch 'litellm_internal_staging' into devin_ai_fix_bedrock_batch_file_bytes_36388

mateo-berri904ff9efa792
diff --cc litellm/llms/bedrock/files/transformation.py
index d5e7957a1a9,7d13ae82a6c..0f0a0f91024
--- a/litellm/llms/bedrock/files/transformation.py
+++ b/litellm/llms/bedrock/files/transformation.py
@@@ -62,12 -64,8 +64,12 @@@ from ..common_utils import BedrockError
# Same pattern as the `upload_url` handoff in `transform_create_file_request`.
S3_SIGNED_GET_HEADERS_PARAM: Final = "_s3_signed_get_headers"
+# litellm_params key carrying the size of the body uploaded to S3, handed from
+# `transform_create_file_request` to `transform_create_file_response`.
+UPLOAD_CONTENT_LENGTH_PARAM: Final = "_s3_upload_content_length"
+
- def _frozen_mapping(items: Iterable[tuple[str, Any]]) -> Mapping[str, Any]:
+ def _frozen_mapping(items: Iterable[tuple[str, object]]) -> Mapping[str, object]:
return MappingProxyType(dict(items))
@@@ -877,7 -924,6 +940,8 @@@ class BedrockFilesConfig(BaseAWSLLM, Ba
)
litellm_params["upload_url"] = api_base
- litellm_params[UPLOAD_CONTENT_LENGTH_PARAM] = len(file_content.encode("utf-8"))
++ upload_content_length: Final = len(file_content.encode("utf-8"))
++ litellm_params[UPLOAD_CONTENT_LENGTH_PARAM] = upload_content_length # rebind-ok: same handoff as upload_url
# Return a dict that tells the HTTP handler exactly what to do
return {