Model class

One model can have multiple shards, each shard is a GGUF file.

Constructors

Properties

Methods

Constructors

Properties

files: CacheEntry[]

List of all shards in the cache, sorted by original URL (ascending order)

size: number

Size in bytes (total size of all shards).

A value of -1 means the model is deleted from the cache. You must call ModelManager.downloadModel to re-download the model.

url: string

URL to the GGUF file (in case it contains multiple shards, the URL should point to the first shard)

This URL will be used to identify the model in the cache. There can't be 2 models with the same URL.

Methods

  • Open and get a list of all shards as Blobs

    Returns Promise<Blob[]>

  • Validate the model files.

    If the model is invalid, the model manager will not be able to use it. You must call refresh to re-download the model.

    Cases that model is invalid:

    • The model is deleted from the cache
    • The model files are missing (or the download is interrupted)

    Returns ModelValidationStatus