@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / aab392774b
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 22:15 UTC

[Core] xgrammar: Expand list of unsupported jsonschema keywords (#13783)

Signed-off-by: Russell Bryant <rbryant@redhat.com>

Russell Bryant committed Feb 25, 2025 at 03:21 UTC aab392774bb9f50e4248cb590690dc34d8595b5a
1 file changed +12
vllm/model_executor/guided_decoding/utils.py
+12
@@ -33,6 +33,18 @@ def has_xgrammar_unsupported_json_features(schema: dict) -> bool:
33 ]):
34 return True
35
36 + # Unsupported keywords for strings
37 + if obj.get("type") == "string" and any(
38 + key in obj for key in ["minLength", "maxLength", "format"]):
39 + return True
40 +
41 + # Unsupported keywords for objects
42 + if obj.get("type") == "object" and any(key in obj for key in [
43 + "minProperties", "maxProperties", "propertyNames",
44 + "patternProperties"
45 + ]):
46 + return True
47 +
48 # Recursively check all nested objects and arrays
49 for value in obj.values():
50 if isinstance(value, dict):