forked from phoenix/litellm-mirror
fix(converse/transformation.py): support bedrock apac cross region inference
Fixes https://github.com/BerriAI/litellm/issues/6905
This commit is contained in:
parent
bbf31346ca
commit
037171b98b
2 changed files with 14 additions and 1 deletions
|
@ -458,7 +458,7 @@ class AmazonConverseConfig:
|
||||||
"""
|
"""
|
||||||
Abbreviations of regions AWS Bedrock supports for cross region inference
|
Abbreviations of regions AWS Bedrock supports for cross region inference
|
||||||
"""
|
"""
|
||||||
return ["us", "eu"]
|
return ["us", "eu", "apac"]
|
||||||
|
|
||||||
def _get_base_model(self, model: str) -> str:
|
def _get_base_model(self, model: str) -> str:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1243,6 +1243,19 @@ def test_bedrock_cross_region_inference(model):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"model, expected_base_model",
|
||||||
|
[
|
||||||
|
(
|
||||||
|
"apac.anthropic.claude-3-5-sonnet-20240620-v1:0",
|
||||||
|
"anthropic.claude-3-5-sonnet-20240620-v1:0",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_bedrock_get_base_model(model, expected_base_model):
|
||||||
|
assert litellm.AmazonConverseConfig()._get_base_model(model) == expected_base_model
|
||||||
|
|
||||||
|
|
||||||
from litellm.llms.prompt_templates.factory import _bedrock_converse_messages_pt
|
from litellm.llms.prompt_templates.factory import _bedrock_converse_messages_pt
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue