{"record":{"id":"df2ec2ef122a8cdf","repo":"Zackriya-Solutions/meetily","slug":"failed-to-load-model-df2ec2","errorCode":null,"errorMessage":"Failed to load model {}: {}","messagePattern":"Failed to load model (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"frontend/src-tauri/src/whisper_engine/whisper_engine.rs","lineNumber":314,"sourceCode":"                };\n\n                log::info!(\n                    \"Whisper acceleration decision: compiled_backend={} runtime_detected_gpu={:?} use_gpu={} flash_attn={} gpu_device={}\",\n                    acceleration.compiled_backend.as_str(),\n                    acceleration.runtime_detected_gpu,\n                    acceleration.use_gpu,\n                    acceleration.flash_attn,\n                    acceleration.gpu_device,\n                );\n\n                // PERFORMANCE: Suppress verbose C library logs during model loading\n                // This hides the excessive Metal/GGML initialization logs in release builds\n                let ctx = {\n                    // let _suppressor = crate::whisper_engine::StderrSuppressor::new();\n\n                    // Load whisper context with hardware-optimized parameters\n                    WhisperContext::new_with_params(&model_info.path.to_string_lossy(), context_param)\n                        .map_err(|e| anyhow!(\"Failed to load model {}: {}\", model_name, e))?\n                    // Suppressor dropped here, stderr restored\n                };\n\n                // Update current context and model\n                *self.current_context.write().await = Some(ctx);\n                *self.current_model.write().await = Some(model_name.to_string());\n\n                // Enhanced acceleration status reporting\n                let acceleration_status = acceleration.status_label();\n\n                log::info!(\"Successfully loaded model: {} with {} (Performance Tier: {:?}, Beam Size: {}, Threads: {:?})\",\n                          model_name, acceleration_status, hardware_profile.performance_tier,\n                          adaptive_config.beam_size, adaptive_config.max_threads);\n                Ok(())\n            },\n            ModelStatus::Missing => {\n                Err(anyhow!(\"Model {} is not downloaded\", model_name))\n            },","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L296-L332","documentation":"WhisperContext::new_with_params (whisper-rs) failed to load the model file with the computed context parameters. The GGML backend rejected the file or could not create a context: the file is corrupt, is not a whisper model, or memory/VRAM allocation for the (optionally GPU) context failed.","triggerScenarios":"load_model on a model whose file is corrupted (truncated download), is a GGUF for a different architecture (an LLM GGUF placed into the whisper models directory), or when GPU context creation fails - Metal/CUDA/Vulkan initialization error or insufficient VRAM.","commonSituations":"Partial downloads passing the filename check but truncated inside; mixing llama.cpp GGUF models into whisper's models folder; outdated GPU drivers or busy VRAM causing context creation failure on first GPU load.","solutions":["Delete and re-download the model via the model manager, then load again","Confirm the file is a whisper-model GGML/GGUF, not an LLM model file that happens to share the extension","If the logs show Metal/CUDA/Vulkan errors, update drivers or select the CPU acceleration path instead","Free GPU/system memory (close other GPU apps, unload the summary LLM) and retry the load"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"use std::io::Read;\nfn looks_like_whisper_model(path: &Path) -> std::io::Result<bool> {\n    let mut f = std::fs::File::open(path)?;\n    let mut magic = [0u8; 4];\n    f.read_exact(&mut magic)?;\n    Ok(&magic == b\"ggml\" || &magic == b\"GGUF\" || &magic == b\"ggjt\" || &magic == b\"ggla\")\n}\n// before load_model:\nif !looks_like_whisper_model(&model_path)? { return Err(anyhow!(\"not a whisper model file\")); }","typeGuard":null,"tryCatchPattern":"match engine.load_model(name).await {\n    Err(e) => {\n        log::error!(\"load failed for {}: {} - keeping previous model loaded\", name, e);\n        // previous current_context/current_model remain intact; offer re-download\n        if e.to_string().contains(\"Failed to load model\") {\n            engine.delete_model(name).await.ok();\n            engine.download_model(name).await?;\n            engine.load_model(name).await?;\n        } else { return Err(e); }\n    }\n    ok => ok,\n}","preventionTips":["Validate the file (magic bytes + non-trivial size) before attempting WhisperContext creation","Keep LLM GGUF files out of the whisper models directory - same container format, different architecture","On GPU paths, check accelerator logs and fall back to CPU context params when creation fails","Unload the previous model before switching to avoid stacking VRAM usage"],"tags":["whisper","model-loading","ggml","gpu","corruption"],"backgroundTag":"model-load-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}