pub enum Quantization {
F32,
F16,
BF16,
INT8,
Q4_0,
Q4_K_S,
Q4_K_M,
Q5_K_S,
Q5_K_M,
Q6_K,
Q8_0,
}Expand description
Quantization level for model weights
Variants§
F32
Full precision (FP32)
F16
Half precision (FP16)
BF16
Brain float 16
INT8
8-bit integer
Q4_0
4-bit (Q4_0 - legacy)
Q4_K_S
4-bit K-quant small
Q4_K_M
4-bit K-quant medium (good balance of size/quality)
Q5_K_S
5-bit K-quant small
Q5_K_M
5-bit K-quant medium
Q6_K
6-bit K-quant
Q8_0
8-bit (Q8_0)
Implementations§
Source§impl Quantization
impl Quantization
Sourcepub fn memory_factor(&self) -> f32
pub fn memory_factor(&self) -> f32
Approximate memory multiplier vs FP16 (lower = smaller)
Sourcepub fn from_filename(s: &str) -> Option<Self>
pub fn from_filename(s: &str) -> Option<Self>
Parse from filename component (e.g., “q4_k_m” -> Q4_K_M)
Trait Implementations§
Source§impl Clone for Quantization
impl Clone for Quantization
Source§fn clone(&self) -> Quantization
fn clone(&self) -> Quantization
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 Quantization
impl Debug for Quantization
Source§impl<'de> Deserialize<'de> for Quantization
impl<'de> Deserialize<'de> for Quantization
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Quantization
impl Display for Quantization
Source§impl Hash for Quantization
impl Hash for Quantization
Source§impl PartialEq for Quantization
impl PartialEq for Quantization
Source§impl Serialize for Quantization
impl Serialize for Quantization
impl Copy for Quantization
impl Eq for Quantization
impl StructuralPartialEq for Quantization
Auto Trait Implementations§
impl Freeze for Quantization
impl RefUnwindSafe for Quantization
impl Send for Quantization
impl Sync for Quantization
impl Unpin for Quantization
impl UnsafeUnpin for Quantization
impl UnwindSafe for Quantization
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.