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

+16
View File
@@ -6,6 +6,7 @@ import {
estimateDefaultDownloadBytes,
estimateDownloadBytes,
formatModelSize,
getFasterWhisperModel,
getModel,
resolveDefaultDtype,
} from "../src/lib/models";
@@ -59,6 +60,21 @@ describe("MODELS catalog", () => {
expect(getModel(DEFAULT_MODEL_ID)).toBeDefined();
expect(getModel("onnx-community/whisper-nonexistent")).toBeUndefined();
});
test("every model maps to a faster-whisper name for the server engine (D-013)", () => {
for (const model of MODELS) {
// The onnx-community ids and faster-whisper's aliases share the same
// size suffix ("tiny.en", …, "large-v3-turbo"); keeping them aligned is
// what lets one catalog drive both engines.
expect(model.fasterWhisperModel).toBe(
model.id.replace("onnx-community/whisper-", ""),
);
}
expect(getFasterWhisperModel(DEFAULT_MODEL_ID)).toBe("tiny.en");
// Unknown ids stay undefined so /api/transcribe can answer 400 instead of
// forwarding arbitrary strings to the sidecar.
expect(getFasterWhisperModel("someone/some-model")).toBeUndefined();
});
});
describe("resolveDefaultDtype", () => {