pub struct InferenceOptions {
pub models_dir: Option<PathBuf>,
pub host_budget_mb: u32,
pub backend_budget_mb: u32,
pub process_memory_budget_mb: u32,
pub combined_budget_mb: u32,
pub kv_budget_mb: u32,
pub scratch_budget_mb: u32,
pub call_timeout: Option<Duration>,
}Expand description
Configures Inference::open.
All fields default to automatic: an empty models_dir uses
$ANTFLY_INFERENCE_MODELS_DIR, else ~/.antfly/inference/models; the
*_budget_mb fields default to 0 (automatic/host-detected sizing, the
same knobs as crate::OpenOptions’s embedded-inference budgets); and
call_timeout defaults to None (no per-call deadline).
Fields§
§models_dir: Option<PathBuf>§host_budget_mb: u32§backend_budget_mb: u32§process_memory_budget_mb: u32§combined_budget_mb: u32§kv_budget_mb: u32§scratch_budget_mb: u32§call_timeout: Option<Duration>Implementations§
Source§impl InferenceOptions
impl InferenceOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Starts a builder with all defaults (automatic models directory and resource budgets, no per-call timeout).
pub fn models_dir(self, dir: impl AsRef<Path>) -> Self
pub fn host_budget_mb(self, mb: u32) -> Self
pub fn backend_budget_mb(self, mb: u32) -> Self
pub fn process_memory_budget_mb(self, mb: u32) -> Self
pub fn combined_budget_mb(self, mb: u32) -> Self
pub fn kv_budget_mb(self, mb: u32) -> Self
pub fn scratch_budget_mb(self, mb: u32) -> Self
Sourcepub fn call_timeout(self, timeout: Duration) -> Self
pub fn call_timeout(self, timeout: Duration) -> Self
Deadline applied to each call. None (the default) or
Duration::ZERO means no deadline. Sub-millisecond durations are
rounded up, since the C ABI takes whole milliseconds.
Trait Implementations§
Source§impl Clone for InferenceOptions
impl Clone for InferenceOptions
Source§impl Debug for InferenceOptions
impl Debug for InferenceOptions
Source§impl Default for InferenceOptions
impl Default for InferenceOptions
impl Eq for InferenceOptions
Source§impl PartialEq for InferenceOptions
impl PartialEq for InferenceOptions
impl StructuralPartialEq for InferenceOptions
Auto Trait Implementations§
impl Forget for InferenceOptions
impl Freeze for InferenceOptions
impl Move for InferenceOptions
impl RefUnwindSafe for InferenceOptions
impl Send for InferenceOptions
impl Sync for InferenceOptions
impl Unpin for InferenceOptions
impl UnsafeUnpin for InferenceOptions
impl UnwindSafe for InferenceOptions
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