Zackriya-Solutions/meetily · error · anyhow::Error

Model {} not found

Error message

Model {} not found

What it means

load_model looked up model_name in the engine's available_models registry (a map keyed by model name) and found no entry. The engine only loads models it has registered; a name that is not a key - typo, wrong casing, or a registry not yet refreshed - fails here before any status check.

Source

Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:380

                            Err(e) => {
                                log::warn!("Failed to remove file {:?}: {}", path, e);
                            }
                        }
                    }
                }

                log::info!("Cleaned {} incomplete files from model directory", removed_count);
                Ok(())
            }
        }
    }

    /// Load a Parakeet model
    pub async fn load_model(&self, model_name: &str) -> Result<()> {
        let models = self.available_models.read().await;
        let model_info = models
            .get(model_name)
            .ok_or_else(|| anyhow!("Model {} not found", model_name))?;

        match model_info.status {
            ModelStatus::Available => {
                // Check if this model is already loaded
                if let Some(current_model) = self.current_model_name.read().await.as_ref() {
                    if current_model == model_name {
                        log::info!("Parakeet model {} is already loaded, skipping reload", model_name);
                        return Ok(());
                    }

                    // Unload current model before loading new one
                    log::info!("Unloading current Parakeet model '{}' before loading '{}'", current_model, model_name);
                    self.unload_model().await;
                }

                log::info!("Loading Parakeet model: {}", model_name);

                // Load model based on quantization type

View on GitHub (pinned to 0281737d87)

Solutions

  1. List registered models first (the listing API over available_models) and pass an exact returned name
  2. If the model was just downloaded, ensure the registry refresh completes before load_model
  3. Verify custom models_dir contents/manifest when using new_with_models_dir
  4. Include the available names in the error message for quick diagnosis

Example fix

// before
let model_info = models
    .get(model_name)
    .ok_or_else(|| anyhow!("Model {} not found", model_name))?;

// after - include the registry contents to make mismatches obvious
let model_info = models
    .get(model_name)
    .ok_or_else(|| anyhow!(
        "Model {} not found. Available: {}",
        model_name,
        models.keys().cloned().collect::<Vec<_>>().join(", ")
   ))?;
Defensive patterns

Strategy: validation

Validate before calling

// Resolve the exact registry key before loading
let names: Vec<String> = engine.list_models().await
    .into_iter().map(|m| m.name).collect();
if !names.contains(&model_name) {
    return Err(anyhow!("Model {model_name} not registered; available: {}", names.join(", ")));
}

Type guard

async fn is_registered_model(engine: &ParakeetEngine, name: &str) -> bool {
    engine.list_models().await.iter().any(|m| m.name == name)
}

Prevention

When it happens

Trigger: Calling load_model with a name that does not exactly match a registry key: a stale or misspelled id, casing differences, or calling right after a download completed but before available_models was repopulated.

Common situations: Frontend hardcodes a model id that drifted from the Rust registry; user pastes a custom model name; a custom models_dir lacking the expected manifest so the registry is empty.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/295c9cd189aecd80. Report an issue: GitHub.