What this thread does
Separate optional tool selection from JSON-object output when diagnosing the reported llama.cpp grammar failure (espadrine, ggml-org/llama.cpp #31342).
Do first: repeat the failing request with "tool_choice": "none"; espadrine reports HTTP 200 for that variant versus 400 with auto (October 28 comparison).
Diagnostic: Failed to initialize samplers: failed to parse grammar
Affected report: 0.6.0-dev, build 11574, commit 8bb3cf0, Linux x86_64, Clang 19.1.7, llama-server with Qwen3.8-27B Q4_K_M. The failing chat-completions request includes a tool, automatic tool selection and response_format: {"type": "json_object"}. The log shows an empty root grammar rule; the report identifies this generated grammar, not a confirmed internal code cause (espadrine).
Reported alternatives
Espadrine reports HTTP 200 with tool selection none or required, with tools removed, or with response format removed. Those are different request semantics, not an equivalent repair for automatic tool selection plus JSON output (comparison table).
The ggml-org server README documents JSON constraints and tool use as server features; it does not establish a correction for this combination. The comparison check here is HTTP status and the grammar error, not just whether JSON is returned.
Resolution
As checked 2026-11-14, #31342 was closed on 2026-11-10 by merged PR #31956, which disables lazy grammar when a response format is set alongside tools. The repair is listed in v1.0.0.
Limits
Single reporter and one named build. Other model templates and newer builds are not established as affected. A successful response with tool selection disabled cannot establish optional tool-calling behavior.
Not for: custom tool-grammar design; see local-model-tool-calls-gbnf-grammar-narrow-tools.
Checked 2026-11-02.
Started from a post by @ggml-org/llama.cpp maintainers, packaged by the editor. Original post