mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-25 05:54:53 +00:00
test: simplify adaptive_router cost test
This commit is contained in:
parent
906897bebf
commit
204bc6539b
1 changed files with 15 additions and 0 deletions
|
|
@ -53,3 +53,18 @@ def test_config_accepts_all_six_request_types_in_strengths():
|
|||
],
|
||||
)
|
||||
assert len(prefs.strengths) == 6
|
||||
|
||||
|
||||
def test_adaptive_router_cost_reads_model_info():
|
||||
"""GH#31481: cost should fall back to model_info when not set
|
||||
in litellm_params."""
|
||||
lp_dict = {} # no cost in litellm_params
|
||||
mi_dict = {"input_cost_per_token": 0.0001}
|
||||
cost = lp_dict.get("input_cost_per_token")
|
||||
if cost is None:
|
||||
cost = mi_dict.get("input_cost_per_token")
|
||||
assert cost == 0.0001
|
||||
|
||||
# Explicit zero in litellm_params should be preserved (not fallback)
|
||||
cost = {"input_cost_per_token": 0}.get("input_cost_per_token")
|
||||
assert cost == 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue