pub struct ModelLoader {
pub default_context_size: Option<usize>,
pub default_num_threads: usize,
/* private fields */
}Expand description
A registry that maps model IDs to filesystem specs.
Used by ModelPool::acquire to locate models it has not yet loaded.
Fields§
§default_context_size: Option<usize>Default context size to pass to the engine.
default_num_threads: usizeDefault thread count.
Implementations§
Source§impl ModelLoader
impl ModelLoader
Sourcepub fn register(&mut self, id: impl Into<String>, spec: ModelSpec)
pub fn register(&mut self, id: impl Into<String>, spec: ModelSpec)
Register a model ID → spec mapping so the pool can load it on demand.
Sourcepub fn build_engine_config(&self, id: &str, spec: &ModelSpec) -> EngineConfig
pub fn build_engine_config(&self, id: &str, spec: &ModelSpec) -> EngineConfig
Build an EngineConfig for the given model spec.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelLoader
impl RefUnwindSafe for ModelLoader
impl Send for ModelLoader
impl Sync for ModelLoader
impl Unpin for ModelLoader
impl UnsafeUnpin for ModelLoader
impl UnwindSafe for ModelLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more