BerriAI/litellm · error · Exception

Unable to map Bedrock request to provider

Error message

Unable to map Bedrock request to provider

What it means

Dispatch failure in the Bedrock embedding request path: the computed provider has no matching request-transformation branch, so the batch embedding data cannot be mapped to a provider-specific invoke payload.

Solutions

  1. Verify the model id maps to a supported embedding provider.
  2. Check request parameters against the provider's expected input.
  3. Use a supported Bedrock embedding model.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at litellm/llms/bedrock/embed/embedding.py:517 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/1502d09899639359. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/bedrock/embed/embedding.py:517

                    provider=provider,
                    is_async_invoke=has_async_invoke,
                )
            returned_response: Final = self._single_func_embeddings(
                client=(client if client is not None and isinstance(client, HTTPHandler) else None),
                timeout=timeout,
                batch_data=batch_data,
                credentials=credentials,
                extra_headers=extra_headers,
                endpoint_url=endpoint_url,
                aws_region_name=aws_region_name,
                model=model,
                logging_obj=logging_obj,
                api_key=api_key,
                provider=provider,
                is_async_invoke=has_async_invoke,
            )
            if returned_response is None:
                raise Exception("Unable to map Bedrock request to provider")
            return returned_response
        elif data is None:
            raise Exception("Unable to map Bedrock request to provider")

        headers = {"Content-Type": "application/json"}
        if extra_headers is not None:
            headers = {"Content-Type": "application/json", **extra_headers}

        prepped: Final = self.get_request_headers(
            credentials=credentials,
            aws_region_name=aws_region_name,
            extra_headers=extra_headers,
            endpoint_url=endpoint_url,
            data=json.dumps(data),
            headers=headers,
            api_key=api_key,
        )

View on GitHub (pinned to 77b7c6c40c)