vllm.v1.structured_output.backend_outlines ¶
OutlinesGrammar dataclass ¶
Bases: StructuredOutputGrammar
Source code in vllm/v1/structured_output/backend_outlines.py
accept_tokens ¶
Accepts a list of tokens and advances the FSM.
Returns True if the FSM was advanced successfully. Returns False if the FSM failed to advance.
Source code in vllm/v1/structured_output/backend_outlines.py
_check_unsupported ¶
Check for regex features unsupported by regex-automata
Source code in vllm/v1/structured_output/backend_outlines.py
_prefix_needs_context ¶
_prefix_needs_context(parsed) -> bool
Return True if there's a look-around/anchor before any consumer.
Source code in vllm/v1/structured_output/backend_outlines.py
validate_regex_is_buildable ¶
validate_regex_is_buildable(pattern: str) -> None
Validates that the input regex is not using unsupported features of the regex-automata crate (outlines_core regex engine) and has a universal start state. definition of universal start state used can be found at: https://docs.rs/regex-automata/latest/regex_automata/dfa/trait.Automaton.html#method.universal_start_state