Skip to content

File Retrieval always fail for bedrock #26335

@kenny-bti

Description

@kenny-bti

Docker Image 1.83.7-stable

if provider_config is not None:

BedrockFilesConfig does not support file content retrieval

This is with the new LiteLLM Managed Files Configuration.

Claude Analysis

Step 1:
GET /v1/files/{base64_file_id}/content
with header
custom-llm-provider: bedrock

Step 2:
files_endpoints.py
line 585:
get_file_content()
handler

Step 3: Line 617:
data = {"file_id": file_id}

Step 4: Line 630:
custom_llm_provider = "bedrock"
(from header)

Step 5: Line 639:
_is_base64_encoded_unified_file_id(file_id)
→ truthy (starts with
litellm_proxy
)

Step 6: Line 640: enters managed files branch
Step 7: Line 641:
managed_files_obj = proxy_logging_obj.get_proxy_hook("managed_files")
→ returns enterprise hook ✅

Step 8: Line 667: checks DB for
storage_backend
/
storage_url
→ not set for bedrock batch outputs

Step 9: Line 700:
model = data.get("model")

None
(data only has
file_id
)

Step 10: Line 709: enters
else
branch

Step 11: Line 712: calls
managed_files_obj.afile_content(file_id=file_id, llm_router=llm_router, ...)

Step 12: Enterprise
managed_files.py
line 802:
afile_content()
starts

Step 13: Line 813:
get_model_file_id_mapping([file_id], ...)
→ looks up DB to find which
model_id
maps to this file

Step 14: Line 823: iterates
specific_model_file_id_mapping
→ gets
model_id = "f43dd61b-de34-4be3-b255-9e4bb9fabf30"
and the provider-specific
file_id

Step 15: Line 825: calls
llm_router.afile_content(model="f43dd61b-...", file_id=..., **data)

Step 16:
router.py
line 912:
self.afile_content
is
self.factory_function(litellm.afile_content, ...)

Step 17: Line 5194: routes to
_ageneric_api_call_with_fallbacks()

Step 18: Line 3845:
async_get_available_deployment(model="f43dd61b-...")
→ finds the deployment

Step 19: Line 3870:
get_llm_provider(model=data["model"])
→ infers
custom_llm_provider = "bedrock"

Step 20: Line 3889: calls
litellm.afile_content(custom_llm_provider="bedrock", file_id=..., **data)

Step 21:
files/main.py
line 774:
afile_content()
→ calls
file_content()

Step 22: Line 863:
provider_config = ProviderConfigManager.get_provider_files_config(model="", provider=LlmProviders.BEDROCK)

Step 23:
utils.py
line 8703: returns
BedrockFilesConfig()

Step 24: Line 867:
if provider_config is not None:
→ True

Step 25: Line 885:
base_llm_http_handler.retrieve_file_content(provider_config=BedrockFilesConfig(), ...)

Step 26:
llm_http_handler.py
line 4397: calls
provider_config.transform_file_content_request()

Step 27:
bedrock/files/transformation.py
line 652:
raise NotImplementedError("BedrockFilesConfig does not support file content retrieval")

Step 28: 500 error returned
Line 993 (
bedrock_files_instance.file_content()
) is dead code — step 24 always short-circuits because
get_provider_files_config
returns non-None for bedrock. No config, header, or parameter can change this. It's a code bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions