Skip to main content
RunAnywhere.models is the model catalog and its residency. Everything about getting a model onto the device and into memory lives here.

The short version

You often do not need this page. Generation loads what it needs and downloads when options.model names a model that is not on disk:
Reach for the models namespace when you want to control when that cost is paid, show download progress, or let a person choose.

What is available

Filter to one modality:
One model by id:

Downloading, with progress

download returns a stream of DownloadEvent. Models are hundreds of megabytes to several gigabytes, so show this rather than a spinner.
DownloadProgress carries bytesDone, bytesTotal, fraction, percent, bytesPerSecond, etaSeconds, retryAttempt, currentFileIndex, totalFiles, and overallProgress. A multi-file model reports both the current file and the overall figure.

Resuming

An interrupted download can often continue rather than starting over:

Loading

Downloading puts the model on disk. Loading puts it in memory.
With options:
contextLength is the one that matters most. A larger window costs memory whether you use it or not, so allocate what your longest conversation actually needs. Pinning a backend:
With required: false the SDK falls back to another backend if that one cannot serve the model. With required: true it fails instead, which is what you want when you are measuring one engine specifically.

Switching models

Load the new one, unload the old one. Doing it in that order keeps a model available throughout, at the cost of holding both briefly. On a phone, reverse it.
You can also switch per call, without touching residency, by naming the model in options:
The SDK loads and unloads as needed. That is simpler, and slower when you alternate.

Unloading

Unloading frees memory and leaves the file on disk, so the next load is fast. This is what you do when a screen goes away, and it is the fix for .insufficientMemory.

What is resident right now

Use it to render a “loaded” badge, or to decide whether a load is needed before a latency-sensitive path.

Deleting

Removes the file from disk. Unloads it first if it is resident.

Registering your own model

Models outside the curated catalog are registered before use. There are three shapes. A single file by URL:
An archive, where you declare the structure inside:
A multi-file model, described by file descriptors:
A vision model with a separate projector, or a speech model with encoder and decoder files, is the multi-file case.

Gated repositories

For a private or gated Hugging Face repo, set the token first:
Keep it in the Keychain, never in source.

Refreshing the registry

Reconciles the catalog against the bytes actually on disk. Worth calling after the app has been offline, or if a user deleted files outside the app.

A complete picker

Errors worth handling

.insufficientMemory on load usually means something else is still resident. Unload first.