can1357/oh-my-pi · error · Error

Failed to download speech model (${spec.repo})${detail}

Error message

Failed to download speech model (${spec.repo})${detail}

What it means

downloadSttModel drives the speech worker to download/warm the selected model and resolves only when the worker reports success. If the worker reports result.ok === false, the error is wrapped as 'Failed to download speech model (<repo>)' with either the worker's error text or a generic network hint appended.

Source

Thrown at packages/coding-agent/src/stt/downloader.ts:121

				loaded += file.loaded;
				total += file.total;
			}
			const settled = event.status === "ready" || event.status === "done";
			const percent = total > 0 ? Math.min(100, Math.round((loaded / total) * 100)) : settled ? 100 : 0;
			onProgress?.({
				status: event.status,
				percent,
				loaded,
				total,
				file: event.file,
				repo: spec.repo,
				label: spec.label,
			});
		},
	});
	if (!result.ok) {
		const detail = result.error ? `: ${result.error}` : ". Check your network connection.";
		throw new Error(`Failed to download speech model (${spec.repo})${detail}`);
	}
	if (!(await isSttModelCached(spec.key))) {
		throw new Error(`Speech model download finished without required files (${spec.repo}).`);
	}
}

// ── Public API ─────────────────────────────────────────────────────

export async function ensureSTTDependencies(options?: EnsureOptions): Promise<void> {
	await downloadSttModel(
		resolveSttModelSpec(options?.modelName).key,
		progress => {
			const stage =
				progress.status === "ready" || progress.status === "done"
					? `Speech model ${progress.label} ready`
					: `Downloading speech model ${progress.label}`;
			options?.onProgress?.({ stage, percent: progress.percent });
		},

View on GitHub (pinned to 9690622007)

Solutions

  1. Read the appended detail: a specific error text points at the root cause; the 'Check your network connection' hint means the worker failed without a message (usually connectivity).
  2. Verify connectivity to huggingface.co and retry.
  3. Free disk space / check permissions on the tiny-models cache directory.
  4. Clear the partial model cache directory for that repo and retry.
  5. Run with logging to see the underlying worker error for native-module or device failures.
Defensive patterns

Strategy: try-catch

Validate before calling

import { isSttModelCached } from "./downloader";
if (await isSttModelCached(key)) return; // already present, skip download

Try / catch

try { await downloadSttModel(key, onProgress, { signal }); } catch (err) { log.error("STT model download failed", { key, err }); /* check connectivity/disk before retrying */ }

Prevention

When it happens

Trigger: Any worker-side failure during model download/load: HTTP failures fetching model files, native runtime resolution failure, interrupted downloads, or process crashes — surfaced through sttClient.downloadModel with ok=false.

Common situations: No internet or behind a blocking corporate proxy, Hugging Face outages/rate limits, disk full in the model cache, antivirus removing native modules, or an unsupported platform for the GPU path.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/fa867341fad19274. Report an issue: GitHub.