pub struct SpeculativeType(pub i32);Expand description
A speculative-decoding strategy, as llama.cpp names it.
Values match common_speculative_type. Rather than pin discriminants that
upstream reorders, this keeps the raw value and converts through llama.cpp’s
own name table.
Tuple Fields§
§0: i32Implementations§
Source§impl SpeculativeType
impl SpeculativeType
Sourcepub fn name(self) -> Result<String, RuntimeError>
pub fn name(self) -> Result<String, RuntimeError>
llama.cpp’s name for this type, e.g. "draft-eagle3".
§Errors
Returns RuntimeError::Failed if llama.cpp cannot name it.
Sourcepub fn from_name(name: &str) -> Result<Self, RuntimeError>
pub fn from_name(name: &str) -> Result<Self, RuntimeError>
Parse a name from llama.cpp’s own table.
§Errors
Returns RuntimeError::InvalidArg if the name is not recognised —
upstream reports that with a sentinel value rather than an error, which
the shim translates so an unknown name cannot be stored and silently
select nothing. RuntimeError::Nul for an interior NUL.
Sourcepub fn all_names() -> Result<String, RuntimeError>
pub fn all_names() -> Result<String, RuntimeError>
Every type name llama.cpp recognises, as one string — what its CLI prints in help text.
§Errors
Returns RuntimeError::Failed if llama.cpp throws.
Trait Implementations§
Source§impl Clone for SpeculativeType
impl Clone for SpeculativeType
Source§fn clone(&self) -> SpeculativeType
fn clone(&self) -> SpeculativeType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more