Skip to main content

Grammatica is a GBNF (GGML BNF) grammar builder that exposes the full richness of the GBNF notation system using a syntax that reflects the resulting grammar.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grammatica-0.2.0.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grammatica-0.2.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file grammatica-0.2.0.tar.gz.

File metadata

  • Download URL: grammatica-0.2.0.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for grammatica-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bd63906caa6de393dd120eb3095479205d3fc02fef99a5b82be209d583ffc56a
MD5 c95e3bda76fec51f6e6a5a4a528c9fde
BLAKE2b-256 473961fb0d22163aa176302043219942640b8040d436e0153483c8985aabaff3

See more details on using hashes here.

File details

Details for the file grammatica-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: grammatica-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for grammatica-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 726029d9840f4bdf348454d32ba3c83f22e906a3ec65b2fa6856818359818d26
MD5 5c16815dd40f1c789d8cf34a52ec2e0e
BLAKE2b-256 590b35635d08dfbbe105fa6b607bfe754100eb08d1d0f1c7d34642550e3c0cf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page