mudler/LocalAI · error

error: Failed to init model as VAD

Error message

error: Failed to init model as VAD

What it means

Initializing the whisper model in VAD mode failed. Guard: verify the model supports VAD before selecting that mode; fail LoadModel with a clear error otherwise.

Source

Thrown at backend/go/whisper/cpp/gowhisper.cpp:103

    return 1;
  }

  return 0;
}

int load_model_vad(const char *const model_path) {
  whisper_log_set(ggml_log_cb, nullptr);
  ggml_backend_load_all();

  struct whisper_vad_context_params vcparams =
      whisper_vad_default_context_params();

  // XXX: Overridden to false in upstream due to performance?
  // vcparams.use_gpu = true;

  vctx = whisper_vad_init_from_file_with_params(model_path, vcparams);
  if (vctx == nullptr) {
    fprintf(stderr, "error: Failed to init model as VAD\n");
    return 1;
  }

  return 0;
}

int vad(float pcmf32[], size_t pcmf32_len, float **segs_out,
        size_t *segs_out_len) {
  if (!whisper_vad_detect_speech(vctx, pcmf32, pcmf32_len)) {
    fprintf(stderr, "error: failed to detect speech\n");
    return 1;
  }

  struct whisper_vad_params params = whisper_vad_default_params();
  struct whisper_vad_segments *segs =
      whisper_vad_segments_from_probs(vctx, params);
  size_t segn = whisper_vad_segments_n_segments(segs);

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Verify the model file supports VAD mode.
  2. Check that the model path is correct and the file is not corrupted.
  3. Ensure enough memory is available to initialize the model.

When it happens

Trigger: Thrown at backend/go/whisper/cpp/gowhisper.cpp:103 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15). Data as JSON: /api/errors/6af8f1ae7e4d520d. Report an issue: GitHub.