Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

refactor(captions): drop the model upgrade, keeping the GPU recovery

EtienneLescot25834b0122ea
diff --git a/electron/native/whisper-stt/src/main.cpp b/electron/native/whisper-stt/src/main.cpp
index 9f6abab6e..5762de8fa 100644
--- a/electron/native/whisper-stt/src/main.cpp
+++ b/electron/native/whisper-stt/src/main.cpp
@@ -276,7 +276,7 @@ int main(int argc, char** argv) {
// /inference handler still runs, but skipping
// the request is wasted work.
cparams.dtw_token_timestamps = true;
- cparams.dtw_aheads_preset = WHISPER_AHEADS_LARGE_V3_TURBO;
+ cparams.dtw_aheads_preset = WHISPER_AHEADS_SMALL;
whisper_context* ctx = whisper_init_from_file_with_params(model_path.c_str(), cparams);
if (!ctx && cparams.use_gpu) {
// Metal/Vulkan allocation can fail transiently when the editor or another
diff --git a/electron/stt/index.test.ts b/electron/stt/index.test.ts
index f06da2cd8..a6829aaa3 100644
--- a/electron/stt/index.test.ts
+++ b/electron/stt/index.test.ts
@@ -269,7 +269,7 @@ describe("SttManager", () => {
});
it("retries setup after a failed one instead of caching the rejection", async () => {
- // First run downloads a 253 MB model. Caching a rejected `prepare()` meant
+ // First run downloads a 264 MB model. Caching a rejected `prepare()` meant
// one dropped connection failed every later transcription in the session —
// including the retry the editor offers — until the app was restarted.
const { ensureModels } = await import("./modelManager");
diff --git a/electron/stt/index.ts b/electron/stt/index.ts
index a1ed3cb67..066186a40 100644
--- a/electron/stt/index.ts
+++ b/electron/stt/index.ts
@@ -20,7 +20,7 @@ import { WhisperServerManager } from "./whisperServer";
* (`chunking.ts`) and runs each through whisper-stt-server's HTTP
* `/inference`, which returns both phrase- and word-level segments in one
* pass (see whisperServer.ts). Word timestamps come from whisper.cpp's
- * native DTW token timestamps (`t_dtw`, LARGE_V3_TURBO aheads preset,
+ * native DTW token timestamps (`t_dtw`, SMALL aheads preset,
* `flash_attn = false`), see
* technical-documentation/architecture/transcription-and-captions.md § Decision rationale.
* 3. `shutdown()` tears down on app quit.
@@ -124,7 +124,7 @@ export class SttManager {
if (options.statusSink) this.addStatusSink(options.statusSink);
if (options.modelsBaseDir) this.modelsBaseDir = options.modelsBaseDir;
if (!this.initPromise) {
- // A REJECTED init must not be cached. `prepare()` downloads a large
+ // A REJECTED init must not be cached. `prepare()` downloads a 264 MB
// model on first run, and caching its rejection meant one dropped
// connection poisoned the whole app session: every later transcription
// — including the retry the UI offers, and every remaining asset in the
diff --git a/electron/stt/modelManager.test.ts b/electron/stt/modelManager.test.ts
index e3f90ebf5..e5f186fbd 100644
--- a/electron/stt/modelManager.test.ts
+++ b/electron/stt/modelManager.test.ts
@@ -19,7 +19,7 @@ describe("modelManager", () => {
expect(STT_MODELS.whisper.cacheDir).toBe("whisper-ggml");
expect(STT_MODELS.whisper.repoId).toBe("ggerganov/whisper.cpp");
expect(STT_MODELS.whisper.files.length).toBe(1);
- expect(STT_MODELS.whisper.files[0].name).toBe("ggml-large-v3-turbo-q5_0.bin");
+ expect(STT_MODELS.whisper.files[0].name).toBe("ggml-small-q8_0.bin");
expect(STT_MODELS.whisper.files[0].expectedSha256).not.toBeNull();
for (const f of STT_MODELS.whisper.files) {
expect(f.approximateBytes).toBeGreaterThan(0);
@@ -32,7 +32,7 @@ describe("modelManager", () => {
it("modelPaths places the GGML file under the cache directory", () => {
const paths = modelPaths(dir);
- expect(paths.whisper).toBe(path.join(dir, "whisper-ggml", "ggml-large-v3-turbo-q5_0.bin"));
+ expect(paths.whisper).toBe(path.join(dir, "whisper-ggml", "ggml-small-q8_0.bin"));
});
it("areModelsPresent returns false when the model file is missing", async () => {
@@ -92,7 +92,7 @@ describe("modelManager", () => {
expect(fetches).toBe(1);
expect(await readFile(paths.whisper)).toEqual(replacement);
// The stale copy is displaced by the atomic rename, not quarantined
- // beside it: a `.bad` sibling would strand hundreds of MB nothing ever reaps.
+ // beside it: a `.bad` sibling would strand 264 MB nothing ever reaps.
expect(existsSync(`${paths.whisper}.bad`)).toBe(false);
expect(existsSync(`${paths.whisper}.partial`)).toBe(false);
} finally {
@@ -180,7 +180,7 @@ describe("modelManager", () => {
const s = await stat(paths.whisper);
expect(s.size).toBeGreaterThan(0);
expect(progressCalls.length).toBeGreaterThanOrEqual(1);
- expect(progressCalls[0].file).toBe("ggml-large-v3-turbo-q5_0.bin");
+ expect(progressCalls[0].file).toBe("ggml-small-q8_0.bin");
} finally {
STT_MODELS.whisper.files[0].expectedSha256 = originalSha;
}
diff --git a/electron/stt/modelManager.ts b/electron/stt/modelManager.ts
index 8a2d9e4c8..cb13fd31f 100644
--- a/electron/stt/modelManager.ts
+++ b/electron/stt/modelManager.ts
@@ -13,10 +13,9 @@ import { pipeline } from "node:stream/promises";
* from the `ggml-org` GitHub org the engine itself now lives under;
* `ggml-org/whisper.cpp` on HuggingFace is a different, access-gated repo
* and returns 401 on every file including README.md — confirmed by curl).
- * whisper.cpp bakes precision into the file, so there is no runtime `--int8`
- * flag. OpenScreen uses the q5_0 quantized large-v3-turbo multilingual model:
- * substantially stronger recognition than `small`, while the turbo decoder
- * remains practical for interactive captions on Apple Silicon.
+ * whisper.cpp bakes precision into the file, so
+ * there is no runtime `--int8` flag; OpenScreen ships the q8_0 quantized
+ * `small` multilingual model by default.
*
* The file is verified by SHA-256 and written atomically (via .partial rename)
* to prevent partial downloads from being treated as complete.
@@ -28,7 +27,7 @@ import { pipeline } from "node:stream/promises";
export type SttModelId = "whisper";
export interface SttModelFile {
- /** Relative path within the model directory (e.g. "ggml-large-v3-turbo-q5_0.bin"). */
+ /** Relative path within the model directory (e.g. "ggml-small-q8_0.bin"). */
name: string;
/** HuggingFace resolve URL for this file. */
url: string;
@@ -55,13 +54,13 @@ const MODEL_BASE = "https://huggingface.co";
// long-standing public model-file repo that never moved when the engine's
// GitHub org was renamed.
const MODEL_REPO = "ggerganov/whisper.cpp";
-const MODEL_FILE = "ggml-large-v3-turbo-q5_0.bin";
+const MODEL_FILE = "ggml-small-q8_0.bin";
// Pinned to a commit rather than `main` so `expectedSha256` is an invariant and
// not a bet: `main` is a mutable branch pointer, and a re-upload under it would
// now invalidate every cache in the field at once instead of merely breaking new
// installs. This revision was checked against HuggingFace's paths-info API — its
// LFS oid for MODEL_FILE is exactly the digest below.
-const MODEL_REVISION = "98aa99a0a9db05ae2342309f5096248665f7cba3";
+const MODEL_REVISION = "5359861c739e955e79d9a303bcbc70fb988958b1";
export const STT_MODELS: Record<SttModelId, SttModelDescriptor> = {
whisper: {
@@ -71,8 +70,8 @@ export const STT_MODELS: Record<SttModelId, SttModelDescriptor> = {
{
name: MODEL_FILE,
url: `${MODEL_BASE}/${MODEL_REPO}/resolve/${MODEL_REVISION}/${MODEL_FILE}`,
- expectedSha256: "394221709CD5AD1F40C46E6031CA61BCE88931E6E088C188294C6D5A55FFA7E2",
- approximateBytes: 574_041_195,
+ expectedSha256: "49C8FB02B65E6049D5FA6C04F81F53B867B5EC9540406812C643F177317F779F",
+ approximateBytes: 264_000_000,
},
],
},
@@ -180,7 +179,7 @@ async function ensureFile(
// would buy nothing — the rename at the end of this function is already
// atomic, so there is no window to close — while costing the user their
// only model if the replacement never lands (offline, HF 5xx, ENOSPC)
- // and stranding hundreds of MB that nothing ever cleans up.
+ // and stranding 264 MB that nothing ever cleans up.
}
}
diff --git a/electron/stt/whisperServer.test.ts b/electron/stt/whisperServer.test.ts
index 83fb55e77..80e861636 100644
--- a/electron/stt/whisperServer.test.ts
+++ b/electron/stt/whisperServer.test.ts
@@ -319,7 +319,7 @@ describe("WhisperServerManager", () => {
const originalPlatform = Object.getOwnPropertyDescriptor(process, "platform");
try {
Object.defineProperty(process, "platform", { value: "linux", configurable: true });
- const modelPath = path.join(dir, "ggml-large-v3-turbo-q5_0.bin");
+ const modelPath = path.join(dir, "ggml-small-q8_0.bin");
const fakeBinaryPath = path.join(dir, "whisper-stt-server");
await fs.writeFile(modelPath, "dummy-ggml");
await fs.writeFile(fakeBinaryPath, "x", { mode: 0o755 });
@@ -379,7 +379,7 @@ describe("WhisperServerManager", () => {
const originalPlatform = Object.getOwnPropertyDescriptor(process, "platform");
try {
Object.defineProperty(process, "platform", { value: "linux", configurable: true });
- const modelPath = path.join(dir, "ggml-large-v3-turbo-q5_0.bin");
+ const modelPath = path.join(dir, "ggml-small-q8_0.bin");
const fakeBinaryPath = path.join(dir, "whisper-stt-server");
await fs.writeFile(modelPath, "dummy-ggml");
await fs.writeFile(fakeBinaryPath, "x", { mode: 0o755 });
diff --git a/electron/stt/whisperServer.ts b/electron/stt/whisperServer.ts
index 4635134ed..1d8d667aa 100644
--- a/electron/stt/whisperServer.ts
+++ b/electron/stt/whisperServer.ts
@@ -42,7 +42,7 @@ const REQUEST_TIMEOUT_MS = 280_000;
* and the renderer doesn't move.
*
* Word timestamps come from whisper.cpp's native DTW token timestamps
- * (`t_dtw`, LARGE_V3_TURBO aheads preset, `flash_attn = false` so DTW is actually
+ * (`t_dtw`, SMALL aheads preset, `flash_attn = false` so DTW is actually
* computed). The helper returns them already absolute, so no segment-offset
* arithmetic is required.
*
@@ -52,7 +52,7 @@ const REQUEST_TIMEOUT_MS = 280_000;
*/
export interface WhisperServerStartOptions {
- /** Absolute path to the GGML model file (e.g. ggml-large-v3-turbo-q5_0.bin). */
+ /** Absolute path to the GGML model file (e.g. ggml-small-q8_0.bin). */
modelPath: string;
/** Externally-resolved binary path (skips gpuDetector on startup); null = auto. */
binaryPath?: string | null;
@@ -131,7 +131,7 @@ export class WhisperServerManager {
/** Check the server's HTTP root for a 200; resolves once responsive. */
private static async pollUntilReady(
baseUrl: string,
- timeoutMs = 60_000,
+ timeoutMs = 30_000,
shouldContinue: () => boolean = () => true,
): Promise<void> {
const deadline = Date.now() + timeoutMs;
@@ -286,7 +286,7 @@ export class WhisperServerManager {
await Promise.race([
WhisperServerManager.pollUntilReady(
`http://127.0.0.1:${port}`,
- 60_000,
+ 30_000,
() => this.process === child,
),
exitedBeforeReady,
diff --git a/technical-documentation/architecture/transcription-and-captions.md b/technical-documentation/architecture/transcription-and-captions.md
index f41ff622c..e95147ee4 100644
--- a/technical-documentation/architecture/transcription-and-captions.md
+++ b/technical-documentation/architecture/transcription-and-captions.md
@@ -98,7 +98,7 @@ subtitle is the reason rather than "With AI".
### One phase, including the first-run model download
-On a fresh install the GGML model (~574 MB) is not on disk. It is fetched by
+On a fresh install the GGML model (~264 MB) is not on disk. It is fetched by
`SttManager.prepare()` **inside** the `stt:transcribe` IPC call — i.e. inside a
run this store has already marked `running` — so the user sees one single busy
phase that simply takes longer the first time. That is deliberate: no separate
@@ -107,7 +107,7 @@ clickable in the meantime (`phase: "model"` is emitted by the main process but
deliberately not forwarded to the renderer by `transcribeAsset`). Nothing in the
renderer imposes a timeout that a slow download could trip: the preload does a
bare `ipcRenderer.invoke`, `fetchWithRetry` has no per-request deadline, and
-whisper-server's 60 s readiness budget only starts once the download resolved.
+whisper-server's 30 s readiness budget only starts once the download resolved.
Three edges make that promise hold, and each is load-bearing:
@@ -146,10 +146,11 @@ helper's `/inference` JSON.
Why whisper.cpp, in one paragraph: a single C++ dependency with native DTW
token timestamps for word-level timing and portable runtime device selection
-that covers Metal, Vulkan and CPU in one binary. OpenScreen supplies bounded,
-sequential chunks to `whisper_full()` and restores their absolute timestamps,
-so long recordings retain progress and retry boundaries. Validation data —
-backend-by-backend WER and real-time factors — lives in
+that covers Metal, Vulkan and CPU in one binary. `whisper_full()` does its own
+long-form windowing over anything longer than 30 s, so no manual windowing is
+required on our side — OpenScreen chunks anyway, for progress and retry
+boundaries rather than for correctness (see § Long-form recordings). Validation
+data — backend-by-backend WER and real-time factors — lives in
[`tools/stt-eval/whispercpp-dtw-poc/REPORT.md`](../../tools/stt-eval/whispercpp-dtw-poc/REPORT.md).
### Per-platform backend
@@ -187,7 +188,7 @@ it verbatim in the response.
array.
2. **DTW timestamp** — every non-special token carries `t_dtw` in
centiseconds from whisper.cpp's native DTW
- (`dtw_token_timestamps=true`, `dtw_aheads_preset=WHISPER_AHEADS_LARGE_V3_TURBO`,
+ (`dtw_token_timestamps=true`, `dtw_aheads_preset=WHISPER_AHEADS_SMALL`,
`flash_attn=false`, which together are the prerequisites for DTW to
actually run). `t_dtw == -1` is the DTW-inactive guardrail: the helper
fails the request rather than emit zero-quality timestamps.
@@ -224,16 +225,20 @@ so no second pass is needed.
### Long-form recordings
-OpenScreen splits long recordings at nearby low-energy boundaries, transcribes
-the bounded chunks sequentially, then restores their absolute timestamps. This
-keeps progress observable and makes a failed chunk retryable without running a
-whole long recording again.
+`whisper_full()` handles recordings longer than 30 s internally, but OpenScreen
+splits them first anyway: `chunking.ts` cuts at the quietest frame near each
+90 s boundary, the chunks are transcribed sequentially, and their absolute
+timestamps are restored afterwards. That is not for correctness — whisper's own
+windowing would cope — but so progress stays observable and a failed chunk can
+be retried without re-running the whole recording. The validation set exercises
+130 s at WER 0.076 with full per-word coverage (see the validation report
+linked above).
### Model
-The single shipped artifact is `ggml-large-v3-turbo-q5_0.bin` from
-`ggerganov/whisper.cpp` on HuggingFace: Whisper `large-v3-turbo`, multilingual
-(~99 languages), q5_0 quantised, ~574 MB. Precision is baked into the GGML file —
+The single shipped artifact is `ggml-small-q8_0.bin` from
+`ggerganov/whisper.cpp` on HuggingFace: Whisper `small`, multilingual (~99
+languages), q8_0 quantised, ~264 MB. Precision is baked into the GGML file —
there is no runtime `--int8` flag. `electron/stt/modelManager.ts` downloads
the file once into the user-data cache and writes it through an atomic
`.partial` rename, so a half-downloaded file can never be picked up as a
@@ -285,7 +290,7 @@ bash scripts/build-whisper-stt.sh
# issues inside whisper.cpp's vulkan-shaders-gen sub-project.
# Run the helper directly for manual testing
-set OPENSCREEN_WHISPER_MODEL=%APPDATA%\Electron\stt-models\whisper-ggml\ggml-large-v3-turbo-q5_0.bin
+set OPENSCREEN_WHISPER_MODEL=%APPDATA%\Electron\stt-models\whisper-ggml\ggml-small-q8_0.bin
electron\native\bin\win32-x64\whisper-stt-server.exe --port 20199 --threads 8
# Test