Skip to content
Unverified: This page has not yet been anchored to automated code tests.

vox-constrained-gen API Reference (generated)

Crate: vox-constrained-gen · Version: 0.6.0 · Target: Library (lib.rs)

Grammar-constrained inference engine for Vox — Earley/PDA backends, deadlock watchdog, and stream-of-revision.

Grammar-constrained inference engine for Vox.

Provides a [ConstrainedSampler] trait with two backends:

  • [earley::EarleySampler] — Earley parser consuming the EBNF grammar export
  • [pda::PdaSampler] — Pushdown automaton with context-independent token caching

Both are wrapped by:

  • [deadlock::DeadlockWatchdog] — configurable timeout; produces VoxValidationError on deadlock
  • [revision::RevisionSampler] — injects a backtrack token for mid-generation self-correction

Research rationale: Grammar Constraints §4.4 proves deadlocks are systemic, not edge-case. XGrammar-2/llguidance PDA backends achieve <40µs/token with native recursion support.

DependencyKind
vox-grammar-exportNormal
ModuleDescription
deadlock—
earley—
pda—
revision—