Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions litellm/proxy/health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def _resolve_health_check_max_tokens(
3. For non-wildcard reasoning routes: BACKGROUND_HEALTH_CHECK_MAX_TOKENS_REASONING
from env (if set)
4. BACKGROUND_HEALTH_CHECK_MAX_TOKENS (global, any route including wildcards)
5. Non-wildcard default: 5
5. Non-wildcard default: 16
6. Wildcard and nothing from (1)(4): leave unset (caller omits max_tokens)
"""
explicit = model_info.get("health_check_max_tokens", None)
Expand Down Expand Up @@ -432,7 +432,7 @@ def _resolve_health_check_max_tokens(
return int(BACKGROUND_HEALTH_CHECK_MAX_TOKENS)

if not is_wildcard:
return 16 # OpenAI GPT-5 models require max_output_tokens >= 16
return 16

return None

Expand Down
3 changes: 1 addition & 2 deletions tests/test_litellm/proxy/test_health_check_max_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ async def test_update_litellm_params_max_tokens_wildcard():

updated_params = _update_litellm_params_for_health_check(model_info, litellm_params)

# Should not be set to 1
assert "max_tokens" not in updated_params or updated_params["max_tokens"] != 1
assert "max_tokens" not in updated_params


@pytest.mark.asyncio
Expand Down
Loading