Skip to main content

fetch_model

Function fetch_model 

Source
pub fn fetch_model(
    spec: &ModelSpec,
    store: &ModelStore,
    broadcaster: &StatusBroadcaster,
) -> Result<PathBuf, FetchError>
Expand description

Resolve a model into its CAS blob path.

If the manifest exists and its referenced blob is on disk, return the blob path immediately (no network, no re-hash by default). Otherwise — if source_url is set — download into the partial area, verify, atomic-rename into place, write the manifest, and return the blob path.

Publishes phase events through broadcaster:

  • CheckingLocal { path } on entry.
  • Download { downloaded, total, source_url } periodically.
  • Verify { path } after download completes.
  • Quarantine { ... } on SHA mismatch.