{"record":{"id":"30b37236b07b4088","repo":"Zackriya-Solutions/meetily","slug":"model-not-found-30b372","errorCode":null,"errorMessage":"Model {} not found","messagePattern":"Model (.+?) not found","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/whisper_engine/whisper_engine.rs","lineNumber":264,"sourceCode":"            };\n            \n            models.push(model_info);\n        }\n        \n        // Update internal cache\n        let mut available_models = self.available_models.write().await;\n        available_models.clear();\n        for model in &models {\n            available_models.insert(model.name.clone(), model.clone());\n        }\n        \n        Ok(models)\n    }\n    \n    pub async fn load_model(&self, model_name: &str) -> Result<()> {\n        let models = self.available_models.read().await;\n        let model_info = models.get(model_name)\n            .ok_or_else(|| anyhow!(\"Model {} not found\", model_name))?;\n\n        match model_info.status {\n            ModelStatus::Available => {\n                // FIX 5: Check if this model is already loaded\n                if let Some(current_model) = self.current_model.read().await.as_ref() {\n                    if current_model == model_name {\n                        log::info!(\"Model {} is already loaded, skipping reload\", model_name);\n                        return Ok(());\n                    }\n\n                    // FIX 5: Unload current model before loading new one\n                    log::info!(\"Unloading current model '{}' before loading '{}'\", current_model, model_name);\n                    self.unload_model().await;\n                }\n\n                log::info!(\"Loading model: {}\", model_name);\n\n                // PERFORMANCE OPTIMIZATION: Use comprehensive hardware profile for optimal GPU configuration","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L246-L282","documentation":"load_model looks the name up in the in-memory available_models map, which is populated by scanning the models directory (list_models). An unknown name - never scanned, misspelled, or not a whisper model in that directory - fails immediately with this error.","triggerScenarios":"Calling load_model('base.en') when the map only contains 'base'; calling load_model before list_models populated available_models; UI state referencing a model that is no longer present after the models directory changed.","commonSituations":"Frontend model list out of sync with the scanned disk state; a captured model name from before the models dir was changed/cleaned; case-sensitive mismatch between the stored setting and the scanned name.","solutions":["Call list_models()/refresh first, then pass an exact name it returned","Verify spelling and case ('base' vs 'base.en' are different models)","If the UI shows a model that load_model rejects, refresh the model list to resynchronize state with disk"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let models = engine.list_models().await?; // populates available_models\nlet valid: Vec<&str> = models.iter().map(|m| m.name.as_str()).collect();\nif !valid.contains(&model_name) {\n    return Err(anyhow!(\"unknown model {:?}; scanned: {:?}\", model_name, valid));\n}","typeGuard":"async fn model_exists(engine: &WhisperEngine, name: &str) -> bool {\n    engine.available_models.read().await.contains_key(name)\n}","tryCatchPattern":"try { engine.load_model(name).await? }\ncatch (e) if e.to_string().contains(\"not found\") {\n    let models = engine.list_models().await?; // rescan disk\n    engine.load_model(models.first().unwrap().name.as_str()).await? // or resync UI\n}","preventionTips":["Call list_models()/refresh after any change to the models directory and before load_model","Sync the frontend model picker from list_models output, never from stale persisted state","Treat names as case-sensitive verbatim identifiers"],"tags":["whisper","model-loading","validation","api-misuse"],"backgroundTag":"unknown-model-name","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}