LoadOptions class

Placement knobs applied when a model is loaded.

Constructors

LoadOptions({List<BackendPreference> backendPreferences = const <BackendPreference>[], AcceleratorPolicy? accelerator, int? contextLength, int? threads, bool forceReload = false, InferenceFramework? framework, bool? useGpu})
Pin an engine or override runtime sizing for one load.
const

Properties

accelerator AcceleratorPolicy?
Hardware class to run on.
final
backendPreferences List<BackendPreference>
Ranked backend choices; the first entry the platform can honor wins.
final
contextLength int?
Context window in tokens.
final
forceReload bool
Reload even when the model is already resident.
final
framework InferenceFramework?
Deprecated: use backendPreferences. Engine to load with.
final
hashCode int
The hash code for this object.
no setterinherited
resolvedAccelerator AcceleratorPolicy?
accelerator, folding in the deprecated useGpu alias.
no setter
resolvedBackendPreferences List<BackendPreference>
backendPreferences, folding in the deprecated framework alias.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
threads int?
CPU threads the engine may use.
final
useGpu bool?
Deprecated: use accelerator. True forces GPU offload, false forbids it, null lets the engine decide.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited