Start on live transcription and python sidecar (faster-whisper)

This commit is contained in:
Lucas Winther committed 2026-07-10 09:28:42 +02:00
1 parent 15bf14728a
commit 033ea32968
14 files changed
+1376 -61

No files matched your search

+26
View File
@@ -48,6 +48,14 @@ export interface WhisperModel {
decoderParamsM: number;
/** Per-device dtype defaults (D-004 / D-006). */
defaults: Record<InferenceDevice, DtypeDefault>;
/**
* Model name the server engine passes to faster-whisper (D-013). These are
* faster-whisper's own aliases, which it resolves to the official
* CTranslate2 conversions on the Hub (`Systran/faster-whisper-*`;
* large-v3-turbo → `mobiuslabsgmbh/faster-whisper-large-v3-turbo`), so the
* pinned library version stays the single authority on the exact repo.
*/
fasterWhisperModel: string;
}
// ---------------------------------------------------------------------------
@@ -121,6 +129,7 @@ const WEBGPU_FP16_Q4: DtypeDefault = {
export const MODELS: readonly WhisperModel[] = [
{
id: "onnx-community/whisper-tiny.en",
fasterWhisperModel: "tiny.en",
displayName: "Whisper Tiny (English)",
multilingual: false,
encoderParamsM: 8,
@@ -133,6 +142,7 @@ export const MODELS: readonly WhisperModel[] = [
},
{
id: "onnx-community/whisper-tiny",
fasterWhisperModel: "tiny",
displayName: "Whisper Tiny",
multilingual: true,
encoderParamsM: 8,
@@ -141,6 +151,7 @@ export const MODELS: readonly WhisperModel[] = [
},
{
id: "onnx-community/whisper-base.en",
fasterWhisperModel: "base.en",
displayName: "Whisper Base (English)",
multilingual: false,
encoderParamsM: 20,
@@ -149,6 +160,7 @@ export const MODELS: readonly WhisperModel[] = [
},
{
id: "onnx-community/whisper-base",
fasterWhisperModel: "base",
displayName: "Whisper Base",
multilingual: true,
encoderParamsM: 20,
@@ -157,6 +169,7 @@ export const MODELS: readonly WhisperModel[] = [
},
{
id: "onnx-community/whisper-small.en",
fasterWhisperModel: "small.en",
displayName: "Whisper Small (English)",
multilingual: false,
encoderParamsM: 88,
@@ -165,6 +178,7 @@ export const MODELS: readonly WhisperModel[] = [
},
{
id: "onnx-community/whisper-small",
fasterWhisperModel: "small",
displayName: "Whisper Small",
multilingual: true,
encoderParamsM: 88,
@@ -173,6 +187,7 @@ export const MODELS: readonly WhisperModel[] = [
},
{
id: "onnx-community/whisper-medium.en",
fasterWhisperModel: "medium.en",
displayName: "Whisper Medium (English)",
multilingual: false,
encoderParamsM: 306,
@@ -181,6 +196,7 @@ export const MODELS: readonly WhisperModel[] = [
},
{
id: "onnx-community/whisper-medium",
fasterWhisperModel: "medium",
displayName: "Whisper Medium",
multilingual: true,
encoderParamsM: 306,
@@ -189,6 +205,7 @@ export const MODELS: readonly WhisperModel[] = [
},
{
id: "onnx-community/whisper-large-v3-turbo",
fasterWhisperModel: "large-v3-turbo",
displayName: "Whisper Large v3 Turbo",
multilingual: true,
encoderParamsM: 635,
@@ -201,6 +218,15 @@ export function getModel(id: string): WhisperModel | undefined {
return MODELS.find((model) => model.id === id);
}
/**
* faster-whisper model name for a catalog id (server engine, D-013), or
* undefined for ids outside the catalog — the transcribe endpoint answers 400
* rather than forwarding arbitrary strings to the sidecar.
*/
export function getFasterWhisperModel(id: string): string | undefined {
return getModel(id)?.fasterWhisperModel;
}
/** Default dtype for a model on a given device. Unknown ids fall back to q8. */
export function resolveDefaultDtype(
modelId: string,