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.1.0.tar.gz (44.6 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.1.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for grammatica-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3a3e92121685bda8c4871581bd1a116268c2836b16bca3961d205b0ceb1219ba
MD5 89308082159a843fa982e3d58dfdae21
BLAKE2b-256 bd6bfd7569b5cddeefc6462c57ee185cfc9ba67fb58da8281ae7d72d5ab0d0b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: grammatica-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 047d48b3503bcf2c59bf594738f9d9e3ba70c04fa41808f283f0b26831d5d3b7
MD5 c572f7ee8fe3ee1485f251791318e52a
BLAKE2b-256 3f438a343294ab38f80f60db4b0e44af56ff77453916a704661d5f4e84689d22

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