MCPcopy Create free account
hub / github.com/MistApproach/callm / LoaderImpl

Interface LoaderImpl

src/loaders.rs:16–28  ·  view source on GitHub ↗

A trait for defining the interface of model loaders.

Source from the content-addressed store, hash-verified

14
15/// A trait for defining the interface of model loaders.
16pub trait LoaderImpl: Send {
17 /// Sets the device configuration for the loader.
18 fn set_device(&mut self, device: Arc<DeviceConfig>);
19
20 /// Loads the model and returns it wrapped in an `Arc<Mutex<dyn ModelImpl>>`.
21 fn load(&mut self) -> Result<Arc<Mutex<dyn ModelImpl>>, CallmError>;
22
23 /// Returns the tokenizer associated with the model.
24 fn tokenizer(&mut self) -> Result<Tokenizer, CallmError>;
25
26 /// Returns the template associated with the model.
27 fn template(&mut self) -> Result<Box<dyn TemplateImpl>, CallmError>;
28}
29

Callers

nothing calls this directly

Implementers 2

safetensors.rssrc/loaders/safetensors.rs
gguf.rssrc/loaders/gguf.rs

Calls

no outgoing calls

Tested by

no test coverage detected