ModelFileManager class abstract

Implementers

Constructors

ModelFileManager()

Properties

activeEmbeddingModel → ModelSpec?
Gets the currently active embedding model specification
no setter
activeInferenceModel → ModelSpec?
Gets the currently active inference model specification
no setter
activeSttModel → ModelSpec?
Gets the currently active STT model specification
no setter
activeTtsModel → ModelSpec?
Gets the currently active TTS model specification.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cleanupStorage() → Future<int>
Explicitly cleanup orphaned files (user must call this - NOT automatic) Returns number of deleted files
clearActiveEmbeddingIdentity() → Future<void>
Clears the active embedding identity (in-memory spec + persisted prefs).
clearActiveInferenceIdentity() → Future<void>
Clears the active inference identity (in-memory spec + persisted prefs).
clearActiveSttIdentity() → Future<void>
Clears the active STT identity (in-memory spec + persisted prefs).
clearActiveTtsIdentity() → Future<void>
Clears the active TTS identity (in-memory spec + persisted prefs).
clearModelCache() → Future<void>
Clears current model cache/state
deleteCurrentModel() → Future<void>
Legacy API: Deletes current active model (legacy method without parameters)
deleteLoraWeights() → Future<void>
Legacy API: Removes LoRA weights from current model
deleteModel(ModelSpec spec) → Future<void>
Deletes a model and all its files
downloadModel(ModelSpec spec, {String? token}) → Future<void>
Downloads a model without progress tracking
downloadModelWithProgress(ModelSpec spec, {String? token}) → Stream<DownloadProgress>
Downloads a model with progress tracking
ensureInitialized() → Future<void>
Ensures the manager is fully initialized — active model/embedder state restored from storage (#227). Idempotent and safe to call concurrently; all callers share a single initialization. Await this before reading activeInferenceModel / activeEmbeddingModel (#314).
ensureModelReady(String filename, String url) → Future<void>
Legacy API: Ensures a model is ready for use, handling all necessary operations
ensureModelReadyFromSpec(ModelSpec spec) → Future<void>
Modern API: Ensures a model spec is ready for use
getInstalledModels(ModelManagementType type) → Future<List<String>>
Gets all installed models for a specific type
getModelFilePaths(ModelSpec spec) → Future<Map<String, String>?>
Gets the file paths for an installed model
getOrphanedFiles() → Future<List<OrphanedFileInfo>>
Gets list of orphaned files (files without active downloads)
getStorageInfo() → Future<StorageStats>
Gets detailed storage information including orphaned files
getStorageStats() → Future<Map<String, int>>
Gets storage statistics (legacy format)
installModelFromAsset(String path, {String? loraPath}) → Future<void>
Legacy API: Installs model from Flutter assets (debug only)
installModelFromAssetWithProgress(String path, {String? loraPath}) → Stream<int>
Legacy API: Installs model from Flutter assets with progress tracking (debug only)
isAnyModelInstalled(ModelManagementType type) → Future<bool>
Checks if ANY model of the given type is installed
isModelInstalled(ModelSpec spec) → Future<bool>
Check if a model is installed and valid
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performCleanup() → Future<void>
Performs cleanup of orphaned files
setActiveModel(ModelSpec spec) → void
Sets the active model for subsequent inference operations
setLoraWeightsPath(String path) → Future<void>
Legacy API: Sets path to LoRA weights for current model
setModelPath(String path, {String? loraPath}) → Future<void>
Legacy API: Sets direct path to existing model files
toString() → String
A string representation of this object.
inherited
validateModel(ModelSpec spec) → Future<bool>
Validates all files for a model specification

Operators

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