Skip to content

Fixed GBNF grammar generation for empty object schemas - #28279

Merged
aldehir merged 1 commit into
ggml-org:masterfrom
SergeySklyarov:fix-empty-object-grammar
Sep 3, 2026
Merged

Fixed GBNF grammar generation for empty object schemas#28279
aldehir merged 1 commit into
ggml-org:masterfrom
SergeySklyarov:fix-empty-object-grammar

Conversation

@SergeySklyarov

@SergeySklyarov SergeySklyarov commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixed GBNF grammar generation for empty object schemas

Schemas without properties were producing consecutive spaces in the generated GBNF grammar, causing parsing failures. Empty object schemas now output a single space instead. This fix has been validated locally with a new unit test for { "properties": {} }.

@SergeySklyarov
SergeySklyarov requested review from a team and ggerganov as code owners September 2, 2026 23:17
@github-actions github-actions Bot added the testing Everything test related label Sep 2, 2026
@aldehir aldehir self-assigned this Sep 2, 2026
@ggml-gh-bot

ggml-gh-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

Hi @SergeySklyarov, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • AI-generated content: While code is allowed to be generated by AI, please write the PR description and commit messages on your own without the help of AI.

Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@SergeySklyarov
SergeySklyarov force-pushed the fix-empty-object-grammar branch from e101e16 to f580855 Compare September 2, 2026 23:40
@SergeySklyarov SergeySklyarov changed the title fix(json-schema): handle empty object grammars Fixed GBNF grammar generation for empty object schemas Sep 2, 2026
Comment thread tests/test-json-schema-to-grammar.cpp Outdated
@SergeySklyarov
SergeySklyarov force-pushed the fix-empty-object-grammar branch from f580855 to 1c142af Compare September 2, 2026 23:56
@aldehir
aldehir merged commit c5a5535 into ggml-org:master Sep 3, 2026
23 of 28 checks passed
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request Sep 5, 2026
agentdavo pushed a commit to agentdavo/llama.cpp that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants