Metadata-Version: 2.4
Name: grid-guardrail
Version: 0.4.2
Summary: GRID - Grammar-Railed Decoding: grammar-constrained LLM decoding with RBAC grammars and an audit trail
License: 
                                         Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link (or bind by name) to the interfaces of,
              the Work and Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent claims licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or as an addendum to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or consequential damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the file format. We also recommend that a
              file or class name and description of purpose be included on the
              same "printed page" as the copyright notice for easier
              identification within third-party archives.
        
           Copyright [yyyy] [name of copyright owner]
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
        
Project-URL: Repository, https://github.com/evolutionIdGmbH/grid
Project-URL: Changelog, https://github.com/evolutionIdGmbH/grid/blob/main/CHANGELOG.md
Keywords: constrained-decoding,structured-output,json-schema,llm,grammar
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: torch
Requires-Dist: pyyaml
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: jsonschema; extra == "dev"
Requires-Dist: hypothesis; extra == "dev"
Requires-Dist: lark; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pydantic; extra == "dev"
Provides-Extra: transformers
Requires-Dist: transformers; extra == "transformers"
Provides-Extra: kernel
Requires-Dist: grid_core>=0.2; extra == "kernel"
Dynamic: license-file

# GRID: Grammar-Railed Decoding

[![CI](https://github.com/evolutionIdGmbH/grid/actions/workflows/ci.yml/badge.svg)](https://github.com/evolutionIdGmbH/grid/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/grid-guardrail)](https://pypi.org/project/grid-guardrail/)
[![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.21486746-blue)](https://doi.org/10.5281/zenodo.21486746)
[![License](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE)

GRID is a structured-outputs engine for LLM serving. Point your stack's
grammar backend at it — vLLM today, a typed-pipeline adapter for DSPy in
[`grid/integrations/`](grid/integrations/dspy_adapter.py), SGLang and
llama.cpp on the [integration list](docs/integrations-plan.md) — and every
JSON-Schema or SQL/CFG-constrained request is enforced by token masks compiled before
sampling: a JSON Schema (or any context-free grammar — SQL was first)
becomes LALR(1) tables with constrained terminals, walked by Rust kernels.
Its founding rule is that **an engine must never fail silently**: every
constraint is either *enforced* by the mask, *recorded* by name in the
result so you know exactly what to re-validate, or *declared* unsupported up
front. Nothing in between.

```bash
pip install "grid-guardrail[kernel]"   # engine + Rust mask kernels (5 platforms)
```

```python
from grid.jsonschema import compile_json_schema

source, recorded = compile_json_schema(schema)   # -> .grid grammar source
# `recorded` names every constraint present but not mask-enforced (default
# mode records; strict=True refuses instead). Nothing is silently ignored.
```

**Deciding in 30 seconds:**

- **Serving schemas you don't control** — users, tenants, model-generated
  tool definitions? Run GRID, and pick it for its worst case, not its
  median: 3 valid-instance rejections and no silent enforcement gaps on the
  11,306-schema corpus below. The full argument — including the two cases
  where you should run llguidance or the stack default instead — is
  [docs/choosing-a-backend.md](docs/choosing-a-backend.md).
- **Need decode-time RBAC, a replayable hash-chained audit trail, or a
  machine-generated list of what was *not* enforced?** That layer is GRID's
  home ground; mask engines don't attempt it:
  [docs/beyond-the-mask.md](docs/beyond-the-mask.md).

## Where GRID stands — full JSONSchemaBench, three engines, one machine

All 11,306 schemas of [JSONSchemaBench](https://github.com/guidance-ai/jsonschemabench),
every valid/invalid test instance byte-walked, engines at current versions,
identical runner semantics and tokenizer (Llama-3.1 128k). Full per-schema
statuses and protocol: [`bench/RESULTS-jsonschemabench-v0.4.0.md`](bench/RESULTS-jsonschemabench-v0.4.0.md).

| engine | passing | declared unsupported | valid rejected | invalid accepted | never terminates |
|---|---:|---:|---:|---:|---:|
| **GRID 0.4.0** | 10,159 (89.9%) | 637 | **3** | 507 — **every one named** | **0** |
| llguidance 1.7.6 | 9,487 (83.9%) | 1,797 | 22 | 0 | 0 |
| XGrammar 0.2.3 | 10,212 (90.3%) | 51 | 427 | 627 — **all silent** | 0 |

All counts are schemas; the outcomes table below counts failing *instances*
(GRID's 507 schemas correspond to 876 instances, XGrammar's 627 to 1,493).

Three engines, three philosophies. llguidance refuses what it cannot enforce
— safe, at the cost of 16% of the corpus. XGrammar compiles almost everything
— the highest passing count, bought with the two worst failure modes: 427
schemas where **valid requests are rejected**, and 627 where invalid output
is accepted **with no indication anything was unenforced**. GRID takes the
middle contract: near-XGrammar coverage, near-llguidance safety (3
false-rejects), and when a constraint cannot be mask-enforced, the response
carries its name so downstream code re-checks exactly that.
Keyword-by-keyword status: [`grid/jsonschema/SUPPORT.md`](grid/jsonschema/SUPPORT.md);
the official JSON-Schema-Test-Suite runs in CI under that contract.

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="docs/assets/coverage-by-split-dark.svg">
  <img alt="Per-split coverage across GRID, llguidance, XGrammar" src="docs/assets/coverage-by-split-light.svg">
</picture>

### Latency and outcomes (one runner, one accounting)
times in µs , lower is better

| metric | GRID 0.4.0 | llguidance 1.7.6 | XGrammar 0.2.3 |
|:--|--:|--:|--:|
| TBM avg | 486 | **21** | 191 |
| TBM p99 | 7,741 | **294** | 757 |
| TBM p99.9 | 8,638 | **1,063** | 50,665 |
| TTFM avg | 60,905 | **624** | 362,186 |
| TTFM p99 | 1,142,255 | **6,189** | 5,037,974 |
| tokens | 3,491,288 | 2,958,083 | 3,468,252 |
| compile error | 637 | 1,797 | 51 |
| timeout | **0** | **0** | **0** |
| validation error | **5** | 32 | 671 |
| invalidation error | 876 | **0** | 1,493 |

Reading the table:

- The three engines sit at different points of the coverage/upfrontness/
  latency trade-off: compile errors are *declared* non-support (visible,
  safe — which is why that row carries no bold: lowest is not simply best);
  validation errors (valid instance rejected) and invalidation errors
  (invalid instance accepted) are silent correctness gaps — except GRID's,
  whose invalidation errors each carry the names of the unenforced
  constraints involved.
- llguidance's lazy lexer makes it the latency reference point on every
  timing row; nothing else is close. GRID's compile average
  dropped 419ms -> 66ms across the 0.3/0.4 epochs (p50 7.4ms), and — new at
  0.4.0 — **zero schemas fail to terminate**: every one of 11,306
  compiles, declares, or budget-declines deterministically inside the wall.
- GRID's TBM p25-p75 is the grid_core kernel hit path (masks up to 512
  terminals run in-kernel); the p90+ tail is cold-miss trie walks over the
  128k vocabulary. MaskBench runs each schema once — the write-back cache
  that amortizes GRID's misses across requests in serving never warms here;
  the cold walk was cut first 9.3x by the kernel v5.1 verdict-equivalence
  grouping (TBM p90 27.8ms -> 208µs vs the v3-era run), then a further ~2.8x
  by the kernel v7 fused walk->blob->register path that eliminated the
  Python-side per-cold-entry materialization cost and its gen-2 GC pauses
  (208µs -> 75µs on the SQL harness); warm-path mask p50 is 25µs (3.7µs on
  SQL/CFG grammars, GRID's home turf —
  [`bench/RESULTS-engines-sql-v0.4.0.md`](bench/RESULTS-engines-sql-v0.4.0.md)).
- GRID's TTFM is the Python table build per schema. On redeployment the
  artifact store reloads compiled schemas at warm-hit medians of 24-37ms
  for families whose cold compiles are 1.5-7.4s, neutral on cheap schemas,
  declarations identical through the store (H100 runner stamp —
  `bench/perfbench/BAKEOFF.md`).
- GRID's 5 validation errors on 11,306 schemas include 3 genuine
  valid-instance rejections — definition-order properties and spec-default
  additionalProperties (typed extras included) are accepted everywhere else.

GRID notes: grid_core kernels active on 100% of compiled schemas (the rest
exceed the 64-terminal kernel bound and run the pure-Python spec path).

Ignored-but-accepted constraints (counted per schema; the XGrammar-default
convention — these surface as invalidation errors when an invalid instance
hinges on them): oneOf-exclusivity (433), required-not-enforced (350),
scanner-budget: constrained string degraded (240), maxLength-with-pattern
(170), minLength-with-pattern (162), length windows beyond cap (453 across
four cap classes), string-constraint-terminal-too-large (97), minimum (73).

Compile-error reasons (v1 subset boundaries, llguidance-style upfront):
LALRConflictError (519), Unsupported: allOf merge failed (30), RxUnsupported
(9), terminal budget (9), rule budget (8), anyOf/oneOf/$ref sibling-key
families (20), LALRBudgetExceeded (2).

### On the serving box (H100, vLLM 0.26, Qwen2.5-7B)

Mask latency only matters through its effect on decode. Measured end to end
on the declared runner ([`bench/RESULTS-serving-v0.4.0.md`](bench/RESULTS-serving-v0.4.0.md)):

- **TPOT overhead vs unconstrained: −0.00% / +0.21% / +0.71%** at batch
  1/8/32, heterogeneous schemas per batch. Cold schema specialize **14.8 ms
  once**, warm TTFT **1.39 ms**; concurrent cold starts coalesce
  (single-flight: 1 build / 8 waiters). Known limitation, declared in the
  record: a never-seen schema costs its batch ~24% TPOT during its 0.75 s
  specialization window.
- **Small models: the mask is the accuracy win.** Spider dev, all 1,034
  questions, greedy: Qwen2.5-0.5B goes from **16.7% to 30.5% execution
  accuracy** with the mask alone (+13.7, 95% CI 10.7–16.6; +11.6 on the held-out
  test split). **Capable models: the mask is the policy win, not an accuracy
  win.** At 7B the mask alone is within noise (+0.8); the 55.2% vs 52.7% gain
  comes from one checker-triggered retry, which helps unconstrained output
  nearly as much. What the 7B model gets from GRID: with one table forbidden per
  database, a prompt rule leaks it in **86%** of the answers that need it, hiding
  it from the prompt in **22%**, and GRID in **0 of 2,068**
  ([`bench/RESULTS-spider-review-v0.4.1.md`](bench/RESULTS-spider-review-v0.4.1.md)).

## What GRID has that the others are not designed for

- **The recorded-constraints contract.** Per response, the names of every
  constraint that was accepted but not mask-enforced, so downstream code
  re-validates exactly those — or strict mode, which turns them into declared
  errors, llguidance-style. Silent acceptance is not a mode GRID has.
- **Deterministic termination as a feature.** Pathological schemas cannot
  hang the compiler: construction budgets (scanner components, LALR items)
  convert would-be timeouts into declared, recorded declines in bounded time,
  with input-derived fire points that are identical on every machine and run.
- **Conflict-retry compilation.** LALR conflicts from overlapping per-branch
  string values trigger one automatic re-normalization that unifies the
  branches (recorded as widened); schemas that compile normally never execute
  the retry path.
- **A policy and audit layer underneath.** GRID began as an enterprise SQL
  guardrail: grammars are role-projected (forbidden operations unreachable
  *by construction*), every mask decision lands in a hash-chained,
  replayable audit trail, and the provably mask-unenforceable residue goes to
  checker-guided repair. JSON Schema is a front end; any context-free grammar
  in the `.grid` dialect gets the same machinery.
- **Warm redeployments.** A versioned on-disk artifact store (default off)
  reloads grammars, tables, scanners, and cross-schema terminal components,
  keyed by a code epoch that invalidates wholesale on any engine change and
  never executes a module to compute it.
- **Serving-side machinery, measured before advertised.** A jump-forward API
  (forced token runs decoded without forward passes), a tokenizer slicer for
  vocabulary-wide string masks, and an in-kernel lazy scanner (grid_core v8)
  — each behind a flag with a differential parity gate. The slicer's GPU
  stamp is banked (TBM avg 2.3x, outcome parity 315/315) pending a default
  flip; jump-forward failed its probe against vLLM 0.26's spec-token
  accounting and stays off until the port passes. Nothing ships default-on
  without a passing probe, and the probes are in the repo.
- **A measurement discipline you can audit.** `bench/perfbench/` holds the
  two-column TTFM profiler (compile-only and first-mask-included), an outcome
  classifier that refuses to count crashed or partial records as results, the
  per-candidate A/B history of every optimization that shipped (and the ones
  rejected, with reasons), and a roadmap where every deferred claim is named.
  Numbers in this README trace to committed per-schema statuses.

## SQL with policy compiled in

```python
import grid
from grid import generate, samplers
from grid.policy.bundle import PolicyBundle
from grid.policy.schema import SchemaSnapshot

model = grid.models.transformers_model.TransformersModel.from_pretrained("gpt2")
g = generate.sql(
    model,
    open("grammars/sql_subset.grid").read(),
    policy=PolicyBundle.from_store({"analyst": {"verbs": ["select"]}}, "analyst"),
    schema=SchemaSnapshot.from_dict({"users": ["id", "name", "email"]}),
    sampler=samplers.multinomial(temperature=0.7),
)
result = g("List all user names", max_tokens=64, seed=42)
```

Per-role and per-schema grammars make unauthorized verbs, tables, and columns
unreachable at decode time; the audit chain reconstructs, bit for bit, what
the model was permitted to generate at every step. Decode-time masking is
deterministic *capability reduction*; pair it with an independent check where
the SQL executes, both compiled from one policy source. The measured RBAC
and replay records, and why this layer cannot be retrofitted onto a mask
engine, are in [docs/beyond-the-mask.md](docs/beyond-the-mask.md).

## Guarantees

Soundness, completeness, termination, and near-constant per-token cost are
stated with explicit preconditions and paired with empirical tests
(`tests/`, differential against a trial-parse oracle). See
[`DESIGN.md`](DESIGN.md) (architecture), [`GUARDRAIL-REDESIGN.md`](GUARDRAIL-REDESIGN.md)
(design rationale with proofs), [`LESSONS.md`](LESSONS.md) (the measured
history), [`ONBOARDING.md`](ONBOARDING.md) (guided tour).


## Development

```bash
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest tests/ -q                       # verification suite
(cd grid_core && maturin develop --release)      # optional Rust kernels
.venv-bench/bin/python bench/compare_engines.py  # cross-engine SQL harness
```

Benchmark methodology and full reports live in `bench/`: pinned engine
versions, declared runners, full error distributions, no cherry-picking.

## Versions

| epoch | releases | focus |
|---|---|---|
| 0.2.x | 0.2.0-0.2.5 | correctness: JSON coverage 65% -> 89.5%, the honesty contract, official JSON-Schema-Test-Suite gate in CI |
| 0.3.x | 0.3.0 | compile-time tail: measured bake-off of 20 candidates, 7 shipped; p99 4.4s -> 1.2s |
| 0.4.x | 0.4.0 | zero timeouts, kernel v8 (in-kernel lazy product), construction budgets, conflict retry, artifact store |

## Credits

The [Outlines](https://github.com/dottxt-ai/outlines) paper started this line
of work for us in 2023; GRID's design and implementation are its own
throughout. [llguidance](https://github.com/guidance-ai/llguidance) sets the
compile-latency bar and the declare-what-you-cannot-do convention our strict
mode mirrors. [XGrammar](https://github.com/mlc-ai/xgrammar) sets the
coverage bar. [JSONSchemaBench](https://github.com/guidance-ai/jsonschemabench)
is the yardstick for all of it — it found real bugs in GRID that 95 unit
tests missed.

## License

Apache-2.0. Cite via [`CITATION.cff`](CITATION.cff)
([arXiv:2607.11951](https://arxiv.org/abs/2607.11951), artifact DOI
[10.5281/zenodo.21486746](https://doi.org/10.5281/zenodo.21486746)).
