{"record":{"id":"6af8f1ae7e4d520d","repo":"mudler/LocalAI","slug":"error-failed-to-init-model-as-vad","errorCode":null,"errorMessage":"error: Failed to init model as VAD\n","messagePattern":"error: Failed to init model as VAD\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/go/whisper/cpp/gowhisper.cpp","lineNumber":103,"sourceCode":"    return 1;\n  }\n\n  return 0;\n}\n\nint load_model_vad(const char *const model_path) {\n  whisper_log_set(ggml_log_cb, nullptr);\n  ggml_backend_load_all();\n\n  struct whisper_vad_context_params vcparams =\n      whisper_vad_default_context_params();\n\n  // XXX: Overridden to false in upstream due to performance?\n  // vcparams.use_gpu = true;\n\n  vctx = whisper_vad_init_from_file_with_params(model_path, vcparams);\n  if (vctx == nullptr) {\n    fprintf(stderr, \"error: Failed to init model as VAD\\n\");\n    return 1;\n  }\n\n  return 0;\n}\n\nint vad(float pcmf32[], size_t pcmf32_len, float **segs_out,\n        size_t *segs_out_len) {\n  if (!whisper_vad_detect_speech(vctx, pcmf32, pcmf32_len)) {\n    fprintf(stderr, \"error: failed to detect speech\\n\");\n    return 1;\n  }\n\n  struct whisper_vad_params params = whisper_vad_default_params();\n  struct whisper_vad_segments *segs =\n      whisper_vad_segments_from_probs(vctx, params);\n  size_t segn = whisper_vad_segments_n_segments(segs);\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/whisper/cpp/gowhisper.cpp#L85-L121","documentation":"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.","triggerScenarios":"Thrown at backend/go/whisper/cpp/gowhisper.cpp:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the model file supports VAD mode.","Check that the model path is correct and the file is not corrupted.","Ensure enough memory is available to initialize the model."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}