BerriAI/litellm · error · ValueError

Could not determine Bedrock model ID. Please pass `model`…

Error message

Could not determine Bedrock model ID. Please pass `model` in your request body.

What it means

Model-resolution guard in the Bedrock batch transformation: after stripping provider prefixes, no Bedrock modelId could be derived for the job. Bedrock batch APIs require an explicit modelId, so the caller must pass a resolvable 'model' in the request body.

Solutions

  1. Pass `model` in the batch request body.
  2. Ensure each JSONL record includes a model or the request-level model is set.
  3. Check the batch creation call includes a resolvable Bedrock model id.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/llms/bedrock/batches/transformation.py:190 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/dc1383cc8d5e922c. Report an issue: GitHub.

Appendix: source

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

        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(
                "AWS IAM role ARN is required for Bedrock batch jobs. "
                "Set 'aws_batch_role_arn' in litellm_params or AWS_BATCH_ROLE_ARN env var"
            )

        if not model:
            raise ValueError("Could not determine Bedrock model ID. Please pass `model` in your request body.")

        # Generate job name with the correct model ID using common utility
        job_name: Final = self.common_utils.generate_unique_job_name(model, prefix="litellm")
        output_key: Final = f"litellm-batch-outputs/{job_name}/"

        # Build input data config
        input_data_config: Final[BedrockInputDataConfig] = {
            "s3InputDataConfig": BedrockS3InputDataConfig(s3Uri=f"s3://{input_bucket}/{input_key}")
        }

        # Build output data config
        s3_output_config: Final[BedrockS3OutputDataConfig] = BedrockS3OutputDataConfig(
            s3Uri=f"s3://{output_bucket}/{output_key}"
        )

        # Add optional KMS encryption key ID if provided
        s3_encryption_key_id = resolve_s3_encryption_key_id(
            litellm_params=litellm_params,

View on GitHub (pinned to 77b7c6c40c)