hn.today

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

github.com3 points0 comments
Screenshot of Sieve-df: a Rust fuzzer for LLM structured-output engines (llguidance, outlines)

Sieve-df is an open-source Rust fuzzer for testing whether engines that constrain language-model output to JSON Schema behave correctly. It needs no model weights: it loads a tokenizer vocabulary and takes random walks through each engine’s permitted-token masks, weighting boundary tokens such as punctuation and leading-space tokens. It can link directly to llguidance and outlines-core, and connect to XGrammar through a JSON-lines subprocess bridge; llama.cpp’s grammar sampler is an optional integration. Schemas can come from built-in examples, files, MCP tool definitions, test suites, benchmarks, or generated mutations covering cases such as recursive references, patterns, Unicode enums, and numeric bounds.

The fuzzer looks for masks that permit tokens an engine later rejects, permitted tokens that lead to impossible completions, and disagreements between engines. To judge disagreements, it attempts to complete the output and validates it with jsonschema-rs: a valid completion indicates that a blocking engine is too strict, while failure to find one points to an overly permissive engine. It also detects invalid end-of-sequence allowances, crashes, and hangs. Findings can be replayed, minimized to a small schema and token path, and turned into draft bug reports; results are tracked by engine, schema feature, and tokenizer. The project also offers coverage-guided fuzzing and latency benchmarks, with a quick-start path that needs no downloads.

Read on github.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.