mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(feat) detect amazon.titan-embed-text-v1 as bedrock embedding model
This commit is contained in:
parent
f4a45ec35b
commit
9cfd218101
4 changed files with 7 additions and 4 deletions
|
@ -68,7 +68,7 @@ os.environ["AWS_REGION_NAME"] = "" # us-east-1, us-east-2, us-west-1, us-west-2
|
||||||
```python
|
```python
|
||||||
from litellm import embedding
|
from litellm import embedding
|
||||||
response = embedding(
|
response = embedding(
|
||||||
model="bedrock/amazon.titan-embed-text-v1",
|
model="amazon.titan-embed-text-v1",
|
||||||
input=["good morning from litellm"],
|
input=["good morning from litellm"],
|
||||||
)
|
)
|
||||||
print(response)
|
print(response)
|
||||||
|
@ -76,7 +76,7 @@ print(response)
|
||||||
|
|
||||||
| Model Name | Function Call |
|
| Model Name | Function Call |
|
||||||
|----------------------|---------------------------------------------|
|
|----------------------|---------------------------------------------|
|
||||||
| Titan Embeddings - G1 | `embedding(model="bedrock/amazon.titan-embed-text-v1", input=input)` |
|
| Titan Embeddings - G1 | `embedding(model="amazon.titan-embed-text-v1", input=input)` |
|
||||||
|
|
||||||
|
|
||||||
## Cohere Embedding Models
|
## Cohere Embedding Models
|
||||||
|
|
|
@ -161,7 +161,7 @@ os.environ["AWS_REGION_NAME"] = "" # us-east-1, us-east-2, us-west-1,
|
||||||
```python
|
```python
|
||||||
from litellm import embedding
|
from litellm import embedding
|
||||||
response = embedding(
|
response = embedding(
|
||||||
model="bedrock/amazon.titan-embed-text-v1",
|
model="amazon.titan-embed-text-v1",
|
||||||
input=["good morning from litellm"],
|
input=["good morning from litellm"],
|
||||||
)
|
)
|
||||||
print(response)
|
print(response)
|
||||||
|
@ -171,4 +171,4 @@ print(response)
|
||||||
|
|
||||||
| Model Name | Function Call |
|
| Model Name | Function Call |
|
||||||
|----------------------|---------------------------------------------|
|
|----------------------|---------------------------------------------|
|
||||||
| Titan Embeddings - G1 | `embedding(model="bedrock/amazon.titan-embed-text-v1", input=input)` |
|
| Titan Embeddings - G1 | `embedding(model="amazon.titan-embed-text-v1", input=input)` |
|
||||||
|
|
|
@ -317,6 +317,7 @@ longer_context_model_fallback_dict: dict = {
|
||||||
####### EMBEDDING MODELS ###################
|
####### EMBEDDING MODELS ###################
|
||||||
open_ai_embedding_models: List = ["text-embedding-ada-002"]
|
open_ai_embedding_models: List = ["text-embedding-ada-002"]
|
||||||
cohere_embedding_models: List = ["embed-english-v2.0", "embed-english-light-v2.0", "embed-multilingual-v2.0"]
|
cohere_embedding_models: List = ["embed-english-v2.0", "embed-english-light-v2.0", "embed-multilingual-v2.0"]
|
||||||
|
bedrock_embedding_models: List = ["amazon.titan-embed-text-v1"]
|
||||||
|
|
||||||
from .timeout import timeout
|
from .timeout import timeout
|
||||||
from .testing import *
|
from .testing import *
|
||||||
|
|
|
@ -1700,6 +1700,8 @@ def get_llm_provider(model: str, custom_llm_provider: Optional[str] = None, api_
|
||||||
# cohere embeddings
|
# cohere embeddings
|
||||||
elif model in litellm.cohere_embedding_models:
|
elif model in litellm.cohere_embedding_models:
|
||||||
custom_llm_provider = "cohere"
|
custom_llm_provider = "cohere"
|
||||||
|
elif model in litellm.bedrock_embedding_models:
|
||||||
|
custom_llm_provider = "bedrock"
|
||||||
|
|
||||||
if custom_llm_provider is None or custom_llm_provider=="":
|
if custom_llm_provider is None or custom_llm_provider=="":
|
||||||
print()
|
print()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue