forked from phoenix/litellm-mirror
(fix) failing usage based routing test
This commit is contained in:
parent
ff4f05a3f8
commit
e23c68b15a
2 changed files with 7 additions and 5 deletions
|
@ -200,9 +200,11 @@ class LowestTPMLoggingHandler(CustomLogger):
|
||||||
if item_tpm == 0:
|
if item_tpm == 0:
|
||||||
deployment = _deployment
|
deployment = _deployment
|
||||||
break
|
break
|
||||||
elif item_tpm + input_tokens > _deployment_tpm or (
|
elif item_tpm + input_tokens > _deployment_tpm:
|
||||||
item in rpm_dict and rpm_dict[item] + 1 > _deployment_rpm
|
continue
|
||||||
): # if user passed in tpm / rpm in the model_list
|
elif (rpm_dict is not None and item in rpm_dict) and (
|
||||||
|
rpm_dict[item] + 1 > _deployment_rpm
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
elif item_tpm < lowest_tpm:
|
elif item_tpm < lowest_tpm:
|
||||||
lowest_tpm = item_tpm
|
lowest_tpm = item_tpm
|
||||||
|
|
|
@ -429,11 +429,11 @@ def test_usage_based_routing():
|
||||||
mock_response="good morning",
|
mock_response="good morning",
|
||||||
)
|
)
|
||||||
|
|
||||||
# print(response)
|
# print("response", response)
|
||||||
|
|
||||||
selection_counts[response["model"]] += 1
|
selection_counts[response["model"]] += 1
|
||||||
|
|
||||||
print(selection_counts)
|
# print("selection counts", selection_counts)
|
||||||
|
|
||||||
total_requests = sum(selection_counts.values())
|
total_requests = sum(selection_counts.values())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue