ion7-core / custom_sampler

class

ion7.core.CustomSampler

_ptr cdata Raw `llama_sampler*` for chain insertion.
_name string Human-readable name.
_name_buf cdata `char[NAME_BUF_SIZE]` holding `_name`.
_iface cdata `struct llama_sampler_i` populated with trampolines.
_cb_* cdata Anchored trampolines : DO NOT lose these refs.

Functions

CustomSampler.new

Build a custom sampler from a Lua callback table.

CustomSampler.new(name, callbacks)
namestringDisplay name (≤ 63 bytes ; truncated otherwise).
callbackstable`{ apply = fn, accept = fn?, reset = fn? }`
→ ion7.core.CustomSampler

raises — When `callbacks.apply` is missing or `llama_sampler_init` fails.

CustomSampler:ptr

Raw `llama_sampler*` cdata for plugging into a sampler chain.

CustomSampler:ptr()
→ cdata

CustomSampler:name

Display name (the same string passed to `new`).

CustomSampler:name()
→ string