mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
test(reasoning-effort-grid): expect capped thinking on messages-route budget models
This commit is contained in:
parent
71a951691a
commit
36c036cd2d
1 changed files with 13 additions and 2 deletions
|
|
@ -103,7 +103,7 @@ def _bedrock_clamps_effort(model: "ModelEntry", effort: str) -> bool:
|
|||
return _EFFORT_RANK[effort] > _EFFORT_RANK[model.bedrock_effort_ceiling]
|
||||
|
||||
|
||||
def expected(model: ModelEntry, effort: str) -> CellExpectation:
|
||||
def expected(route_name: str, model: ModelEntry, effort: str) -> CellExpectation:
|
||||
if effort in ("__omit__", "none"):
|
||||
if model.mode == "budget":
|
||||
return CellExpectation(
|
||||
|
|
@ -117,6 +117,15 @@ def expected(model: ModelEntry, effort: str) -> CellExpectation:
|
|||
if effort in ("xhigh", "max"):
|
||||
cap = f"supports_{effort}_reasoning_effort"
|
||||
if cap not in model.caps and not _bedrock_clamps_effort(model, effort):
|
||||
if model.mode == "budget" and route_name == "bedrock_invoke_messages":
|
||||
# the /v1/messages path caps the mapped budget below max_tokens
|
||||
# (LIT-6498), so oversized tiers succeed there instead of 400ing
|
||||
return CellExpectation(
|
||||
status=200,
|
||||
thinking_type="enabled",
|
||||
thinking_budget_tokens=BUDGET_MODE_MAX_TOKENS - 1,
|
||||
max_tokens=BUDGET_MODE_MAX_TOKENS,
|
||||
)
|
||||
return CellExpectation(status=400, thinking_type=OMIT)
|
||||
|
||||
if model.mode == "adaptive":
|
||||
|
|
@ -441,5 +450,7 @@ def all_cells() -> List[Tuple[str, ModelEntry, str, CellExpectation]]:
|
|||
for route in ROUTES:
|
||||
for model in route.models:
|
||||
for effort in EFFORTS:
|
||||
cells.append((route.name, model, effort, expected(model, effort)))
|
||||
cells.append(
|
||||
(route.name, model, effort, expected(route.name, model, effort))
|
||||
)
|
||||
return cells
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue