Skip to main content
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

Metadata

Release files for grammatica 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grammatica 0.2.0
File Size Uploaded Provenance
grammatica-0.2.0.tar.gz 44.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for grammatica 0.2.0
File Interpreter ABI Platform
grammatica-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.3 kB

Release files / grammatica-0.2.0.tar.gz

Download URL grammatica-0.2.0.tar.gz
Size 44.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bd63906caa6de393dd120eb3095479205d3fc02fef99a5b82be209d583ffc56a
BLAKE2b-256 checksum
How to use checksums
473961fb0d22163aa176302043219942640b8040d436e0153483c8985aabaff3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / grammatica-0.2.0-py3-none-any.whl

Download URL grammatica-0.2.0-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
726029d9840f4bdf348454d32ba3c83f22e906a3ec65b2fa6856818359818d26
BLAKE2b-256 checksum
How to use checksums
590b35635d08dfbbe105fa6b607bfe754100eb08d1d0f1c7d34642550e3c0cf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for grammatica 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page