{"record":{"id":"46cd8ae7b560f877","repo":"Zackriya-Solutions/meetily","slug":"failed-to-load-model","errorCode":null,"errorMessage":"Failed to load model '{}': {}","messagePattern":"Failed to load model '(.+?)': (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/import.rs","lineNumber":787,"sourceCode":"            let current_model = e.get_current_model().await;\n            let needs_load = match &current_model {\n                Some(loaded) => loaded != &target_model,\n                None => true,\n            };\n\n            if needs_load {\n                info!(\n                    \"Loading Whisper model '{}' (current: {:?})\",\n                    target_model, current_model\n                );\n\n                if let Err(e) = e.discover_models().await {\n                    warn!(\"Model discovery error (continuing): {}\", e);\n                }\n\n                e.load_model(&target_model)\n                    .await\n                    .map_err(|e| anyhow!(\"Failed to load model '{}': {}\", target_model, e))?;\n            }\n\n            Ok(e)\n        }\n        None => Err(anyhow!(\"Whisper engine not initialized\")),\n    }\n}\n\n/// Get or initialize the Parakeet engine\nasync fn get_or_init_parakeet<R: Runtime>(\n    app: &AppHandle<R>,\n    requested_model: Option<&str>,\n) -> Result<Arc<ParakeetEngine>> {\n    use crate::parakeet_engine::commands::PARAKEET_ENGINE;\n\n    let engine = {\n        let guard = PARAKEET_ENGINE.lock().unwrap_or_else(|e| e.into_inner());\n        guard.as_ref().cloned()","sourceCodeStart":769,"sourceCodeEnd":805,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/import.rs#L769-L805","documentation":"`WhisperEngine::load_model(target_model)` failed while preparing the engine for import. target_model comes from the import request's model argument or the transcript_settings row. Typical inner causes: the named ggml model file is absent from the models directory (the discover_models warning just above is non-fatal, so discovery problems flow into this error), the file is corrupt/truncated, or the GPU backend (Metal/CUDA/Vulkan per build features) fails to initialize.","triggerScenarios":"Importing with a model name (request arg or settings row) that was never downloaded; the models directory relocated or cleaned; a partially downloaded ggml file; a GPU-feature build on a machine whose GPU runtime is missing.","commonSituations":"User picked 'large-v3' without ever downloading it; app support dir cleaned between sessions; settings restored from another machine without the model files; GPU driver update broke Metal/CUDA init.","solutions":["List the models the app can actually see (model-list command or discover_models result) and confirm target_model is present before reimporting","Download the correct ggml file into the models dir: frontend/models in dev; Application Support/Meetily/models on macOS, %APPDATA%\\Meetily\\models on Windows","Omit the model argument so get_configured_model falls back to the configured/default model, or pick one known to exist","If the inner error mentions Metal/CUDA/Vulkan, retry on a CPU-feature build or fix the GPU runtime"],"exampleFix":"// before — load and hope\ne.load_model(&target_model).await\n    .map_err(|e| anyhow!(\"Failed to load model '{}': {}\", target_model, e))?;\n\n// after — verify availability first (adapt to discover_models' return type)\nif let Ok(models) = e.discover_models().await {\n    if !models.iter().any(|m| m == &target_model) {\n        return Err(anyhow!(\"Model '{}' not found. Available: {:?}\", target_model, models));\n    }\n}\ne.load_model(&target_model).await\n    .map_err(|e| anyhow!(\"Failed to load model '{}': {}\", target_model, e))?;","handlingStrategy":"validation","validationCode":"// verify the ggml file exists before import\nlet models_dir = app_models_dir(); // dev: frontend/models, prod: app-support/Meetily/models\nlet expected = models_dir.join(format!(\"ggml-{}.bin\", target_model));\nif !expected.exists() {\n    return Err(anyhow!(\"Model '{}' not downloaded: {}\", target_model, expected.display()));\n}","typeGuard":null,"tryCatchPattern":"Catch the load error and fall back to a known-present model (or omit the model argument to use the configured default) before giving up — the inner error text distinguishes 'not found' from GPU-init failures, which determines whether a CPU retry helps.","preventionTips":["Check the model list command output before naming a model in an import request","Keep model downloads atomic (temp file + rename) so partial ggml files never look valid","On GPU-feature builds, test a CPU build when load_model reports backend errors"],"tags":["whisper","model-loading","ggml","gpu","rust"],"backgroundTag":"model-load-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}