Mintplex-Labs/anything-llm · critical · Error

The native whisper model failed to download from the hugging

Error message

The native whisper model failed to download from the huggingface.co CDN. Your internet connection may be unstable or blocked by Huggingface.co - you will need to download the model manually and place it in the storage/models folder to use local Whisper transcription.

What it means

When @xenova/transformers' pipeline() fails to load the model and the error contains "Could not locate file", LocalWhisper rewrites the message to explain the HuggingFace CDN download failed and that the model must be placed manually under storage/models. This is what users see when the model cannot be fetched.

Source

Thrown at collector/utils/WhisperProviders/localWhisper.js:158

                    data.file
                  } ${~~data?.progress}%`
                );
              },
            }
          : {}),
      });
    } catch (error) {
      let errMsg = error.message;
      if (errMsg.includes("Could not locate file")) {
        errMsg =
          "The native whisper model failed to download from the huggingface.co CDN. Your internet connection may be unstable or blocked by Huggingface.co - you will need to download the model manually and place it in the storage/models folder to use local Whisper transcription.";
      }

      this.#log(
        `Failed to load the native whisper model: ${errMsg}`,
        error.stack
      );
      throw new Error(errMsg);
    }
  }

  async processFile(fullFilePath, filename) {
    try {
      const audioDataPromise = new Promise((resolve) =>
        this.#convertToWavAudioData(fullFilePath).then((audioData) =>
          resolve(audioData)
        )
      );
      const [audioData, transcriber] = await Promise.all([
        audioDataPromise,
        this.client(),
      ]);

      if (!audioData) {
        this.#log(`Failed to parse content from ${filename}.`);
        return {

View on GitHub (pinned to 526360e320)

Solutions

  1. Download the model manually from huggingface.co (e.g. Xenova/whisper-small) and place it under storage/models.
  2. Ensure network access to huggingface.co (proxy/firewall).
  3. Clear the partial cache (storage/models/Xenova/whisper-small) and retry.
  4. Verify STORAGE_DIR points to a writable, persistent location.

Example fix

// before
if (errMsg.includes("Could not locate file")) {
  errMsg = "The native whisper model failed to download...";
}

// after — hint at the exact target path
if (errMsg.includes("Could not locate file")) {
  errMsg = `Model download failed. Place the model under ${this.cacheDir} manually, or check connectivity to huggingface.co.`;
}
Defensive patterns

Strategy: fallback

Validate before calling

const fs = require("fs");
const path = require("path");
function modelCached(cacheDir, model) {
  return fs.existsSync(path.resolve(cacheDir, ...model.split("/")));
}
// if (!modelCached(cacheDir, model)) prompt user / pre-download;

Try / catch

try { await localWhisper.client(); }
catch (e) {
  if (e.message.includes("failed to download")) {
    // fall back to a cloud transcription provider or guide manual download
  }
  throw e;
}

Prevention

When it happens

Trigger: pipeline("automatic-speech-recognition", model, { cache_dir }) throws "Could not locate file ..." — offline/unstable network, huggingface.co blocked, a partial download left an incomplete cache, or a wrong model name (WhisperModelPref).

Common situations: Air-gapped/corporate firewall blocking huggingface.co; flaky connection leaving a partial cache; STORAGE_DIR misconfigured so cache_dir is not writable; wrong WhisperModelPref value.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/5b66ae02b740499a. Report an issue: GitHub.