| Testing | |
| Package | |
| Meta |
Grammatica is a GBNF (GGML BNF) grammar builder that exposes the GBNF notation system using a syntax that reflects the resulting grammar. These grammars can be used to restrict the output of LLMs using interface engines such as llama.cpp.
Grammatica requires Python 3.10 or higher and is platform independent.
Important
typing-extensions is required for Python 3.11 and lower.
If you discover an issue with Grammatica, please report it at https://github.com/yaphott/grammatica/issues.
Install from PyPI:
pip install grammaticaInstall from GitHub:
git clone git+https://github.com/yaphott/grammatica.git
cd grammatica
pip install -e .- Grammatica Documentation
- Introduction to GGML (Hugging Face)
- GBNF Guide (llama.cpp)