Skip to main content
RunAnywhere.models is the model catalog and its residency.

The short version

Generation loads what it needs and downloads when options.model names a model that is not on disk:
Reach for the models namespace to control when that cost is paid, show progress, or let a person choose.

What is available

list takes a positional optional filter, so it is list(filter) and not list(filter: filter). Same for unloadAll(category).

Downloading, with progress

download returns a Stream<DownloadEvent>.
With a subscription, so you can cancel:
Cancel it in dispose, and check mounted before every setState that follows an await. Progress carries bytesDone, bytesTotal, fraction, percent, bytesPerSecond, etaSeconds, retryAttempt, currentFileIndex, totalFiles, and overallProgress.

Loading

contextLength costs memory whether you use it or not.

Switching models

On a phone, unload before loading. Or switch per call, without touching residency:

Unloading

Frees memory and leaves the file on disk. Do this in dispose, and on AppLifecycleState change if you hold several models.

What is resident right now

Deleting

Registering your own model

Refreshing the registry

Reconciles the catalog against the bytes actually on disk.

A complete picker

Errors worth handling