test(cost): route per-second regression test through generic provider branch

The new test registered an unprefixed synthetic model name with no
custom_llm_provider set, so cost_per_token's provider dispatch resolved it
to the OpenAI-specific branch (via get_llm_provider's default) instead of
the generic input_cost_per_second fallback the test means to exercise.
That made the real cost calculator raise inside model_info lookup, which
gets caught and turned into None several layers up, rather than hitting
either the buggy 0.0 or the fixed 0.02. Passing custom_llm_provider="custom"
explicitly keeps it on the generic branch.
This commit is contained in:
Pascal Tempier 2026-06-28 15:07:51 +02:00
parent e041806ecb
commit 9f768c35ba

View file

@ -265,6 +265,11 @@ class TestPerSecondCostUsesActualDuration:
model=model,
optional_params={},
litellm_params={},
# Bypass the explicit per-provider branches in cost_per_token (e.g.
# the OpenAI one, which unprefixed model names resolve to by
# default) so the lookup reaches the generic input_cost_per_second
# fallback this test is exercising.
custom_llm_provider="custom",
)
return logging_obj