Skip to content

chat: Muse Glimmer silently ignores JSON schema constraints #58

Open

Description

@am17an

Upstream: ggml-org#29613

Muse Glimmer's chat preparation ignores a supplied JSON schema, producing no constrained-generation grammar.

Confirmed at the model-free chat layer on Spark Linux ARM64 CPU, upstream 1c4729414deba3bcacef6a5614e2ca04d069be3a. Full Glimmer model inference/HTTP was not tested.

Reproduction using common/chat.h and libllama-common: initialize templates with common_chat_templates_init(nullptr, template_text) using models/templates/muse-glimmer.jinja; call common_chat_templates_apply() with:

common_chat_templates_inputs input;
common_chat_msg msg;
msg.role = "user";
msg.content = "Tell me about Paris.";
input.messages = {msg};
input.reasoning_format = COMMON_REASONING_FORMAT_AUTO;
input.json_schema = R"({"type":"object","additionalProperties":false,"required":["city"],"properties":{"city":{"type":"string"}}})";
auto result = common_chat_templates_apply(templates.get(), input);

Observed: result.grammar.size() == 0; prompt, parser and grammar are identical with/without the schema. Control using google-gemma-4-31B-it.jinja yields a 1,599-byte grammar and changed parser.

Cause: common_chat_params_init_muse_glimmer() never consumes inputs.json_schema and only enables grammar when tools are present. Introducing commit not bisected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserver

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions