ModelFileManager class abstract

Implementers

Constructors

ModelFileManager.new()

Properties

activeEmbeddingModel ModelSpec?
Gets the currently active embedding model specification
no setter
activeInferenceModel ModelSpec?
Gets the currently active inference 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
clearModelCache() Future<void>
Clears current model cache/state
deleteCurrentModel() Future<void>
Deletes current active model (legacy method without parameters)
deleteLoraWeights() Future<void>
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
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>
Installs model from Flutter assets (debug only)
installModelFromAssetWithProgress(String path, {String? loraPath}) Stream<int>
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>
Sets path to LoRA weights for current model
setModelPath(String path, {String? loraPath}) Future<void>
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