diff --git a/vllm/v1/engine/processor.py b/vllm/v1/engine/processor.py index a0b170ba55ad7..7e7703df2cf10 100644 --- a/vllm/v1/engine/processor.py +++ b/vllm/v1/engine/processor.py @@ -173,6 +173,12 @@ class Processor: params.guided_decoding.backend = engine_level_backend # Request content validation + if (isinstance(params.guided_decoding.choice, list) + and not params.guided_decoding.choice): + # It is invalid for choice to be an empty list + raise ValueError(f"Choice '{params.guided_decoding.choice}' " + "cannot be an empty list") + if engine_level_backend.startswith("xgrammar"): # xgrammar with no fallback validate_xgrammar_grammar(params)