XGrammar Python API¶
- xgr.Grammar
- xgr.TokenizerInfo
- xgr.GrammarCompiler
- xgr.CompiledGrammar
- xgr.GrammarMatcher
- xgr.testing
_json_schema_to_ebnf()
_regex_to_ebnf()
_ebnf_to_grammar_no_normalization()
_get_matcher_from_grammar()
_is_grammar_accept_string()
_get_masked_tokens_from_bitmask()
_is_single_token_bitmask()
_bool_mask_to_bitmask()
_get_matcher_from_grammar_and_tokenizer_info()
_get_allow_empty_rule_ids()
_generate_range_regex()
_generate_float_regex()
GrammarFunctor
- Structural Tag
- Bitmask Operations
- Configuration