Skip to content

Conversation

@glebashnik
Copy link
Contributor

This exposes exposes C++ function to convert JSON schema to GBNF grammar.
GBNF grammar is an inference parameter to generate structured output, which is often useful to reduce hallucinations.
https://github.com/ggml-org/llama.cpp/blob/master/grammars/README.md.

@kherud
Copy link
Owner

kherud commented Mar 9, 2025

Hey @glebashnik thank you very much for the PR! We worked on a bigger update to the latest llama.cpp version so it had to wait a little, but it should now be merged and released soon.

When I just tested it, the json schema to grammar test failed because of a slight difference:

grafik

I assume this is due to a change in the implementation since the last version. I hope it's ok that I adapted it. Otherwise everything looks good to me.

@kherud kherud merged commit 7a8dc54 into kherud:master Mar 9, 2025
4 checks passed
@glebashnik
Copy link
Contributor Author

Thank for the fix and new release, @kherud! Indeed, there was a small change in underlying C++ implementation of grammar generator.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants