From c9e62b76c4e46365a7bbb047a487a6e18792ee6e Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Mon, 23 Mar 2026 12:07:37 -0700 Subject: [PATCH] docs(bedrock/files): document memory spike for IO uploads (Bedrock requires UTF-8 text) --- litellm/llms/bedrock/files/transformation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litellm/llms/bedrock/files/transformation.py b/litellm/llms/bedrock/files/transformation.py index dabedd761c8..119593d2ea0 100644 --- a/litellm/llms/bedrock/files/transformation.py +++ b/litellm/llms/bedrock/files/transformation.py @@ -399,6 +399,12 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig): # IO[bytes] path (e.g. SpooledTemporaryFile from FastAPI UploadFile). # seek(0) is already called inside _get_content_from_openai_file, but we # handle this branch directly to surface a clear error for binary uploads. + # + # NOTE: Bedrock requires UTF-8 text content for SigV4 request signing + # and does not support binary file uploads. We must materialize the + # entire file in memory here — there is no streaming alternative. + # Operators uploading large files to Bedrock should be aware that memory + # usage will spike proportionally to file size at this point. extracted_file_data_content.seek(0) raw = extracted_file_data_content.read() try: