[BugFix] --max-model-len=-1 causes over-limit requests to hang and starve the entire service (#39102)

Signed-off-by: triangle14 <y1019026570@gmail.com>
Signed-off-by: mgoin <mgoin64@gmail.com>
Co-authored-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
triangleXIV
2026-04-08 14:03:17 -07:00
committed by GitHub
co-authored by mgoin
parent ad05edfbca
commit 7c94ae16c6
5 changed files with 82 additions and 4 deletions
+14
View File
@@ -63,6 +63,20 @@ class FinishReason(enum.IntEnum):
return FINISH_REASON_STRINGS[self.value]
class EngineCoreReadyResponse(
msgspec.Struct,
array_like=True, # type: ignore[call-arg]
omit_defaults=True, # type: ignore[call-arg]
):
"""Sent from EngineCore to the frontend during the ready handshake.
Contains post-initialization config that may differ from the original
values (e.g. max_model_len after KV cache auto-fitting).
"""
max_model_len: int | None = None
class EngineCoreRequest(
msgspec.Struct,
array_like=True, # type: ignore[call-arg]