liblloyal 1.0.0
Branched Inference for llama.cpp
Loading...
Searching...
No Matches
lloyal::ModelRegistry Class Reference

#include <lloyal/model_registry.hpp>

Static Public Member Functions

static std::shared_ptr< llama_model > acquire (const std::string &fsPath, const llama_model_params &params)
 Acquire a model from cache, or load from disk on cache miss.
 

Detailed Description

Definition at line 115 of file model_registry.hpp.

Member Function Documentation

◆ acquire()

std::shared_ptr< llama_model > lloyal::ModelRegistry::acquire ( const std::string &  fsPath,
const llama_model_params &  params 
)
inlinestatic

Acquire a model from cache, or load from disk on cache miss.

Thread-safe. On a cache hit, promotes the existing weak_ptr to a shared_ptr (zero-cost). On a cache miss, loads the model from disk while holding the mutex.

Parameters
fsPathFilesystem path to model file (file:// prefix auto-stripped)
paramsModel load parameters (GPU layers, mmap, etc.)
Returns
shared_ptr to model (caller shares ownership), or nullptr on load failure
Examples
/home/runner/work/liblloyal/liblloyal/include/lloyal/model_registry.hpp.

Definition at line 199 of file model_registry.hpp.


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