From 043bc8e7f89e6878e780646d20f847e093a8e811 Mon Sep 17 00:00:00 2001 From: hannahmadison Date: Tue, 31 Mar 2026 23:26:11 -0400 Subject: [PATCH] Fix #23836: [Bug]: Health checks use max_completion_tokens=1, causing failures for GPT-5 models --- litellm/proxy/health_check.py | 2 +- tests/test_litellm/proxy/test_health_check_max_tokens.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/health_check.py b/litellm/proxy/health_check.py index 3e05ee3c484..dd6af40aee9 100644 --- a/litellm/proxy/health_check.py +++ b/litellm/proxy/health_check.py @@ -284,7 +284,7 @@ def _update_litellm_params_for_health_check( elif "*" not in ( model_info.get("health_check_model") or litellm_params.get("model") or "" ): - litellm_params["max_tokens"] = 1 + litellm_params["max_tokens"] = 16 _health_check_model = model_info.get("health_check_model", None) if _health_check_model is not None: diff --git a/tests/test_litellm/proxy/test_health_check_max_tokens.py b/tests/test_litellm/proxy/test_health_check_max_tokens.py index e26f7fb9f20..ac4bc33cbf3 100644 --- a/tests/test_litellm/proxy/test_health_check_max_tokens.py +++ b/tests/test_litellm/proxy/test_health_check_max_tokens.py @@ -7,14 +7,14 @@ from unittest.mock import AsyncMock, patch, MagicMock @pytest.mark.asyncio async def test_update_litellm_params_max_tokens_default(): """ - Test that max_tokens defaults to 1 for non-wildcard models. + Test that max_tokens defaults to 16 for non-wildcard models. """ model_info = {} litellm_params = {"model": "gpt-4"} updated_params = _update_litellm_params_for_health_check(model_info, litellm_params) - assert updated_params["max_tokens"] == 1 + assert updated_params["max_tokens"] == 16 @pytest.mark.asyncio