cd /news/ai-tools/sieve-df-a-rust-fuzzer-for-llm-struc… Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-182533] src=github.com β†— pub= topic=ai-tools verified=true sentiment=↑ positive

Sieve-df: a Rust fuzzer for LLM structured-output engines (llguidance, outlines)

A new open-source Rust tool called sieve-df fuzzes LLM structured-output engines by walking token masks against JSON Schemas without loading model weights, checking llguidance, outlines-core, XGrammar and optionally the llama.cpp grammar sampler. At each decoding step sieve-df flags four bug classes β€” contradictions, dead ends, cross-engine disagreements and invalid outputs β€” plus crashes and hangs, then shrinks each finding to a minimal schema and token path and writes a markdown issue draft. Disagreements are adjudicated by attempting to finish the output and validating it with jsonschema-rs: a valid finish means the blocking engine is too strict, and if none can be produced the allowing engine is too loose.

key takeaway

sieve-df drives llguidance and outlines-core as linked Rust crates and XGrammar through a JSON-lines subprocess bridge, using only an ungated tokenizer.json to find mask contradictions, dead ends and cross-engine disagreements, then shrinks each to a minimal schema plus token path.

read3 min views1 publishedDec 5, 2026
Sieve-df: a Rust fuzzer for LLM structured-output engines (llguidance, outlines)
Image: Michielbdejong (auto-discovered)

At every decoding step sieve-df checks whether an engine's token mask allows exactly the right tokens for a JSON Schema. It needs no model weights: it loads an ungated tokenizer.json (for example a Qwen tokenizer from Hugging Face) and does random token walks over the mask, weighted toward boundary tokens such as ":, "},{" and leading-space tokens.

Engine How it is driven
llguidance Rust crate, linked directly
outlines-core Rust crate, linked directly
XGrammar Python, through a JSON-lines subprocess bridge
llama.cpp grammar sampler (optional) via llama-cpp-python and a vocab-only GGUF generated from tokenizer.json ;scripts/setup_llamacpp.sh ; needs a real tokenizer

Everything is free and open source; nothing needs an account, API key or card.

  1. Contradictions – the mask allows a token, but the engine rejects it when it is fed.
  2. Dead ends – an allowed token leads to a state with an empty mask that cannot finish.
  3. Disagreements – two engines differ on one token. To decide who is right sieve-df tries to finish the output and validates it withjsonschema-rs : a valid finish means theblocking engine is too strict; if none can be produced, theallowing engine is too loose.
  4. Invalid outputs (EOS allowed for a document that violates the schema),crashes (engine panics, isolated) andhangs (compile blow-ups).

Each bug is shrunk to a minimal schema plus token path, written as a markdown issue draft, and counted in an engine x JSON Schema feature x tokenizer table.

cargo build --release
examples/quickstart.sh            # built-in vocabulary, bundled schemas, no downloads

With a real tokenizer and the other engines:

scripts/fetch_tokenizer.sh        # Qwen2.5 tokenizer.json -> data/tokenizers/qwen2.5.json
scripts/setup_xgrammar.sh         # optional: .venv with XGrammar (no torch needed)
scripts/fetch_corpora.sh          # optional: JSON Schema Test Suite + JSONSchemaBench

target/release/sieve-df run \
  --tokenizer data/tokenizers/qwen2.5.json \
  --engines llguidance,outlines-core,xgrammar \
  --builtin --mcp examples/mcp \
  --suite data/corpora/json-schema-test-suite \
  --bench data/corpora/jsonschemabench --bench-subsets Handwritten,Kubernetes \
  --mutants 3 --walks 20 --out out/run
Command Purpose
sieve-df run fuzz: random walks ( --mode single|differential|both ) over the selected schemas; writesfindings.jsonl ,findings/*.json ,stats.json
sieve-df replay <findings> re-run saved findings and report whether they still reproduce
sieve-df shrink <findings> reduce findings to a minimal schema + token path, deduplicated into unique bugs ( minimized.jsonl )
sieve-df report --minimized … write one markdown issue draft per bug, results.md/csv andindex.md
sieve-df bench compile and mask-computation latency per engine

Schema sources for run and bench: --schemas (files/dirs), --mcp (MCP tool definitions), --suite (JSON Schema Test Suite), --bench (JSONSchemaBench), --builtin, plus --mutants N to add mutated variants (nested anyOf, $ref recursion, pattern, unicode enums, escaped keys, bounds), --filter, --limit, --shuffle.

fuzz/ holds cargo-fuzz targets that feed mutated schemas and walks to the linked engines with libFuzzer's coverage feedback; see fuzz/README.md.

MIT

── more in #ai-tools 4 stories Β· sorted by recency
── more on @sieve-df 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/sieve-df-a-rust-fuzz…] indexed:0 read:3min 2026-12-05 Β· β€”