BerriAI/litellm · error · ValueError

input_file_id is required for Bedrock batch creation

Error message

input_file_id is required for Bedrock batch creation

What it means

Request-shaping guard when transforming an OpenAI batch create to Bedrock model invocation: the Bedrock format needs an S3 input location, and the input_file_id (the uploaded JSONL file identifier) was missing, so inputDataConfig cannot be built.

Solutions

  1. Pass input_file_id referencing an uploaded JSONL batch input file.
  2. Upload the batch input file first via the files API, then use its id.
  3. Verify the file id is correct and belongs to Bedrock.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/llms/bedrock/batches/transformation.py:166 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at litellm/llms/bedrock/batches/transformation.py:166

        model: str,
        create_batch_data: CreateBatchRequest,
        optional_params: dict,
        litellm_params: dict,
    ) -> dict[str, Any]:
        """
        Transform the batch creation request to Bedrock format.

        Bedrock batch inference requires:
        - modelId: The Bedrock model ID
        - jobName: Unique name for the batch job
        - inputDataConfig: Configuration for input data (S3 location)
        - outputDataConfig: Configuration for output data (S3 location)
        - roleArn: IAM role ARN for the batch job
        """
        # Get required parameters
        input_file_id: Final = create_batch_data.get("input_file_id")
        if not input_file_id:
            raise ValueError("input_file_id is required for Bedrock batch creation")

        # Extract S3 information from file ID using common utility
        input_bucket, input_key = self.common_utils.parse_s3_uri(input_file_id)

        # Get output S3 configuration
        output_bucket = litellm_params.get("s3_output_bucket_name") or os.getenv("AWS_S3_OUTPUT_BUCKET_NAME")
        if not output_bucket:
            # Use same bucket as input if no output bucket specified
            output_bucket = input_bucket

        # Get IAM role ARN
        role_arn: Final = (
            litellm_params.get("aws_batch_role_arn")
            or optional_params.get("aws_batch_role_arn")
            or os.getenv("AWS_BATCH_ROLE_ARN")
        )
        if not role_arn:
            raise ValueError(

View on GitHub (pinned to 77b7c6c40c)