pub struct EngineOptions { /* private fields */ }Expand description
Configuration for Engine::load.
Implementations§
Source§impl EngineOptions
impl EngineOptions
Sourcepub fn new(model_path: impl Into<PathBuf>) -> Self
pub fn new(model_path: impl Into<PathBuf>) -> Self
Construct with the given model path, default quantization
(IsqType::Q4K), default max_tokens (1024), and an
indexing-safe default sampler profile
(RequestOptions::deterministic).
The default request is deterministic because this crate’s primary
use case is producing structured output that gets persisted to a
search index (see crate::image_analysis::ImageAnalysisTask).
Stochastic sampling means the same keyframes reprocessed after
a timeout, retry, or backfill can produce different
ImageAnalysis values,
silently drifting the index. Greedy decoding closes that hole at
the cost of diverging from the Qwen3-VL Instruct model card’s
recommended sampler — see RequestOptions::deterministic for
the full trade-off.
For one-shot, quality-prioritised use where reproducibility
doesn’t matter, swap the engine default for the model-card
stochastic profile via
EngineOptions::new(path).with_request(RequestOptions::new()),
or override per-call via Engine::run_with.
Sourcepub fn model_path(&self) -> &Path
pub fn model_path(&self) -> &Path
Returns the configured model path.
Sourcepub fn with_model_path(self, val: impl Into<PathBuf>) -> Self
pub fn with_model_path(self, val: impl Into<PathBuf>) -> Self
Builder-style setter for model_path.
Sourcepub fn set_model_path(&mut self, val: impl Into<PathBuf>) -> &mut Self
pub fn set_model_path(&mut self, val: impl Into<PathBuf>) -> &mut Self
In-place setter for model_path.
Sourcepub const fn quantization(&self) -> IsqType
pub const fn quantization(&self) -> IsqType
Returns the configured quantization (default IsqType::Q4K).
Sourcepub const fn with_quantization(self, val: IsqType) -> Self
pub const fn with_quantization(self, val: IsqType) -> Self
Builder-style setter for quantization.
Sourcepub const fn set_quantization(&mut self, val: IsqType) -> &mut Self
pub const fn set_quantization(&mut self, val: IsqType) -> &mut Self
In-place setter for quantization.
Sourcepub const fn max_tokens(&self) -> usize
pub const fn max_tokens(&self) -> usize
Returns the configured max_tokens ceiling (default 1024).
Sourcepub const fn with_max_tokens(self, val: usize) -> Self
pub const fn with_max_tokens(self, val: usize) -> Self
Builder-style setter for max_tokens. Any value is accepted at
the type level (no setter-side validation); a value of 0 is
clamped up to 1 at request time inside Engine::run_with
before being passed to mistralrs’s set_sampler_max_len, so a
zero here means “let the model emit at least one token”, not
“skip generation entirely”.
Sourcepub const fn set_max_tokens(&mut self, val: usize) -> &mut Self
pub const fn set_max_tokens(&mut self, val: usize) -> &mut Self
In-place setter for max_tokens. See Self::with_max_tokens
for the runtime 0 → 1 clamp note.
Sourcepub const fn request(&self) -> &RequestOptions
pub const fn request(&self) -> &RequestOptions
Returns the engine-level default RequestOptions. This is the
sampler profile used by Engine::run; per-call overrides go
through Engine::run_with.
Default (EngineOptions::new): RequestOptions::deterministic
— see that constructor for the indexing-vs-quality trade-off.
Sourcepub fn with_request(self, val: RequestOptions) -> Self
pub fn with_request(self, val: RequestOptions) -> Self
Builder-style setter for request. Replaces the engine-level
default sampler profile wholesale.
Sourcepub fn set_request(&mut self, val: RequestOptions) -> &mut Self
pub fn set_request(&mut self, val: RequestOptions) -> &mut Self
In-place setter for request. Replaces the engine-level default
sampler profile wholesale.
Sourcepub const fn inference_timeout(&self) -> Duration
pub const fn inference_timeout(&self) -> Duration
Returns the per-call inference timeout (default
DEFAULT_INFERENCE_TIMEOUT = 5 min). Issue #1 H-001.
Sourcepub const fn with_inference_timeout(self, val: Duration) -> Self
pub const fn with_inference_timeout(self, val: Duration) -> Self
Builder-style setter for inference_timeout.
Sourcepub const fn set_inference_timeout(&mut self, val: Duration) -> &mut Self
pub const fn set_inference_timeout(&mut self, val: Duration) -> &mut Self
In-place setter for inference_timeout.
Trait Implementations§
Source§impl Clone for EngineOptions
impl Clone for EngineOptions
Source§fn clone(&self) -> EngineOptions
fn clone(&self) -> EngineOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EngineOptions
impl RefUnwindSafe for EngineOptions
impl Send for EngineOptions
impl Sync for EngineOptions
impl Unpin for EngineOptions
impl UnsafeUnpin for EngineOptions
impl UnwindSafe for EngineOptions
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> Downcast for T
impl<T> Downcast for T
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.