Grammatica: GBNF grammar building toolkit
| Testing | |
| Package | |
| Meta |
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-extensionsis 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
- Grammatica Documentation
- Introduction to GGML (Hugging Face)
- GBNF Guide (llama.cpp)
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)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| grammatica-0.2.0.tar.gz | 44.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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.