pub struct LlamaModelParams { /* private fields */ }Expand description
Parameters controlling how a model is loaded.
Starts from llama_model_default_params(); builder methods override the
fields v1 needs. ik’s llama_model_params carries many fork-specific fields
(mla, ncmoe, fit, repack_tensors, per-layer K/V types, …); those keep their
defaults unless exposed here.
Implementations§
Source§impl LlamaModelParams
impl LlamaModelParams
Sourcepub fn with_n_gpu_layers(self, n: u32) -> Self
pub fn with_n_gpu_layers(self, n: u32) -> Self
Number of layers to offload to the GPU (0 = CPU only).
Takes u32 to match llama-cpp-2; clamped into ik’s i32 field.
Sourcepub fn with_use_mmap(self, use_mmap: bool) -> Self
pub fn with_use_mmap(self, use_mmap: bool) -> Self
Whether to memory-map the model file (default true).
Sourcepub fn with_use_mlock(self, use_mlock: bool) -> Self
pub fn with_use_mlock(self, use_mlock: bool) -> Self
Force the model into RAM (mlock).
Sourcepub fn with_vocab_only(self, vocab_only: bool) -> Self
pub fn with_vocab_only(self, vocab_only: bool) -> Self
Load only the vocabulary (no weights).
Sourcepub fn with_mtp(self, mtp: bool) -> Self
pub fn with_mtp(self, mtp: bool) -> Self
Load the MTP / NextN prediction layers if present in the model.
Sourcepub fn as_raw(&self) -> &llama_model_params
pub fn as_raw(&self) -> &llama_model_params
Access the raw params (advanced/escape hatch).
Trait Implementations§
Source§impl Clone for LlamaModelParams
impl Clone for LlamaModelParams
Source§fn clone(&self) -> LlamaModelParams
fn clone(&self) -> LlamaModelParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LlamaModelParams
impl Debug for LlamaModelParams
Auto Trait Implementations§
impl !Send for LlamaModelParams
impl !Sync for LlamaModelParams
impl Freeze for LlamaModelParams
impl RefUnwindSafe for LlamaModelParams
impl Unpin for LlamaModelParams
impl UnsafeUnpin for LlamaModelParams
impl UnwindSafe for LlamaModelParams
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