github mlc-ai/xgrammar v0.2.6

4 hours ago

Highlights since v0.2.5:

  • Harden input validation, deserialization, and worker-thread error handling so invalid inputs raise exceptions instead of crashing the process (#869). Preserve tokenizer JSON round trips, including binary vocabulary and token-grammar compilation (#879).
  • Extend EBNF and Lark grammars with capture, lazy matching, suffix/stop conditions, token and character budgets, and sampling temperature options. Add Lark regex flags, structured substring expressions, and a cached GrammarCompiler.compile_lark API.
  • Improve grammar compilation with direct JSON Schema AST construction, shared FSM construction, in-place optimizer passes, and cached parser-state properties.
  • Add Cohere XML, Kimi K3, and EXAONE 4.0 structural tags, plus max_tokens / max_chars support for AnyTextFormat and AnyTokensFormat.
  • Fix JSON carriage-return whitespace, positional prefixItems handling, NUL regex rejection, repeat-edge metadata, and grammar serialization keys.
  • Add an NPU token-bitmask backend and Windows ARM64 wheels. Reduce Python wheel size and expand the documentation.

Full changelog: v0.2.5...v0.2.6

Don't miss a new xgrammar release

NewReleases is sending notifications on new releases.