SyniInstaller class
Downloads + verifies a model (GGUF + its tokenizer.json sibling). Emits
progress via the supplied callback. Returns the final on-disk model path.
Downloads are resumable. Bytes land in <file>.part, and only a complete
file is renamed into place, so a partial download never looks installed.
When the connection drops (the screen turns off and the OS suspends the
app, the network changes, the app is killed), the next attempt asks the
server for the rest with an HTTP Range request instead of starting over.
Only a file that fails SHA-256 verification is thrown away.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- idleTimeout → Duration
-
How long the stream may go without data before the attempt is treated
as interrupted (a suspended app's socket can stall rather than close).
final
- maxAttempts → int
-
Attempts per file before an interrupted download is reported as failed.
Each attempt resumes from the bytes already on disk.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
deleteModel(
SyniModelSpec spec) → Future< int> -
Permanently deletes
spec's model files from disk — the GGUF and its siblingtokenizer.json— reclaiming the ~1.1 GB the install occupies. -
ensureModel(
SyniModelSpec spec, {required void onProgress(SyniInstallStage, double)}) → Future< String> -
Returns the path to the model file. Downloads the GGUF and its sibling
tokenizer.jsonif not already on disk. CallsonProgresswith the bytes-downloaded fraction. -
installedBytes(
SyniModelSpec spec) → Future< int> -
Total on-disk bytes occupied by
spec's model files (the GGUF plus its siblingtokenizer.json). Returns 0 when nothing is installed. Useful for telling the user how much storage a delete will reclaim. -
isModelOnDisk(
SyniModelSpec spec) → Future< bool> -
Whether the GGUF model + its sibling
tokenizer.jsonare already on disk for the given spec. Used by the cold-start restore path so the screen can skip the download UX when nothing actually needs downloading. -
modelPathFor(
SyniModelSpec spec) → Future< String> - Returns the on-disk path the GGUF would live at — does NOT touch the filesystem. Pair with isModelOnDisk to drive a "load only, skip download" flow.
-
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