[Frontend] Warn when removed guided-decoding fields are present in a request (#54285)
Signed-off-by: Ilir <ljeci.ilir@gmail.com> Co-authored-by: Ilir <ljeci.ilir@gmail.com>
erdholion committed
Sep 4, 2026 at 18:15 UTC
131e0285f60faad78a13ae79573b7b38ddb52a85
1 file changed
+27
-2
vllm/entrypoints/serve/engine/protocol.py
+27
-2
@@ -18,6 +18,21 @@ from vllm.utils import random_uuid
18
19
logger = init_logger(__name__)
20
21
+# Legacy guided-decoding fields are treated like any other extra field since
22
+# their removal, so requests still using them get HTTP 200 with unconstrained
23
+# output and no visible signal (see #53975). Warn instead of burying the
24
+# only breadcrumb at DEBUG level.
25
+_REMOVED_GUIDED_FIELDS = frozenset(
26
+ {
27
+ "guided_json",
28
+ "guided_regex",
29
+ "guided_choice",
30
+ "guided_grammar",
31
+ "guided_decoding_backend",
32
+ "guided_whitespace_pattern",
33
+ }
34
+)
35
+
36
37
class OpenAIBaseModel(BaseModel):
38
# OpenAI API does allow extra fields
@@ -43,10 +58,20 @@ class OpenAIBaseModel(BaseModel):
58
cls.field_names = field_names
59
60
# Compare against both field names and aliases
46
- if any(k not in field_names for k in data):
61
+ extra_keys = data.keys() - field_names
62
+ if extra_keys:
63
+ removed = extra_keys & _REMOVED_GUIDED_FIELDS
64
+ if removed:
65
+ logger.warning_once(
66
+ "Request contains the removed guided-decoding field(s) "
67
+ "%s, which are ignored; output will NOT be constrained. "
68
+ "Use `structured_outputs` (or `response_format`) "
69
+ "instead; see docs/features/structured_outputs.md.",
70
+ str(sorted(removed)),
71
+ )
72
logger.debug(
73
"The following fields were present in the request but ignored: %s",
49
- data.keys() - field_names,
74
+ extra_keys,
75
)
76
return result
77