BerriAI/litellm · error · NotImplementedError

BedrockFilesConfig does not support file listing

Error message

BedrockFilesConfig does not support file listing

What it means

BedrockFilesConfig keeps files only as objects in your S3 bucket, so there is no provider-side listing to translate; the request-side list-files transform raises NotImplementedError. Listing is expected to be done against S3 directly (or your own metadata store).

Solutions

  1. List batch objects with boto3 list_objects_v2 on the configured bucket (respecting s3_output_bucket_name if set)
  2. Maintain your own file registry keyed by the s3:// file id returned from create
  3. Guard list calls on provider so Bedrock deployments take the S3 branch

Example fix

# before
files = await client.files.list()

# after (Bedrock)
files = s3.list_objects_v2(Bucket=os.environ["AWS_S3_BUCKET_NAME"], Prefix="litellm-bedrock-batches/")
Defensive patterns

Strategy: fallback

Validate before calling

def list_files_for_provider(client, s3, bucket: str, provider: str):
    if provider.startswith("bedrock"):
        return s3.list_objects_v2(Bucket=bucket).get("Contents", [])
    return client.files.list()

Try / catch

try:
    files = await client.files.list()
except NotImplementedError:
    files = s3.list_objects_v2(Bucket=os.environ["AWS_S3_BUCKET_NAME"]).get("Contents", [])

Prevention

When it happens

Trigger: client.files.list() / GET /v1/files with a bedrock model in scope; admin dashboards enumerating uploaded batch files through the proxy.

Common situations: Generic OpenAI-compatible UIs and CLIs that always call the list endpoint; migration from OpenAI batch tooling that lists files to show job status.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/f0cb6cf0485e0e12. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/bedrock/files/transformation.py:1205

        litellm_params: dict,
    ) -> tuple[str, dict]:
        raise NotImplementedError("BedrockFilesConfig does not support file deletion")

    def transform_delete_file_response(
        self,
        raw_response: httpx.Response,
        logging_obj: LiteLLMLoggingObj,
        litellm_params: dict,
    ) -> FileDeleted:
        raise NotImplementedError("BedrockFilesConfig does not support file deletion")

    def transform_list_files_request(
        self,
        purpose: str | None,
        optional_params: dict,
        litellm_params: dict,
    ) -> tuple[str, dict]:
        raise NotImplementedError("BedrockFilesConfig does not support file listing")

    def transform_list_files_response(
        self,
        raw_response: httpx.Response,
        logging_obj: LiteLLMLoggingObj,
        litellm_params: dict,
    ) -> list[OpenAIFileObject]:
        raise NotImplementedError("BedrockFilesConfig does not support file listing")

    def transform_file_content_request(
        self,
        file_content_request: FileContentRequest,
        optional_params: Mapping[str, object],
        litellm_params: MutableMapping[str, object],
    ) -> tuple[str, dict[str, str]]:
        """
        Build a SigV4-signed S3 GetObject request for a Bedrock batch file.

View on GitHub (pinned to 77b7c6c40c)