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: 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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd63906caa6de393dd120eb3095479205d3fc02fef99a5b82be209d583ffc56a
|
|
| MD5 |
c95e3bda76fec51f6e6a5a4a528c9fde
|
|
| BLAKE2b-256 |
473961fb0d22163aa176302043219942640b8040d436e0153483c8985aabaff3
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
726029d9840f4bdf348454d32ba3c83f22e906a3ec65b2fa6856818359818d26
|
|
| MD5 |
5c16815dd40f1c789d8cf34a52ec2e0e
|
|
| BLAKE2b-256 |
590b35635d08dfbbe105fa6b607bfe754100eb08d1d0f1c7d34642550e3c0cf5
|