RunAnywhere.models is the model catalog and its residency. In a browser it matters more than
anywhere else, because the download is the user’s bandwidth and the storage is their disk.
The short version
Generation loads what it needs and downloads whenoptions.model names a model that is not
present:
models namespace when you want to control when that cost is paid, show
progress, or let a person choose.
What is available
list, get, and register are synchronous on Web and async on every other SDK. Code ported
from Swift or React Native will have await in the wrong places.Downloading, with progress
bytesDone, bytesTotal, fraction, percent, bytesPerSecond,
etaSeconds, retryAttempt, currentFileIndex, totalFiles, and overallProgress.
Show the size before you start. A 2GB download over a metered connection is a real cost,
and a browser gives the user no other warning.
Where downloads go
This is the browser-specific part, and it decides whether a returning user re-downloads everything.
Offer a real directory to anyone who will come back:
Loading
Downloading puts the model in storage. Loading puts it in memory.contextLength costs memory whether you use it or not. A tab has less headroom than a phone,
so allocate what your longest conversation actually needs.
CPU or WebGPU
autoRegister picks the right build for the browser, so you normally do not choose. When a
WebGPU model produces garbage, switch that model to its CPU variant rather than disabling
WebGPU globally.
Will it fit
checkCompatibility exists only on Web. Use it before offering a large model.
Switching models
insufficientMemory.
Or switch per call, without touching residency:
Unloading
What is resident right now
Deleting and reclaiming space
storage.refresh() returns the number of entries reconciled. Call it after the user has
deleted files outside the app, or after a storage backend change.
Registering your own model
list and get.
The URL has to be reachable from the page, which means CORS applies. A model host that
does not send permissive headers will fail the fetch, and that failure looks like a network
error rather than a configuration one. This bites more on Web than on any other platform.
Gated repositories
A complete picker
Errors worth handling
Storage errors on Web are about the origin’s quota, which is smaller than the disk and
varies by browser. Offering a real directory through
chooseDirectory() sidesteps it.