b9744

ggml-org/llama.cppb9744Jun 21, 2026by github-actions[bot]same day as b9743

What changed since b9743

low risk

GBNF grammar generation is refactored onto an Aho-Corasick automaton, speeding up grammar construction and changing state numbering output.

Breaking changes

  • Generated GBNF grammar text now uses zero-padded state numbers, so any snapshot or golden-file comparisons of grammar output may need updating.

Improvements

  • Grammar generation for the 'until' construct is now built as an Aho-Corasick automaton, improving construction performance.
  • State numbers are zero-padded so generated rules line up visually and are easier to diff.
  • Internal containers switched to set-based lookups and comments cleaned up for maintainability.
  • Added test coverage exercising multiple strings in the grammar path.

Bug fixes

  • Fixed a regression in server-tools.cpp introduced during the grammar refactor.

Upgrade notes

No configuration or API changes are required; this is an internal refactor of the grammar pipeline. If you assert on exact generated GBNF text, regenerate expected outputs because state numbering and padding differ. The prior release's JSON-schema spacing alignment is already included in this build.

Analyzed Nov 1, 2026

Upgrading?

Release notes summary

Refactors GBNF (General Base-N Grammar) grammar generation into an Aho-Corasick automaton, improving performance and rule alignment.

Key Highlights

  • Refactors GBNF grammar generation to use Aho-Corasick automaton
  • Adds padding to state numbers for rule alignment
  • Clean up comments and fix regression in server-tools

New Features

  • Grammar generation optimization

Release Notes (excerpt)

<details open> common/peg : refactor until gbnf grammar generation (#24839) * common/peg : refactor until gbnf grammar into an ac automaton * cont : add a test with multiple strings * cont : pad state with 0s so rules line up * cont : clean up comments * cont : use set everywhere * cont : inline state num string padding * cont : add a ref to PR * cont : fix regression in server-tools.cpp </details> **macOS/iOS:** - macOS Apple Silicon (arm64)…

Published by ggml-org on GitHub.

Read the full release notes

Related Repositories