BerriAI/litellm · error · NotImplementedError

Bedrock batch embedding currently supports only Amazon Titan

Error message

Bedrock batch embedding currently supports only Amazon Titan Text Embeddings V2 (model id contains 'titan-embed-text-v2'). Got model={model!r}. Track other embedding models in https://github.com/BerriAI/litellm/issues.

What it means

Error "Bedrock batch embedding currently supports only Amazon Titan Text Embeddings V2 (model id contains 'titan-embed-text-v2'). Got model={model!r}. Track other embedding models in https://github.com/BerriAI/litellm/issues." thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/bedrock/files/transformation.py:613

        Currently routes Amazon Titan Text Embeddings V2 only; other
        embedding providers (Titan G1, Titan Multimodal, Cohere Embed,
        Nova Multimodal Embeddings) raise NotImplementedError until they
        get a dedicated branch. Splitting them keeps PR scope tight and
        lets each model's request schema be exercised by its own tests.

        AWS docs (Titan v2 InvokeModel body):
        https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-embed-text.html
        """
        from litellm.llms.bedrock.embed.amazon_titan_v2_transformation import (
            AmazonTitanV2Config,
        )

        if not self._is_titan_v2_embed_model(model):
            # Refuse early instead of silently shaping the body for the wrong
            # provider. The synchronous /v1/embeddings path supports more
            # models, but each has a different InvokeModel schema; mapping
            # them here without dedicated tests would risk corrupt batches.
            raise NotImplementedError(
                "Bedrock batch embedding currently supports only Amazon "
                "Titan Text Embeddings V2 (model id contains "
                f"'titan-embed-text-v2'). Got model={model!r}. Track other "
                "embedding models in https://github.com/BerriAI/litellm/issues."
            )

        input_text: Final = self._coerce_embedding_input_to_string(openai_request_body.get("input"), model=model)

        # Map OpenAI-style params (dimensions, encoding_format) onto the
        # Titan v2 schema (dimensions, embeddingTypes) via the embed config
        # so this stays in sync with the synchronous /v1/embeddings path.
        non_default_params: Final = {k: v for k, v in openai_request_body.items() if k not in ("model", "input")}
        titan_config: Final = AmazonTitanV2Config()
        inference_params: Final = titan_config.map_openai_params(
            non_default_params=non_default_params,
            optional_params={},
        )
        return dict(titan_config._transform_request(input=input_text, inference_params=inference_params))

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Use Amazon Titan Text Embeddings V2 for Bedrock batch embedding.

When it happens

Trigger: Thrown at litellm/llms/bedrock/files/transformation.py:613 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/72782dbca0307c72. Report an issue: GitHub.