mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
test(complexity_router): pin that default_model cannot rescue an exhausted ladder under plugins
This commit is contained in:
parent
b0f3a85449
commit
c9da3872fc
1 changed files with 14 additions and 0 deletions
|
|
@ -4897,6 +4897,20 @@ class TestTierFallbackLadder:
|
|||
assert response.model == "complex-model"
|
||||
assert seen == [["complex-model"]]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_default_model_does_not_rescue_an_exhausted_ladder_under_plugins(self):
|
||||
"""default_model is not vetted by the plugins, so it cannot serve when they are
|
||||
configured. With nothing live on the ladder the request fails rather than routing
|
||||
around the policy, and the error says which condition it hit."""
|
||||
|
||||
class NoOpPlugin:
|
||||
async def run(self, context):
|
||||
return context
|
||||
|
||||
router = _ladder_router(live=set(), default_model="fallback-model", plugins=[NoOpPlugin()])
|
||||
with pytest.raises(ValueError, match="with routing plugins configured"):
|
||||
await _route(router, "What is 2+2?")
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_a_plugin_narrowing_to_zero_still_fails_closed(self):
|
||||
"""Unchanged policy: a plugin refusing every candidate is a decision, so the ladder
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue