BerriAI/litellm · error · ImportError

Missing boto3 to call bedrock. Run 'pip install boto3'.

Error message

Missing boto3 to call bedrock. Run 'pip install boto3'.

What it means

Error "Missing boto3 to call bedrock. Run 'pip install boto3'." thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/bedrock/batches/handler.py:203

            logging_obj: Optional litellm logging object.
            **kwargs: Optional AWS credential overrides
                (``aws_access_key_id``, ``aws_secret_access_key``,
                ``aws_session_token``, ``aws_profile_name``,
                ``aws_role_name``, ``aws_session_name``,
                ``aws_web_identity_token``, ``aws_sts_endpoint``,
                ``aws_external_id``). Unknown keys are ignored.

        Returns:
            ``LiteLLMBatch`` shaped like an OpenAI Batch resource. Note that
            ``request_counts`` is always ``(0, 0, 0)`` because
            ``GetModelInvocationJob`` does not surface per-record counts;
            callers that need accurate counts should parse
            ``manifest.json.out`` from the output S3 prefix.
        """
        try:
            import boto3
        except ImportError as exc:
            raise ImportError("Missing boto3 to call bedrock. Run 'pip install boto3'.") from exc

        # Resolve region: explicit > parsed-from-ARN > us-east-1 (boto3 default).
        region: Final = aws_region_name or _extract_region_from_bedrock_arn(batch_id) or "us-east-1"

        # Resolve credentials through the same path the rest of the bedrock
        # provider uses, so model_list / env / role-assumption configs are
        # honored. We instantiate BedrockBatchesConfig (which extends
        # BaseAWSLLM) lazily to avoid a circular import at module load.
        from litellm.llms.bedrock.batches.transformation import BedrockBatchesConfig

        creds: Final = BedrockBatchesConfig().get_credentials(
            aws_access_key_id=kwargs.get("aws_access_key_id"),
            aws_secret_access_key=kwargs.get("aws_secret_access_key"),
            aws_session_token=kwargs.get("aws_session_token"),
            aws_region_name=region,
            aws_session_name=kwargs.get("aws_session_name"),
            aws_profile_name=kwargs.get("aws_profile_name"),
            aws_role_name=kwargs.get("aws_role_name"),

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Install boto3: pip install boto3.

When it happens

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

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/45d3cf8ad406c5aa. Report an issue: GitHub.