Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GBNF (GGML BNF) grammar builder that exposes the GBNF notation system using a syntax that reflects the resulting grammar.

License

Notifications You must be signed in to change notification settings

yaphott/grammatica

Repository files navigation

Grammatica Logo

Grammatica: GBNF grammar building toolkit

Testing Ubuntu codecov
Package PyPI - Version Conda Version
Meta PyPI - License

What is it?

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.

Table of Contents

Requirements

Grammatica requires Python 3.10 or higher and is platform independent.

Important

typing-extensions is required for Python 3.11 and lower.

Issue Reporting

If you discover an issue with Grammatica, please report it at https://github.com/yaphott/grammatica/issues.

Installing

Install from PyPI:

pip install grammatica

Install from GitHub:

git clone git+https://github.com/yaphott/grammatica.git
cd grammatica
pip install -e .

Useful Links


Go to Top

About

GBNF (GGML BNF) grammar builder that exposes the GBNF notation system using a syntax that reflects the resulting grammar.

Topics

Resources

License

Stars

Watchers

Forks

Contributors