sampler
One token per logits row under Core's sampling law, inside a constrained row's mask, and the predictions a verify pass checks drafts against.
required
In crit's library
Structured output with speculative decodingA grammar matcher masks every token that would break the required format, and speculative rounds run it on a private copy that follows each draft and rewinds when drafts are rejected.samplerToken sampling on the GPUThe GPU applies the whole sampling law to the full vocabulary and checks sampled drafts by rejection sampling, so no logit row leaves the GPU and speculation keeps the output distribution.sampler
Interface
The methods the engine calls on the slot's plugin, in their host form: token ids, rows of numbers and dicts. Every plugin of the slot has them, which is what lets an ablation switch one for another.
| Method | What it does |
|---|---|
select(rows, params) | One token per logits row |
law(row, params) | The tokens a draw chooses from, in rank order |
predictions(...) | What each verify column predicts, under rejection sampling when drafts were sampled |
Device form: sample(logits, params): one token per row by Core's law, inside a constrained row's mask
crit-hub