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 11, 12:30 UTC
fix: Update json features supported by xGrammar (#30390)
Signed-off-by: Johannes Flommersfeld <johannes.flommersfeld@tngtech.com> Signed-off-by: Johannes F <johannesflommersfeld@users.noreply.github.com> Co-authored-by: Johannes Flommersfeld <johannes.flommersfeld@tngtech.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Johannes F committed
Dec 14, 2025 at 11:16 UTC
060893654dc6e3b4fe3f40951d9f4d769903ee7e
3 files changed
+8
-9
tests/v1/entrypoints/conftest.py
+5
@@ -76,6 +76,8 @@ def sample_json_schema():
76
},
77
"required": ["name", "age", "skills", "grade", "email", "work_history"],
78
"additionalProperties": False,
79
+ "minProperties": 1,
80
+ "maxProperties": 10,
81
}
82
83
@@ -96,6 +98,9 @@ def unsupported_json_schema():
98
},
99
"required": ["score", "tags"],
100
"additionalProperties": False,
101
+ "patternProperties": {
102
+ "^score$": {"type": "integer"},
103
+ },
104
}
105
106
tests/v1/structured_output/test_utils.py
+2
-2
@@ -44,8 +44,6 @@ def unsupported_array_schemas():
44
@pytest.fixture
45
def unsupported_object_schemas():
46
return [
47
- {"type": "object", "minProperties": 1},
48
- {"type": "object", "maxProperties": 5},
47
{"type": "object", "propertyNames": {"pattern": "^[a-z]+$"}},
48
{"type": "object", "patternProperties": {"^S": {"type": "string"}}},
49
]
@@ -79,6 +77,8 @@ def supported_schema():
77
},
78
},
79
},
80
+ "minProperties": 1,
81
+ "maxProperties": 100,
82
}
83
84
vllm/v1/structured_output/backend_xgrammar.py
+1
-7
@@ -268,13 +268,7 @@ def has_xgrammar_unsupported_json_features(schema: dict[str, Any]) -> bool:
268
269
# Unsupported keywords for objects
270
if obj.get("type") == "object" and any(
271
- key in obj
272
- for key in (
273
- "minProperties",
274
- "maxProperties",
275
- "propertyNames",
276
- "patternProperties",
277
- )
271
+ key in obj for key in ("patternProperties", "propertyNames")
272
):
273
return True
274