can1357/oh-my-pi · error · Error

Unknown stt model: ${modelKey}

Error message

Unknown stt model: ${modelKey}

What it means

loadModel looks up the STT model spec by key via getSttModelSpec; only keys present in the STT model registry can be loaded. An unrecognized key throws this error before any download or pipeline creation is attempted.

Source

Thrown at packages/coding-agent/src/stt/asr-worker.ts:374

			provider: "cpu",
			debug: 0,
		},
		decodingMethod: "greedy_search",
	});
	sendLog(transport, "debug", "stt: local model loaded", {
		modelKey,
		repo: spec.repo,
		engine: "sherpa",
		provider: "cpu",
		numThreads,
		elapsedMs: Math.round(performance.now() - startedAt),
	});
	return { engine: "sherpa", recognizer };
}

async function loadModel(modelKey: SttModelKey, transport: SttTransport, requestId: string): Promise<LoadedModel> {
	const spec = getSttModelSpec(modelKey);
	if (!spec) throw new Error(`Unknown stt model: ${modelKey}`);
	const cached = replayCachedReady(models, modelKey, transport, requestId, ASR_TASK, spec.repo);
	if (cached) return cached;

	const loading =
		spec.engine === "sherpa"
			? loadSherpaModel(spec, modelKey, transport, requestId)
			: loadTransformersModel(spec, modelKey, transport, requestId);
	const loaded = loading.then(
		model => {
			transport.send({
				type: "progress",
				id: requestId,
				event: { modelKey, status: "ready", task: ASR_TASK, model: spec.repo },
			});
			return model;
		},
		error => {
			models.delete(modelKey);

View on GitHub (pinned to 9690622007)

Solutions

  1. Use one of the registry-defined SttModelKey values (see packages/coding-agent/src/stt/models.ts).
  2. Update the client/CLI so its model keys match the current registry.
  3. Fix the model name in your configuration.

Example fix

// before
loadModel("whisper-large-v3-turbo-q8", transport, requestId) // not a registered key
// after
loadModel("whisper-tiny-en", transport, requestId) // a registered key
Defensive patterns

Strategy: validation

Validate before calling

import { getSttModelSpec } from "./models";
if (!getSttModelSpec(modelKey)) throw new Error(`invalid stt model key: ${modelKey}`);

Type guard

function isKnownSttModel(key: string): key is SttModelKey { return getSttModelSpec(key as SttModelKey) !== undefined; }

Try / catch

try { const model = await loadModel(modelKey, transport, requestId); } catch (err) { if (String(err).startsWith("Unknown stt model")) { /* fall back to default model key */ } else throw err; }

Prevention

When it happens

Trigger: Requesting a model (batch transcribe or streaming session) with a modelKey that is not in the models registry — e.g. a renamed tier, a typo, or a stale client sending an old key.

Common situations: Version skew where an older CLI/client sends model keys removed in a newer registry, configuration pointing at a nonexistent model name, or typos in the model identifier.

Related errors


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