Skip to content

server : return HTTP 400 on invalid grammar (#24144)#24154

Open
Anuj-Attri wants to merge 1 commit into
ggml-org:masterfrom
Anuj-Attri:fix/server-invalid-grammar-400
Open

server : return HTTP 400 on invalid grammar (#24144)#24154
Anuj-Attri wants to merge 1 commit into
ggml-org:masterfrom
Anuj-Attri:fix/server-invalid-grammar-400

Conversation

@Anuj-Attri
Copy link
Copy Markdown

Overview

Server returns HTTP 400 on invalid grammar instead of silently
dropping the constraint. Re-adds the null check on grmr that
was removed in #17937 during the sampler refactor.

Additional information

A regression test is added in
tools/server/tests/unit/test_chat_completion.py.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES. I used Claude as a rubber duck to understand the codebase and find files. I wrote the code and tests.

Fixes #24144

Throw on grammar parse failure so the server returns HTTP 400
instead of silently dropping the constraint.
Add a regression test for the invalid-grammar response.

Fixes ggml-org#24144
@Anuj-Attri Anuj-Attri requested review from a team as code owners June 5, 2026 01:59
@github-actions github-actions Bot added examples python python script changes server labels Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples python python script changes server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: server: invalid GBNF grammar is silently ignored instead of returning HTTP 400 (regression from #17937)

2 participants