pub struct LoadConfig {
pub gpu_ids: Vec<u32>,
pub gpu_layers: i32,
pub context_size: Option<u32>,
pub keep_alive: bool,
}Expand description
Configuration for loading a model.
Fields§
§gpu_ids: Vec<u32>GPU IDs to use for this model (empty = auto).
gpu_layers: i32Number of layers to offload to GPU (-1 = all, 0 = none).
context_size: Option<u32>Context size (token window).
keep_alive: boolKeep model loaded in memory (prevent unload).
Implementations§
Source§impl LoadConfig
impl LoadConfig
Sourcepub fn with_gpu_layers(self, layers: i32) -> Self
pub fn with_gpu_layers(self, layers: i32) -> Self
Set GPU layers (-1 = all, 0 = CPU only).
Sourcepub fn with_context_size(self, size: u32) -> Self
pub fn with_context_size(self, size: u32) -> Self
Set context size.
Sourcepub fn with_keep_alive(self, keep: bool) -> Self
pub fn with_keep_alive(self, keep: bool) -> Self
Set keep alive.
Sourcepub fn is_cpu_only(&self) -> bool
pub fn is_cpu_only(&self) -> bool
Check if this is a CPU-only configuration.
Sourcepub fn is_full_gpu(&self) -> bool
pub fn is_full_gpu(&self) -> bool
Check if using all GPU layers.
Trait Implementations§
Source§impl Clone for LoadConfig
impl Clone for LoadConfig
Source§fn clone(&self) -> LoadConfig
fn clone(&self) -> LoadConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoadConfig
impl Debug for LoadConfig
Source§impl Default for LoadConfig
impl Default for LoadConfig
Source§impl PartialEq for LoadConfig
impl PartialEq for LoadConfig
impl Eq for LoadConfig
impl StructuralPartialEq for LoadConfig
Auto Trait Implementations§
impl Freeze for LoadConfig
impl RefUnwindSafe for LoadConfig
impl Send for LoadConfig
impl Sync for LoadConfig
impl Unpin for LoadConfig
impl UnsafeUnpin for LoadConfig
impl UnwindSafe for LoadConfig
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