Skip to content

fix(ik-llama-cpp): adapt to common_grammar struct in sampling.h#9512

Merged
mudler merged 1 commit into
masterfrom
fix/ik-llama-cpp-grammar-bump
Apr 23, 2026
Merged

fix(ik-llama-cpp): adapt to common_grammar struct in sampling.h#9512
mudler merged 1 commit into
masterfrom
fix/ik-llama-cpp-grammar-bump

Conversation

@mudler
Copy link
Copy Markdown
Owner

@mudler mudler commented Apr 23, 2026

Upstream ik_llama.cpp commit e0596bf6 ("Autoparser") changed common_params_sampling::grammar from std::string to a common_grammar struct (type + grammar), which broke our two direct accesses:

  • JSON ingest fed the field through json_value<common_grammar>(...), for which nlohmann has no from_json adapter.
  • JSON export emitted the struct directly, for which nlohmann has no to_json adapter.

Wrap the incoming JSON string in common_grammar{COMMON_GRAMMAR_TYPE_USER, ...} and serialize via the inner .grammar member, mirroring upstream's examples/server/server-context.cpp.

Also bump IK_LLAMA_VERSION to 286ce324baed17c95faec77792eaa6bdb1c7a5f5 so the local-ai side lines up with the dependency bump in #9496.

Assisted-by: Claude-Code:claude-opus-4-7

Upstream ik_llama.cpp commit e0596bf6 ("Autoparser") changed
common_params_sampling::grammar from std::string to a common_grammar
struct (type + grammar), which broke our two direct accesses:

 - JSON ingest fed the field through json_value<common_grammar>(...),
   for which nlohmann has no from_json adapter.
 - JSON export emitted the struct directly, for which nlohmann has no
   to_json adapter.

Wrap the incoming JSON string in common_grammar{COMMON_GRAMMAR_TYPE_USER, ...}
and serialize via the inner .grammar member, mirroring upstream's
examples/server/server-context.cpp.

Also bump IK_LLAMA_VERSION to 286ce324baed17c95faec77792eaa6bdb1c7a5f5
so the local-ai side lines up with the dependency bump in #9496.

Assisted-by: Claude-Code:claude-opus-4-7
@mudler mudler merged commit 04f1a02 into master Apr 23, 2026
41 checks passed
@mudler mudler deleted the fix/ik-llama-cpp-grammar-bump branch April 23, 2026 11:45
@localai-bot localai-bot added the bug Something isn't working label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants