Skip to content

[Feature]: Add support for the Bedrock Embeddings Model amazon.titan-embed-g1-text-02 #9067

@mirodrr2

Description

@mirodrr2

The Feature

import openai
import os
from dotenv import load_dotenv

load_dotenv()

api_key=os.getenv("LITELLM_PROXY_API_KEY"),
api_base=os.getenv("LITELLM_PROXY_API_BASE"),

client = openai.OpenAI(
    api_key=api_key,
    base_url=api_base
)

model_id = "amazon.titan-embed-g1-text-02"
response = client.embeddings.create(model=model_id, input="What is this")
print(len(response.data[0].embedding))
openai.InternalServerError: Error code: 500 - {'error': {'message': 'litellm.APIConnectionError: Unable to map Bedrock request to provider\nTraceback (most recent call last):\n  File "/usr/lib/python3.13/site-packages/litellm/main.py", line 3566, in embedding\n    response = bedrock_embedding.embeddings(\n        model=model,\n    ...<11 lines>...\n        extra_headers=extra_headers,\n    )\n  File "/usr/lib/python3.13/site-packages/litellm/llms/bedrock/embed/embedding.py", line 448, in embeddings\n    raise Exception("Unable to map Bedrock request to provider")\nException: Unable to map Bedrock request to provider\n. Received Model Group=amazon.titan-embed-g1-text-02\nAvailable Model Group Fallbacks=None', 'type': None, 'param': None, 'code': '500'}}

Motivation, pitch

This is still a relevant model for bedrock, and has not been deprecated yet

Are you a ML Ops Team?

No

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions