[RL] Allow bypassing /health check (#13320)

This commit is contained in:
Zilin Zhu
2025-11-15 16:33:54 +08:00
committed by GitHub
parent b732ffa404
commit f0b5ccf5f5
2 changed files with 9 additions and 0 deletions

View File

@@ -420,6 +420,12 @@ async def health_generate(request: Request) -> Response:
if _global_state.tokenizer_manager.server_status == ServerStatus.Starting:
return Response(status_code=503)
if (
not envs.SGLANG_ENABLE_HEALTH_ENDPOINT_GENERATION
and request.url.path == "/health"
):
return Response(status_code=200)
sampling_params = {"max_new_tokens": 1, "temperature": 0.0}
rid = f"HEALTH_CHECK_{time.time()}"

View File

@@ -291,6 +291,9 @@ class Envs:
# Warmup
SGLANG_WARMUP_TIMEOUT = EnvFloat(-1) # in seconds. If a warmup forward batch takes longer than this, the server will crash to prevent hanging. Recommend to increase warmup timeout to 1800 to accommodate some kernel JIT precache e.g. deep gemm
# Health Check
SGLANG_ENABLE_HEALTH_ENDPOINT_GENERATION = EnvBool(True)
# fmt: on