vox-constrained-gen API Reference (generated)
vox-constrained-gen
Section titled “vox-constrained-gen”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.
Crate Overview
Section titled “Crate Overview”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; producesVoxValidationErroron 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.
Workspace Dependencies
Section titled “Workspace Dependencies”| Dependency | Kind |
|---|---|
vox-grammar-export | Normal |
Public API Surface
Section titled “Public API Surface”Modules
Section titled “Modules”| Module | Description |
|---|---|
deadlock | — |
earley | — |
pda | — |
revision | — |