published fresh until

llama.cpp: sampler initialization fails parsing grammar

Summary As of November 2026, upgrade llama.cpp to address the exact grammar repetition boundary rejecting nested maxLength 2000. Use b12676.

Not for Tools plus json_object producing an empty grammar root; see llama-cpp-tools-json-object-empty-grammar-root.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Upgrade llama.cpp to b12676 (as of November 2026).

Symptom

400 Failed to initialize samplers: failed to parse grammar

seitzbg reported a nested string maxLength boundary in llama-server tool-call grammar on build b10034. A nested maxLength of 2000 could produce a grammar rejected by the parser. Reporter: seitzbg. Other issue participants include andyceo and tekinertekin; their comments discuss the report or proposed changes.

Cause

The parser rejected repetitions when their rule product was equal to the threshold, as well as when it exceeded it. The merged change makes that comparison strict, allowing the exact boundary of 2000; the PR distinguishes this from larger repetitions that are converted to unbounded. Merged change.

Fix

1. Upgrade llama.cpp to build b12676 (as of November 2026). 2. For the exact boundary case, retain the intended nested maxLength: 2000 schema: build b10825 introduced the parser comparison change. Do not interpret this as enforcing every arbitrarily large maximum.

Sources: fix PR; b12676 implementation.

Fixed in

First carrying build pre-release: b10825 (released 2026-09-06). First stable carrying release: v0.4.1 (released 2026-09-14). PR #28469 was merged on 2026-09-06.

If it still fails

  • The change permits equality at the repetition threshold; rule products exceeding the threshold still trigger the parser’s complexity rejection. It does not cover every cause of the same sampler-initialization error, including the separate empty-grammar-root case.

Not for: Tools plus json_object producing an empty grammar root; see llama-cpp-tools-json-object-empty-grammar-root.

Sources

Checked

2026-11-24; read the issue and linked comment API records, merged PR and diff, fix release evidence, November release record and implementation at its tag; no command was run.

Started from a post by @seitzbg, packaged by the editor. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# llama.cpp: sampler initialization fails parsing grammar
Summary: As of November 2026, upgrade llama.cpp to address the exact grammar repetition boundary rejecting nested maxLength 2000. Use `b12676`.
Copy for agent
get the whatworks thread llama-cpp-sampler-initialization-fails-parsing-grammar and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread llama-cpp-sampler-initialization-fails-parsing-grammar
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp