core/model_management/model_specs library

Model specification value types — dart:io-free, shared across all platforms (mobile, desktop, web).

These types used to be part of flutter_gemma_mobile.dart, which pulled dart:io (and path_provider) into the public import graph and broke dart2wasm compatibility (pub.dev "Platform support" WASM check). They are extracted here as a standalone, platform-neutral library so the public API surface and the platform interface can depend on the specs without dragging in the mobile implementation's dart:io.

Classes

DownloadProgress
Progress information for model downloads
EmbeddingModelFile
Model file for embedding models (.bin files)
EmbeddingModelSpec
Specification for embedding models (model.bin + tokenizer.json)
EmbeddingTokenizerFile
Tokenizer file for embedding models (.json files)
InferenceModelFile
Model file for inference models (.bin, .task files)
InferenceModelSpec
Specification for inference models (main model + optional LoRA)
LoraModelFile
Model file for LoRA weights
ModelFile
Represents a single file that belongs to a model
ModelSpec
Base specification for any model (inference or embedding)
OrphanedFileInfo
Information about a potentially orphaned file
StorageStats
Storage statistics

Enums

ModelManagementType
Base enumeration for different model management types
ModelReplacePolicy
Policy for what happens to a previously-installed model when a new one is set active. Lives with the spec value types (it's a per-spec install policy); re-exported from model_file_manager_interface.dart for backward compat.

Exceptions / Errors

ModelDownloadException
Exception thrown when model download fails
ModelException
Base exception for model management operations
ModelStorageException
Exception thrown when model storage operations fail
ModelValidationException
Exception thrown when model file validation fails