• Home
  • Docs
  • Github
  • Blog
Logo
0.1.21

Get Started

  • Installation
  • Quick Start

Tutorials

  • Constrained Decoding
  • Workflow of XGrammar
  • Advanced Topics
  • Integration with LLM Engine
  • JSON Generation
  • EBNF-Guided Generation

XGrammar Features

  • Runtime Safeguards
  • JavaScript API

Developer Guide

  • Building Docs
  • Code Coverage

API Reference

  • XGrammar Python API
    • xgr.Grammar
    • xgr.TokenizerInfo
    • xgr.GrammarCompiler
    • xgr.CompiledGrammar
    • xgr.GrammarMatcher
    • xgr.testing
    • Structural Tag
    • Bitmask Operations
    • Configuration
Table of Contents
  • Docs >
  • XGrammar Python API
  • Edit on GitHub

XGrammar Python API¶

  • xgr.Grammar
    • Grammar
  • xgr.TokenizerInfo
    • VocabType
    • TokenizerInfo
  • xgr.GrammarCompiler
    • GrammarCompiler
  • xgr.CompiledGrammar
    • CompiledGrammar
  • xgr.GrammarMatcher
    • 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
    • StructuralTagItem
  • Bitmask Operations
    • allocate_token_bitmask()
    • apply_token_bitmask_inplace()
    • reset_token_bitmask()
    • get_bitmask_shape()
    • bitmask_dtype
  • Configuration
    • Recursion Depth Management
Next Previous
backtop
© 2024 XGrammar