pub struct GenerateOptions {Show 16 fields
pub max_tokens: usize,
pub temperature: f64,
pub top_p: Option<f64>,
pub top_k: Option<usize>,
pub repeat_penalty: f32,
pub repeat_last_n: usize,
pub batch_size: usize,
pub seed: u64,
pub system_prompt: Option<String>,
pub max_batch_size: usize,
pub batch_window_ms: u64,
pub enable_prefix_cache: bool,
pub cache_memory_mb: usize,
pub cpu_threads: usize,
pub reserve_cores: usize,
pub simd_level: String,
}Expand description
Fields§
§max_tokens: usizeMaximum number of tokens to generate.
Default: 512
temperature: f64Sampling temperature. Higher values produce more diverse output, lower values produce more focused output.
Set to 0.0 for greedy/argmax sampling.
Default: 0.3
top_p: Option<f64>Nucleus sampling (top-p) threshold. Limits sampling to the smallest set of tokens whose cumulative probability exceeds this threshold.
Default: None
top_k: Option<usize>Top-k sampling. Limits sampling to the k most likely tokens.
Default: None
repeat_penalty: f32Penalty applied to repeated tokens. Values > 1.0 reduce repetition.
Default: 1.1
repeat_last_n: usizeNumber of previous tokens to consider for repeat penalty.
Default: 64
batch_size: usizeBatch size for warmup/prefill.
Default: 128
seed: u64Random seed for reproducibility. Same seed + same input = same output.
Default: 299792458
system_prompt: Option<String>System prompt to prepend to the conversation.
Default: None
max_batch_size: usizeMaximum batch size for dynamic batching.
Default: 4
batch_window_ms: u64Time window (in ms) to wait for batching requests.
Default: 1
enable_prefix_cache: boolEnable prefix caching for faster TTFT.
Default: true
cache_memory_mb: usizeMemory budget for prefix cache (in MB).
Default: 512
cpu_threads: usizeNumber of CPU threads (0 = auto-detect, use n-1).
Default: 0 (auto)
reserve_cores: usizeNumber of cores to reserve for OS.
Default: 0
simd_level: StringSIMD level (auto, avx512, avx2, neon, scalar).
Default: auto
Trait Implementations§
Source§impl Clone for GenerateOptions
impl Clone for GenerateOptions
Source§fn clone(&self) -> GenerateOptions
fn clone(&self) -> GenerateOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenerateOptions
impl Debug for GenerateOptions
Auto Trait Implementations§
impl Freeze for GenerateOptions
impl RefUnwindSafe for GenerateOptions
impl Send for GenerateOptions
impl Sync for GenerateOptions
impl Unpin for GenerateOptions
impl UnsafeUnpin for GenerateOptions
impl UnwindSafe for GenerateOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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