grammar: introduce new grammar package

This package provides a way to convert JSON schemas to equivalent EBNF.
It is intended to be a replacement to llama.cpp's schema_to_grammar.

This is still an early version and does not yet support all JSON schema
features. The to-do list includes:

- minumum/maximum constraints on integer types
- minLength/maxLength constraints on string types
- defs and refs
This commit is contained in:
Blake Mizerany
2024-12-11 17:50:29 -08:00
committed by ParthSareen
parent 7cd9fbbbb1
commit 089bbb537d
23 changed files with 1314 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
-- old --
hello world
-- new --
hello world
-- diff --