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

Raised by AmazonNovaEmbeddingConfig._transform_async_invoke_request when building an asynchronous Nova embedding request whose output_s3_uri is empty or whitespace-only. Async invokes don't return embeddings inline — AWS writes results to S3 — so the destination URI is mandatory and validated before the request is signed.

Solutions

  1. Pass a full destination URI: output_s3_uri='s3://my-bucket/nova-embeddings/'
  2. Verify the value is non-empty after strip() wherever it is injected (env, config file)
  3. Confirm the bucket exists, is in-region (or cross-region configured), and the role can write to it — otherwise the later AWS call fails

Example fix

# before
resp = litellm.embedding(
    model='bedrock/async_invoke/amazon.nova-embed-v1',
    input=['hello world'],
)  # ValueError: output_s3_uri is required

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

Strategy: validation

Validate before calling

import re

def assert_async_output_uri(model: str, output_s3_uri: str | None) -> None:
    if model.startswith('async_invoke/') or 'async_invoke/' in model:
        if not output_s3_uri or not output_s3_uri.strip():
            raise ValueError('output_s3_uri is required for async_invoke models')
        if not re.match(r'^s3://.+/.+', output_s3_uri.strip()):
            raise ValueError(f'output_s3_uri must be s3://bucket/key, got {output_s3_uri!r}')

Try / catch

try:
    resp = litellm.embedding(model=model, input=texts, output_s3_uri=uri)
except ValueError as e:
    if 'output_s3_uri is required' in str(e):
        raise ConfigError('set output_s3_uri (s3://bucket/prefix/) for async embedding') from e
    raise

Prevention

When it happens

Trigger: Calling a model with the 'async_invoke/' prefix (e.g. 'bedrock/async_invoke/amazon.nova-embed-v1') without an output_s3_uri parameter; passing output_s3_uri='' or ' '; a config template that left the URI blank in some environments.

Common situations: Enabling async embedding in a new deployment where the S3 output config wasn't carried over; conditionally setting the URI only in prod, not staging; assuming litellm derives the bucket from s3_bucket_name (it does not for this parameter — it must be a full s3:// URI you supply).

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: 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 77b7c6c40c)