BerriAI / litellm

Python SDK, Proxy Server to call 100+ LLM APIs using the OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
12.2k stars 1.42k forks source link

[Feature]: Add support for amazon titan embedding #701

Closed DBairdME closed 10 months ago

DBairdME commented 10 months ago

What happened?

When calling titan via AWS Bedrock (using litellm as a proxy) an error is thrown in relation to [textGenerationConfig]

Relevant log output

An error occurred (ValidationException) when calling the InvokeModelWithResponseStream operation: Malformed input request: extraneous key [textGenerationConfig] is not permitted, please reformat your input and try again.
LiteLLM.Exception: An error occurred (ValidationException) when calling the InvokeModelWithResponseStream operation: **Malformed input request: extraneous key [textGenerationConfig] is not permitted, please reformat your input and try again.**
INFO:     172.19.X.X:XX - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/xxxxxx/litellm/litellm/main.py", line 1041, in completion
    model_response = bedrock.completion(
  File "/home/xxxxxx/litellm/litellm/llms/bedrock.py", line 337, in completion
    response = client.invoke_model_with_response_stream(
  File "/home/xxxxxx/.local/lib/python3.9/site-packages/botocore/client.py", line 535, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/xxxxxx/.local/lib/python3.9/site-packages/botocore/client.py", line 980, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the InvokeModelWithResponseStream operation: Malformed input request: extraneous key [textGenerationConfig] is not permitted, please reformat your input and try again.

Twitter / LinkedIn details

No response

krrishdholakia commented 10 months ago

@DBairdME we don't support amazon titan embeddings yet. Rewriting this issue to track it.

krrishdholakia commented 10 months ago

Hey @DBairdME we're having issues with our bedrock keys, slowing down this integration. Would welcome a PR here!

ishaan-jaff commented 10 months ago

looking at this now

ishaan-jaff commented 10 months ago

added @DBairdME https://docs.litellm.ai/docs/embedding/supported_embedding#bedrock-embedding

ishaan-jaff commented 10 months ago

would love to give you a shoutout for the issue on our daily changelog @DBairdME

what's your linkedin / twitter