LoadedModel class

Resident-model ownership handle returned by models.load.

close and models.unload(id) release the same residency; calling either after the other is a no-op.

Constructors

LoadedModel({required String id, required ModelCategory category, BackendPreference? requestedBackend, required InferenceFramework actualBackend, String actualDevice = 'unknown', String? runtimeVersion, String? abiVersion, String? fallbackReason, required Future<void> closeHandler(String id)})
Internal — build through models.load.

Properties

abiVersion String?
Native ABI version, when the backend reports one.
final
actualBackend InferenceFramework
Backend the load actually resolved to.
final
actualDevice String
Where the model actually runs.
final
category ModelCategory
Category this model was loaded under.
final
fallbackReason String?
Set when the requested backend/accelerator could not be honored.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Model id.
final
requestedBackend BackendPreference?
Backend preference that was requested, when one was given.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
runtimeVersion String?
Native runtime version, when the backend reports one.
final

Methods

close() Future<void>
Release this model's residency. Idempotent.
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