BerriAI/litellm · error · ValueError

output_s3_uri is required for async invoke requests

Error message

output_s3_uri is required for async invoke requests

What it means

Async invocation of Amazon Nova embedding models (model id prefixed with 'async_invoke/') writes results to S3, so an output_s3_uri is mandatory. The check rejects a missing, empty, or whitespace-only value before the request is built.

Source

Thrown at litellm/llms/bedrock/embed/amazon_nova_transformation.py:233

        Args:
            model_input: The transformed Nova embedding request
            model_id: The model identifier (without async_invoke prefix)
            output_s3_uri: S3 URI for output data config

        Returns:
            dict: The wrapped async invoke request
        """
        import urllib.parse

        # Clean the model ID
        unquoted_model_id = urllib.parse.unquote(model_id)
        if unquoted_model_id.startswith("async_invoke/"):
            unquoted_model_id = unquoted_model_id.replace("async_invoke/", "")

        # Validate that the S3 URI is not empty
        if not output_s3_uri or output_s3_uri.strip() == "":
            raise ValueError("output_s3_uri is required for async invoke requests")

        return {
            "modelId": unquoted_model_id,
            "modelInput": model_input,
            "outputDataConfig": {"s3OutputDataConfig": {"s3Uri": output_s3_uri}},
        }

    def _transform_response(
        self,
        response_list: list[dict],
        model: str,
        batch_data: list[dict] | None = None,
    ) -> EmbeddingResponse:
        """
        Transform Nova response to OpenAI format.

        Nova response format:
        {

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Pass a valid output_s3_uri (s3://bucket/prefix) with the async invoke request
  2. Ensure the bucket exists and the Bedrock service principal can write to it
  3. If async behavior is unintended, drop the async_invoke/ prefix from the model name

Example fix

# before
litellm.embedding(model='bedrock/async_invoke/amazon.nova-embed-v1:0', input=[...])

# after
litellm.embedding(
    model='bedrock/async_invoke/amazon.nova-embed-v1:0',
    input=[...],
    output_s3_uri='s3://my-bucket/nova-embed-output/',
)
Defensive patterns

Strategy: validation

Validate before calling

def validate_async_invoke(model: str, output_s3_uri: str | None) -> None:
    if model.startswith("async_invoke/") and not (output_s3_uri and output_s3_uri.strip()):
        raise ValueError("output_s3_uri is required for async invoke requests")

Prevention

When it happens

Trigger: Calling bedrock/async_invoke/amazon.nova-embed-... without output_s3_uri, or passing a value that is only spaces; also forgetting to forward the parameter through proxy config.

Common situations: Configuring model names with the async_invoke/ prefix for large batch embeddings but not wiring the S3 output location, or environment-specific config where the S3 var is unset only in one deployment.

Related errors


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