|
Entropic 2.9.4
Local-first agentic inference engine
|
Sampler adapter that wraps a llama_sampler* chain.
More...
#include </home/runner/work/entropic/entropic/src/inference/llama_cpp_sampler.h>


Public Member Functions | |
| LlamaCppSampler (llama_sampler *chain, llama_context *ctx) | |
| Construct with an already-built llama_sampler chain. | |
| ~LlamaCppSampler () override | |
| Free the underlying llama.cpp sampler chain. | |
| LlamaCppSampler (const LlamaCppSampler &)=delete | |
| LlamaCppSampler & | operator= (const LlamaCppSampler &)=delete |
| int32_t | sample () override |
| Sample one token from the current logits via the wrapped chain. | |
| void | reset () override |
| Reset llama_sampler internal state. | |
| llama_sampler * | native_chain () const |
| Expose the underlying chain for legacy call sites that have not yet been ported to the Sampler API. | |
Sampler adapter that wraps a llama_sampler* chain.
Owns the chain (freed in destructor). Stores a non-owning llama_context* snapshot captured at factory creation time; the backend guarantees the context outlives every Sampler it vends.
Definition at line 47 of file llama_cpp_sampler.h.
| entropic::LlamaCppSampler::LlamaCppSampler | ( | llama_sampler * | chain, |
| llama_context * | ctx | ||
| ) |
Construct with an already-built llama_sampler chain.
Construct an LlamaCppSampler wrapping a pre-built sampler chain.
| chain | Owning pointer to llama_sampler chain. |
| ctx | Non-owning llama_context (snapshot at sampler birth). |
Definition at line 120 of file llama_cpp_sampler.cpp.
|
override |
Free the underlying llama.cpp sampler chain.
Definition at line 128 of file llama_cpp_sampler.cpp.
|
inline |
Expose the underlying chain for legacy call sites that have not yet been ported to the Sampler API.
Production callers in the decode loop should use sample() directly; this accessor exists for transition-period code and for tests asserting that production wiring really produces a non-null chain.
llama_sampler* (never null for the production Sampler; do not free). Definition at line 88 of file llama_cpp_sampler.h.
|
overridevirtual |
Reset llama_sampler internal state.
Reset stateful samplers (e.g.
Forwards to llama_sampler_reset so callers re-seeding a generation pick up a fresh RNG / penalty-window state.
repeat-penalty history) on the chain.
Reimplemented from entropic::Sampler.
Definition at line 151 of file llama_cpp_sampler.cpp.
|
overridevirtual |
Sample one token from the current logits via the wrapped chain.
Implements entropic::Sampler.
Definition at line 141 of file llama_cpp_sampler.cpp.