mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(test) router - model_group_alias
This commit is contained in:
parent
b7a5ab5ffa
commit
841e941ecd
1 changed files with 4 additions and 3 deletions
|
@ -291,7 +291,6 @@ def test_weighted_selection_router_no_rpm_set():
|
|||
def test_model_group_aliases():
|
||||
try:
|
||||
litellm.set_verbose = False
|
||||
litellm.model_group_alias_map = {"gpt-4": "gpt-3.5-turbo"}
|
||||
model_list = [
|
||||
{
|
||||
"model_name": "gpt-3.5-turbo",
|
||||
|
@ -321,7 +320,10 @@ def test_model_group_aliases():
|
|||
]
|
||||
router = Router(
|
||||
model_list=model_list,
|
||||
model_group_alias={"gpt-4": "gpt-3.5-turbo"} # gpt-4 requests sent to gpt-3.5-turbo
|
||||
)
|
||||
|
||||
# test that gpt-4 requests are sent to gpt-3.5-turbo
|
||||
for _ in range(20):
|
||||
selected_model = router.get_available_deployment("gpt-4")
|
||||
print("\n selected model", selected_model)
|
||||
|
@ -330,8 +332,7 @@ def test_model_group_aliases():
|
|||
pytest.fail(f"Selected model {selected_model_name} is not gpt-3.5-turbo")
|
||||
|
||||
router.reset()
|
||||
litellm.model_group_alias_map = {}
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
# test_model_group_aliases()
|
||||
test_model_group_aliases()
|
Loading…
Add table
Add a link
Reference in a new issue