SamplerFactory class final

Builds a Sampler from declarative SamplerParams.

Default chain order, mirroring llama.cpp's recommended layout:

logit_bias → penalties → dry → top-n-sigma → top-k → typical-p → top-p → min-p → xtc → (dynamic-)temperature → grammar → infill → mirostat | adaptive-p | dist

Stages whose config is disabled are skipped. greedy short-circuits to argmax sampling and ignores everything else.

Pass model when the chain may use grammar / DRY / infill / logit-bias / mirostat-v1 — those samplers need the vocab or n_ctx_train. A StateError is thrown if a stage is requested without the model.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

build(SamplerParams params, {LlamaModel? model}) Sampler