Merge branch 'BerriAI:main' into main

This commit is contained in:
Sha Ahammed Roze 2024-06-06 17:45:55 +05:30 committed by GitHub
commit a7087a44ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,18 +102,18 @@ async def test_get_available_deployments_custom_price():
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_lowest_cost_routing(): async def test_lowest_cost_routing():
""" """
Test if router returns model with the lowest cost Test if router, returns model with the lowest cost
""" """
model_list = [ model_list = [
{ {
"model_name": "gpt-3.5-turbo", "model_name": "gpt-4",
"litellm_params": {"model": "gpt-4"}, "litellm_params": {"model": "gpt-4"},
"model_info": {"id": "openai-gpt-4"}, "model_info": {"id": "openai-gpt-4"},
}, },
{ {
"model_name": "gpt-3.5-turbo", "model_name": "gpt-3.5-turbo",
"litellm_params": {"model": "groq/llama3-8b-8192"}, "litellm_params": {"model": "gpt-3.5-turbo"},
"model_info": {"id": "groq-llama"}, "model_info": {"id": "gpt-3.5-turbo"},
}, },
] ]
@ -127,7 +127,7 @@ async def test_lowest_cost_routing():
print( print(
response._hidden_params["model_id"] response._hidden_params["model_id"]
) # expect groq-llama, since groq/llama has lowest cost ) # expect groq-llama, since groq/llama has lowest cost
assert "groq-llama" == response._hidden_params["model_id"] assert "gpt-3.5-turbo" == response._hidden_params["model_id"]
async def _deploy(lowest_cost_logger, deployment_id, tokens_used, duration): async def _deploy(lowest_cost_logger, deployment_id, tokens_used, duration):