BerriAI/litellm · error · Exception

Unable to determine bedrock embedding provider for model: {m

Error message

Unable to determine bedrock embedding provider for model: {model}. Supported providers: {list(get_args(BEDROCK_EMBEDDING_PROVIDERS_LITERAL))}

What it means

get_bedrock_embedding_provider() could not infer which transformation family the model belongs to (cohere / amazon / titan / twelvelabs / nova) from the model string, so the request cannot be serialized. The message lists the providers get_args(BEDROCK_EMBEDDING_PROVIDERS_LITERAL) accepts, which is the authoritative set.

Source

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

        api_key: str | None = None,
    ) -> EmbeddingResponse:
        credentials, aws_region_name = self._load_credentials(optional_params)

        ### TRANSFORMATION ###
        unencoded_model_id: Final = optional_params.pop("model_id", None) or model  # default to model if not passed
        modelId: Final = urllib.parse.quote(unencoded_model_id, safe="")
        aws_region_name = self._get_aws_region_name(
            optional_params={"aws_region_name": aws_region_name},
            model=model,
            model_id=unencoded_model_id,
        )
        # Check async invoke needs to be used
        has_async_invoke: Final = "async_invoke/" in model
        if has_async_invoke:
            model = model.replace("async_invoke/", "", 1)
        provider: Final = self.get_bedrock_embedding_provider(model)
        if provider is None:
            raise Exception(
                f"Unable to determine bedrock embedding provider for model: {model}. "
                f"Supported providers: {list(get_args(BEDROCK_EMBEDDING_PROVIDERS_LITERAL))}"
            )
        inference_params = copy.deepcopy(optional_params)
        inference_params = {
            k: v for k, v in inference_params.items() if k.lower() not in self.aws_authentication_params
        }
        inference_params.pop("user", None)  # make sure user is not passed in for bedrock call

        data: CohereEmbeddingRequest | None = None
        batch_data: list | None = None
        if provider == "cohere":
            data = BedrockCohereEmbeddingConfig()._transform_request(
                model=model, input=input, inference_params=inference_params
            )
        elif provider == "amazon" and model in [
            "amazon.titan-embed-image-v1",
            "amazon.titan-embed-text-v1",

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Check the exact model id against the error's supported-provider list and fix typos (e.g. bedrock/cohere.embed-english-v3).
  2. Upgrade litellm if the provider family is genuinely new.
  3. Ensure you are calling litellm.embedding()/aembedding() with an actual Bedrock embedding model, not a chat model.
  4. For custom/unmapped ids, subclass or register a config via the Bedrock provider extension points.

Example fix

# before
resp = litellm.embedding(model="bedrock/cohere.embed-english-v2", input=["hi"])

# after
resp = litellm.embedding(model="bedrock/cohere.embed-english-v3", input=["hi"])
Defensive patterns

Strategy: validation

Validate before calling

KNOWN_PREFIXES = ("cohere.", "amazon.", "twelvelabs.")
def check(model: str):
    stem = model.removeprefix("bedrock/")
    assert stem.startswith(KNOWN_PREFIXES), f"model {model!r} has no bedrock embedding provider"

Type guard

def is_bedrock_embedding_model_id(model: str) -> bool:
    stem = model.removeprefix("bedrock/").removeprefix("async_invoke/")
    return stem.startswith(("cohere.", "amazon.", "twelvelabs."))

Prevention

When it happens

Trigger: Calling bedrock embeddings with a model string whose prefix matches no known family — e.g. 'bedrock/somevendor.embed-foo-v1', a typo like 'bedrock/cohere.embed-english-v2' (nonexistent version), or a chat/completion model id accidentally passed to litellm.embedding().

Common situations: Typos in the model id; passing non-embedding Bedrock models to the embedding endpoint; using a provider added in a newer litellm than the installed one; forgetting the 'bedrock/' prefix conventions.

Related errors


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