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

Parakeet engine not initialized

Error message

Parakeet engine not initialized

What it means

get_or_init_parakeet found the process-global PARAKEET_ENGINE static empty — no parakeet engine was ever constructed in this app session — so a parakeet-provider import cannot proceed. Like its whisper twin, this getter only reads the global; it does not initialize despite its name.

Source

Thrown at frontend/src-tauri/src/audio/import.rs:838

            if needs_load {
                info!(
                    "Loading Parakeet model '{}' (current: {:?})",
                    target_model, current_model
                );

                if let Err(e) = e.discover_models().await {
                    warn!("Model discovery error (continuing): {}", e);
                }

                e.load_model(&target_model)
                    .await
                    .map_err(|e| anyhow!("Failed to load model '{}': {}", target_model, e))?;
            }

            Ok(e)
        }
        None => Err(anyhow!("Parakeet engine not initialized")),
    }
}

/// Get the configured model from database
async fn get_configured_model<R: Runtime>(app: &AppHandle<R>, provider_type: &str) -> Result<String> {
    let app_state = app
        .try_state::<AppState>()
        .ok_or_else(|| anyhow!("App state not available"))?;

    let result: Option<(String, String)> = sqlx::query_as(
        "SELECT provider, model FROM transcript_settings WHERE id = '1'",
    )
    .fetch_optional(app_state.db_manager.pool())
    .await
    .map_err(|e| anyhow!("Failed to query config: {}", e))?;

    match result {
        Some((provider, model)) => {

View on GitHub (pinned to 0281737d87)

Solutions

  1. Initialize the parakeet engine (its init/load command or the provider settings flow) before import, or at app start when parakeet is the selected provider
  2. Verify the parakeet feature is compiled into this build (Cargo features / bundled artifacts)
  3. Make the getter lazily construct the engine when None
  4. Fall back to the whisper provider for the import if parakeet is unavailable in this session

Example fix

// before — None is a dead end
match engine {
    Some(e) => Ok(e),
    None => Err(anyhow!("Parakeet engine not initialized")),
}

// after — initialize on miss
let engine = match engine {
    Some(e) => e,
    None => {
        let e = Arc::new(ParakeetEngine::new());
        *PARAKEET_ENGINE.lock().unwrap_or_else(|x| x.into_inner()) = Some(e.clone());
        e
    }
};
Defensive patterns

Strategy: validation

Validate before calling

// ensure the parakeet engine exists before a parakeet import
use crate::parakeet_engine::commands::PARAKEET_ENGINE;
let ready = PARAKEET_ENGINE
    .lock()
    .map(|g| g.is_some())
    .unwrap_or(false);
if !ready { initialize_parakeet_engine(&app).await?; }

Type guard

fn parakeet_engine_ready() -> bool {
    use crate::parakeet_engine::commands::PARAKEET_ENGINE;
    PARAKEET_ENGINE.lock().map(|g| g.is_some()).unwrap_or(false)
}

Try / catch

Unretryable at the call site: catch it, run the parakeet engine initialization, then restart the import — or catch it in the frontend and re-invoke start_import with provider 'whisper' as an immediate fallback.

Prevention

When it happens

Trigger: Import with provider == 'parakeet' and >0 speech segments before any parakeet engine initialization has run; the parakeet feature not compiled into the build; an earlier init attempt failed and left the global unset.

Common situations: User selects the parakeet provider and imports immediately on a fresh start; parakeet support disabled or not bundled in the installed build; tests invoking import without engine setup.

Related errors


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