Entropic 2.9.4
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::SamplerFactory Class Referenceabstract

Factory that materializes a Sampler from GenerationParams. More...

#include <entropic/inference/sampler.h>

Inheritance diagram for entropic::SamplerFactory:

Public Member Functions

virtual std::unique_ptr< Samplercreate (const GenerationParams &params)=0
 Build a configured Sampler for one generation.
 

Detailed Description

Factory that materializes a Sampler from GenerationParams.

Held by LlamaCppBackend for the duration of its ACTIVE state. The decode loop calls create() once per generation. The concrete production impl (LlamaCppSamplerFactory) snapshots the active llama_context* and llama_vocab* at construction; the backend's do_deactivate destroys the factory BEFORE freeing those resources so no dangling-pointer window exists.

Version
2.3.10

Definition at line 93 of file sampler.h.

Member Function Documentation

◆ create()

virtual std::unique_ptr< Sampler > entropic::SamplerFactory::create ( const GenerationParams params)
pure virtual

Build a configured Sampler for one generation.

Ownership transfers to the caller. Implementations must honor the entropic chain ordering / gating contract (see LlamaCppSamplerFactory::create for the canonical production rules — grammar → penalties → temperature → top-k → top-p → min-p → dist).

Parameters
paramsGeneration parameters (sampler knobs + seed).
Returns
Owned Sampler ready for use in the decode loop.
Version
2.3.10

Implemented in entropic::LlamaCppSamplerFactory.


The documentation for this class was generated from the following file: