vllm.config.structured_outputs ¶
StructuredOutputsBackend module-attribute
¶
StructuredOutputsBackend = Literal[
"auto",
"xgrammar",
"guidance",
"outlines",
"lm-format-enforcer",
]
StructuredOutputsConfig ¶
Dataclass which contains structured outputs config for the engine.
Source code in vllm/config/structured_outputs.py
backend class-attribute
instance-attribute
¶
backend: StructuredOutputsBackend = 'auto'
Which engine will be used for structured outputs (e.g. JSON schema, regex, etc) by default. With "auto", we will make opinionated choices based on request contents and what the backend libraries currently support, so the behavior is subject to change in each release.
disable_additional_properties class-attribute
instance-attribute
¶
disable_additional_properties: bool = False
If True
, the guidance
backend will not use additionalProperties
in the JSON schema. This is only supported for the guidance
backend and is used to better align its behaviour with outlines
and xgrammar
.
disable_any_whitespace class-attribute
instance-attribute
¶
disable_any_whitespace: bool = False
If True
, the model will not generate any whitespace during structured outputs. This is only supported for xgrammar and guidance backends.
disable_fallback class-attribute
instance-attribute
¶
disable_fallback: bool = False
If True
, vLLM will not fallback to a different backend on error.
reasoning_parser class-attribute
instance-attribute
¶
reasoning_parser: str = ''
Select the reasoning parser depending on the model that you're using. This is used to parse the reasoning content into OpenAI API format.
__post_init__ ¶
Source code in vllm/config/structured_outputs.py
compute_hash ¶
compute_hash() -> str
WARNING: Whenever a new field is added to this config, ensure that it is included in the factors list if it affects the computation graph.
Provide a hash that uniquely identifies all the configs that affect the structure of the computation graph from input ids/embeddings to the final hidden states, excluding anything before input ids/embeddings and after the final hidden states.