Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.
TypeScript ai-meeting-assistantai-notetakerelectrongranola-alternativelinuxllama-cpplocal-ailocal-firstmacosmcpmeeting-minutesmeeting-notesoffline-firstopen-sourceprivacyspeech-to-texttranscriptionwhisperwhisper-cppwindows
Setup: Windows and Linux computers too slow to transcribe live still get ready and transcribe each meeting after it ends; whisper keeps to the processor where built-in graphics are slower, and the 26B is never picked for graphics that share the memory
christianmat150f5322a0d8
diff --git a/README.md b/README.mdindex 6b353549..92fda964 100644--- a/README.md+++ b/README.md@@ -68,7 +68,7 @@ Meeting data stays local; Yogurt goes online for model downloads and update chec<br>-> A Mac with Apple silicon and macOS 14.4 or newer, a 64-bit PC with Windows 10 (version 2004) or newer, or a 64-bit Linux computer with Ubuntu 22.04 or newer. Each needs at least 8 GB of memory. If your computer is too slow, Yogurt tells you during setup. On Windows and Linux, you connect your calendar with a private calendar link.+> A Mac with Apple silicon and macOS 14.4 or newer, a 64-bit PC with Windows 10 (version 2004) or newer, or a 64-bit Linux computer with Ubuntu 22.04 or newer. Each needs at least 8 GB of memory. On a computer too slow to transcribe live, Yogurt transcribes each meeting right after it ends. On Windows and Linux, you connect your calendar with a private calendar link.</details>diff --git a/app/e2e/speedCheck.spec.ts b/app/e2e/speedCheck.spec.tsindex becde90f..704d80ee 100644--- a/app/e2e/speedCheck.spec.ts+++ b/app/e2e/speedCheck.spec.ts@@ -11,24 +11,18 @@ const launch = (env: Record<string, string>) => {}const stored = (profile: string) => JSON.parse(readFileSync(join(profile, 'speech-speed.json'), 'utf8'))-const words: Record<string, string> = {- win32: "Yogurt runs entirely on your computer, and this one can't write down a meeting as fast as people talk. Updating your graphics driver may help. Otherwise it needs a faster processor, or graphics it can use.",- linux: "Yogurt runs entirely on your computer, and this one can't write down a meeting as fast as people talk. Installing the driver for your graphics card may help. Otherwise it needs a faster processor, or graphics it can use.",-}-for (const platform of ['win32', 'linux']) {- test(`@everywhere on ${platform}: a computer that can't keep up is told so plainly, and nothing records; Try again times it again`, async () => {+ // a Reddit report: "won't install due to performance requirements". A computer that can't keep up live still records,+ // and its meetings are transcribed from the recording after they end+ test(`@everywhere on ${platform}: a computer that can't keep up live still gets ready, and transcribes after the meeting`, async () => {const { app: launching, profile } = launch({ YOGURT_FAKE_PLATFORM: platform, YOGURT_FAKE_RTF: '2' })const app = await launchingtry {const page = await app.firstWindow()- await expect(page.getByTestId('setup-error')).toHaveText(words[platform], { timeout: 15_000 })- await expect(page.getByTestId('home')).toHaveCount(0)- expect(stored(profile)).toMatchObject({ model: null, rtf: { 'whisper-large-v3-turbo-q5_0': 2, 'whisper-small-q5_1': 2, 'whisper-base-q5_1': 2, 'whisper-tiny-q5_1': 2 } })- const at = stored(profile).at- await page.getByTestId('setup-retry').click()- await expect.poll(() => stored(profile).at, { timeout: 15_000 }).not.toBe(at)- await expect(page.getByTestId('setup-error')).toHaveText(words[platform])+ await expect(page.getByTestId('home')).toBeVisible({ timeout: 15_000 })+ await expect(page.getByTestId('setup-error')).toHaveCount(0)+ expect(stored(profile)).toMatchObject({ afterMeeting: true, rtf: { 'whisper-large-v3-turbo-q5_0': 2, 'whisper-small-q5_1': 2, 'whisper-base-q5_1': 2, 'whisper-tiny-q5_1': 2 } })+ expect(stored(profile).model).toEqual(expect.any(String))} finally { await app.close() }})diff --git a/app/src/main/asr/index.ts b/app/src/main/asr/index.tsindex 6137cf6e..beb0ce0e 100644--- a/app/src/main/asr/index.ts+++ b/app/src/main/asr/index.ts@@ -152,12 +152,13 @@ let gpuOffListener: (() => void) | undefinedexport function onWhisperGpuOff(cb: () => void) { gpuOffListener = cb }/** One whisper-server while meetings need it: started (warmed up) when one starts, let go a while after the last */-function serverFor(model: string, pidFile: string | undefined, make?: (model: string, pidFile?: string) => WhisperServer, o: { cpuOnly?: boolean } = {}): WhisperServer {+/** keepCpu: the speed check found the processor faster than the graphics here: whisper never tries the graphics */+function serverFor(model: string, pidFile: string | undefined, make?: (model: string, pidFile?: string) => WhisperServer, o: { cpuOnly?: boolean; keepCpu?: boolean } = {}): WhisperServer {clearTimeout(idleTimer)const key = `${model}|${pidFile}`if (!server || serverKey !== key) {void server?.stop()- server = make ? make(model, pidFile) : createWhisperServer({ binary: whisperServerPath(), model, pidFile, vadModel: vadModelPath(), gpuFallback: process.platform !== 'darwin', cpuOnly: o.cpuOnly, onGpuOff: () => gpuOffListener?.(), checkGpu: async (url) => { const clip = clipStart(); return !clip || hearsClip(url, clip) } })+ server = make ? make(model, pidFile) : createWhisperServer({ binary: whisperServerPath(), model, pidFile, vadModel: vadModelPath(), gpuFallback: process.platform !== 'darwin' && !o.keepCpu, cpuOnly: o.cpuOnly || o.keepCpu, onGpuOff: () => gpuOffListener?.(), checkGpu: async (url) => { const clip = clipStart(); return !clip || hearsClip(url, clip) } })serverKey = key}return server@@ -211,6 +212,10 @@ export function hookTranscription(p: {spoken?: () => Spoken/** a live transcript came out incomplete (whisper-server died, #127): its saved recording waits to be transcribed */queued?: (meetingId: string) => void+ /** Windows and Linux, from the speed check: whisper on the processor alone (faster there than the built-in graphics) */+ cpuOnly?: () => boolean+ /** Windows and Linux, from the speed check: no speech model keeps up live, so meetings are transcribed after they end */+ afterMeeting?: () => boolean/** the meeting's folder, where the mic without echo is kept for listening back (#166); none: not kept */meetingDir?: (meetingId: string) => string}): () => void {@@ -250,12 +255,13 @@ export function hookTranscription(p: {else {const model = p.modelPath()if (model) {- let srv = serverFor(model, p.pidFile, p.server)+ const keepCpu = !!p.cpuOnly?.()+ let srv = serverFor(model, p.pidFile, p.server, { keepCpu })srv.resetBudget()// no other meeting on it: a graphics card set aside earlier gets another chance (#156: it stayed off until a restart)if (!sessions.size) srv.gpuAgain(later ? 'a saved recording' : 'a new meeting')- // the model takes a few seconds to load: start now, so the first chunk does not wait for it- srv.url().catch((e) => console.error('whisper-server did not start', e))+ // the model takes a few seconds to load: start now, so the first chunk does not wait for it (not for a meeting read after it ends)+ if (later || !p.afterMeeting?.()) srv.url().catch((e) => console.error('whisper-server did not start', e))const pauseLive = (why: string) => {if (s.pipeline?.paused()) returnconsole.warn(`ASR ${why}: live transcription pauses, and the saved recording finishes the transcript after the meeting`)@@ -278,7 +284,7 @@ export function hookTranscription(p: {if (next && [...sessions.values()].every((x) => x === s)) {tried.add(next); reading = nextconsole.warn(`ASR ${why}: ${basename(next)} takes over for the rest of this meeting`)- srv = serverFor(next, p.pidFile, p.server, { cpuOnly: true })+ srv = serverFor(next, p.pidFile, p.server, { cpuOnly: true, keepCpu })srv.resetBudget()srv.url().catch((e) => console.error('whisper-server did not start', e))return@@ -346,6 +352,13 @@ export function hookTranscription(p: {cleanMic: cleanMic && ((ms, x) => cleanMic.push(ms, x)) }) : null,}if (s.speech) s.pipeline?.setQuickReads(false)+ // the speed check found no speech model that keeps up live here: the meeting is recorded, and the saved recording+ // gives the transcript once it ends (never a refusal to record)+ if (!later && s.pipeline && p.afterMeeting?.()) {+ console.info('ASR this computer transcribes meetings after they end: live transcription is off')+ s.pipeline.pause()+ setTimeout(() => warnOnce('live-paused'), NO_MODEL_NOTE_DELAY_MS)+ }sessions.set(id, s)return s}diff --git a/app/src/main/asr/speedCheck.ts b/app/src/main/asr/speedCheck.tsindex 650d01d8..f895a106 100644--- a/app/src/main/asr/speedCheck.ts+++ b/app/src/main/asr/speedCheck.ts@@ -39,6 +39,8 @@ export function readWav(buf: Buffer): Float32Array {type MeasureOpts = {binary: string; vadModel?: string; clip: string+ /** on the processor alone (-ng), never the graphics */+ cpu?: boolean/** for tests and the CI smoke: another launcher */server?: (model: string) => WhisperServer}@@ -49,7 +51,7 @@ type MeasureOpts = {* clip itself is stopped: null, too slow by far.*/export async function measureSpeed(model: string, o: MeasureOpts): Promise<{ rtf: number | null; gpuOff: boolean }> {- const srv = o.server?.(model) ?? createWhisperServer({ binary: o.binary, model, vadModel: o.vadModel, gpuFallback: true, startTimeoutMs: 180_000, backoffMs: [0], checkGpu: (url) => hearsClip(url, readWav(readFileSync(o.clip)).subarray(0, 5 * 16000)) })+ const srv = o.server?.(model) ?? createWhisperServer({ binary: o.binary, model, vadModel: o.vadModel, gpuFallback: !o.cpu, cpuOnly: o.cpu, startTimeoutMs: 180_000, backoffMs: [0], checkGpu: (url) => hearsClip(url, readWav(readFileSync(o.clip)).subarray(0, 5 * 16000)) })const samples = readWav(readFileSync(o.clip))const clipMs = samples.length / 16try {diff --git a/app/src/main/index.ts b/app/src/main/index.tsindex 48794ce5..304eb74d 100644--- a/app/src/main/index.ts+++ b/app/src/main/index.ts@@ -232,7 +232,7 @@ function createSetup(): SetupController {download: isFake() ? fakeDownloadDeps({ stepMs: Number(process.env.YOGURT_FAKE_STEP_MS ?? 5), notesMs: Number(process.env.YOGURT_FAKE_NOTES_MODEL_MS ?? 0), notesFailOnce: process.env.YOGURT_FAKE_NOTES_MODEL_FAIL_ONCE === '1' }) : realDeps,...(isFake() ? { sha256Override: 'FAKE' } : {}),// Windows and Linux: speech models timed on this computer (asr/speedCheck.ts); a Mac never is- ...(platform === 'darwin' ? {} : { speed: { ...speedStore(speedFile()), measure: isFake() ? fakeMeasure() : (model: string) => measureSpeed(model, { binary: whisperServerPath(), vadModel: vadModelPath(), clip: speedClipPath() ?? '' }) } }),+ ...(platform === 'darwin' ? {} : { speed: { ...speedStore(speedFile()), measure: isFake() ? fakeMeasure() : (model: string, o?: { cpu?: boolean }) => measureSpeed(model, { binary: whisperServerPath(), vadModel: vadModelPath(), clip: speedClipPath() ?? '', cpu: o?.cpu }) } }),})}/** what the speed check found (Windows and Linux) */@@ -665,7 +665,9 @@ app.whenReady().then(() => {if (process.platform === 'darwin' || process.platform === 'win32') callWindowOf = (id) => callNames.callWindow(id)// Windows and Linux: whisper left the graphics card in a meeting, so the speed check (timed with it) runs again next startonWhisperGpuOff(() => speedStore(speedFile()).forget())- hookTranscription({ store, modelPath: () => setup.installed()?.asr, smallerModels: () => setup.installed()?.smallerAsr ?? [], send: (seg) => {+ hookTranscription({ store, modelPath: () => setup.installed()?.asr, smallerModels: () => setup.installed()?.smallerAsr ?? [],+ // the speed check's findings: whisper on the processor (faster there than on built-in graphics), or after the meeting+ cpuOnly: () => !!setup.installed()?.asrCpu, afterMeeting: () => !!setup.installed()?.asrAfterMeeting, send: (seg) => {const order = seg.track === 'them' && seg.speaker ? store.speakerOrder(seg.meetingId, seg.speaker) : []const colored = { ...seg, speakerColor: speakerColor(seg.track, seg.speaker, order) }win?.webContents.send('transcript:segment', colored); sendWidgetTranscript('transcript:segment', colored)diff --git a/app/src/main/localCheck.ts b/app/src/main/localCheck.tsindex 1beb35b3..9d72171b 100644--- a/app/src/main/localCheck.ts+++ b/app/src/main/localCheck.ts@@ -21,8 +21,8 @@ export function tooWeak(hw: Hardware, hasPick: boolean): string | null {}/**- * Windows and Linux: the speed check timed every speech model and none keeps up with two voices as they talk. Recording- * stays off: a live transcript that falls further and further behind would drop what was said. Nothing goes to a cloud.+ * Windows and Linux: the speed check could not get any speech model to time (every download came out damaged). A+ * computer that is only slow never sees this: it transcribes meetings after they end (setup.ts). Nothing goes to a cloud.*/export function tooSlow(os: string): string {return os === 'win32'diff --git a/app/src/main/setup.ts b/app/src/main/setup.tsindex 685c8900..0dcc8961 100644--- a/app/src/main/setup.ts+++ b/app/src/main/setup.ts@@ -8,10 +8,14 @@ import { t } from '../shared/i18n'import { tooSlow, tooWeak } from './localCheck'/** What the speed check found on one computer (speedKey): the model kept (null: none keeps up) and each one's time over the clip's length */-export type SpeedResult = { key: string; model: string | null; rtf: Record<string, number | null>; at: number; /** whisper had to leave the graphics card while it was timed */ gpuOff?: boolean }+export type SpeedResult = { key: string; model: string | null; rtf: Record<string, number | null>; at: number; /** whisper had to leave the graphics card while it was timed */ gpuOff?: boolean+ /** times on the processor alone, for models too slow on the graphics */ cpuRtf?: Record<string, number | null>+ /** the model kept up on the processor, not the graphics: whisper stays there */ cpu?: boolean+ /** none keeps up live: meetings are transcribed from the recording after they end */ afterMeeting?: boolean }/** Windows and Linux: time a speech model on this computer (null: it ran out of time), and keep what was found */export type SpeedDeps = {- measure(modelPath: string): Promise<{ rtf: number | null; gpuOff?: boolean }>+ /** cpu: on the processor alone, never the graphics */+ measure(modelPath: string, o?: { cpu?: boolean }): Promise<{ rtf: number | null; gpuOff?: boolean }>load(): SpeedResult | undefinedsave(r: SpeedResult): void}@@ -35,7 +39,7 @@ export type SetupDeps = {}/** Where the models ended up, for the parts of the app that use them; llm once the first notes model is in (after ready) */-export type Installed = { asr: string; /** smaller speech models already on disk, best first: one takes over when the processor is too slow for asr (#156) */ smallerAsr?: string[]; llm?: string; recommendedLlm?: string; /** meaning search across meetings; word search works without it */ embed?: string }+export type Installed = { asr: string; /** whisper runs on the processor: it kept up there and not on the graphics */ asrCpu?: true; /** whisper can't keep up live here: meetings are transcribed after they end */ asrAfterMeeting?: true; /** smaller speech models already on disk, best first: one takes over when the processor is too slow for asr (#156) */ smallerAsr?: string[]; llm?: string; recommendedLlm?: string; /** meaning search across meetings; word search works without it */ embed?: string }/** the first notes model keeps being tried after ready: a minute, five, then every ten (a download picks up where it stopped) */const NOTES_RETRY_MS = [60_000, 5 * 60_000, 10 * 60_000]@@ -228,10 +232,12 @@ export class SetupController {const key = speedKey(hw)const saved = speed && !this.recheck ? speed.load() : undefinedthis.recheck = false- const known = saved?.key === key ? saved : undefined+ // a computer an earlier version stored as too slow (model null) is timed again: there is always a model now+ const known = saved?.key === key && saved.model ? saved : undefinedconst candidates = speed ? asrCandidates(hw, catalog) : []- if (speed && (known?.model === null || !candidates.length)) return this.set({ phase: 'error', fraction: 0, message: tooSlow(hw.os) })+ if (speed && !candidates.length) return this.set({ phase: 'error', fraction: 0, message: tooSlow(hw.os) })const keep = known && candidates.find((a) => a.id === known.model)+ let how: Pick<Installed, 'asrCpu' | 'asrAfterMeeting'> = keep ? { ...(known.cpu ? { asrCpu: true } : {}), ...(known.afterMeeting ? { asrAfterMeeting: true } : {}) } : {}const waitFor: Item[] = [asrItem(speed ? keep ?? candidates[0] : asr.model)]const total = waitFor.reduce((n, i) => n + i.bytes, 0)@@ -253,10 +259,13 @@ export class SetupController {let asrPath: string | undefinedif (speed && keep) asrPath = await get(asrItem(keep))else if (speed) {- const r = await this.timeSpeech(speed, candidates, get, asrItem)+ const r = await this.timeSpeech(speed, candidates, get, asrItem, hw.gpu.kind !== 'none')speed.save({ key, ...r.result, at: Date.now() })+ // every model downloaded corrupted: nothing to transcribe withif (!r.path) return this.set({ phase: 'error', fraction: this._state.fraction, message: tooSlow(hw.os) })asrPath = r.path+ how = { ...(r.result.cpu ? { asrCpu: true } : {}), ...(r.result.afterMeeting ? { asrAfterMeeting: true } : {}) }+ if (r.result.afterMeeting) console.warn(`speed check: no speech model keeps up live here; ${r.result.model} transcribes meetings after they end`)}while (!asrPath) {try { asrPath = await get(asrItem(asr.model)) } catch (err) {@@ -268,7 +277,7 @@ export class SetupController {// never downloaded for this: only what is already there (a model the speed check or an earlier pick left)const picked = catalog.asr.findIndex((a) => join(dirs.asr, fileNameFor(a.url)) === asrPath)const smallerAsr = picked < 0 ? [] : catalog.asr.slice(picked + 1).map(asrItem).filter((i) => isVerified(i.dir, i.fileName, this.sha(i))).map((i) => join(i.dir, i.fileName))- this.paths = { asr: asrPath, ...(smallerAsr.length ? { smallerAsr } : {}) }+ this.paths = { asr: asrPath, ...how, ...(smallerAsr.length ? { smallerAsr } : {}) }if (hasUpgrade) {this.paths.recommendedLlm = join(bigger!.dir, bigger!.fileName)if (isVerified(starterItem.dir, starterItem.fileName, this.sha(starterItem))) this.paths.llm = join(starterItem.dir, starterItem.fileName)@@ -285,24 +294,33 @@ export class SetupController {* Windows and Linux: download each speech model in turn and time it on a short clip, until one reads two voices as fast* as they talk. The ones that were too slow are deleted again. A model that downloads corrupted is skipped.*/- private async timeSpeech(speed: SpeedDeps, candidates: CatalogAsr[], get: (i: Item) => Promise<string>, asrItem: (m: CatalogAsr) => Item) {+ private async timeSpeech(speed: SpeedDeps, candidates: CatalogAsr[], get: (i: Item) => Promise<string>, asrItem: (m: CatalogAsr) => Item, graphics: boolean) {const paths = new Map<string, string>()let gpuOff = false- const r = await pickBySpeed(candidates, async (m) => {- try { paths.set(m.id, await get(asrItem(m))) } catch (err) {- if (err instanceof ChecksumError) { console.warn(`speed check: ${m.id} downloaded corrupted, trying the next one`); return null }- throw err+ /** models whose graphics run fell back to the processor: timing them there again would measure the same */+ const ranOnCpu = new Set<string>()+ const corrupt = new Set<string>()+ const r = await pickBySpeed(candidates, async (m, onCpu) => {+ if (corrupt.has(m.id)) return null+ if (!paths.has(m.id)) {+ try { paths.set(m.id, await get(asrItem(m))) } catch (err) {+ if (err instanceof ChecksumError) { console.warn(`speed check: ${m.id} downloaded corrupted, trying the next one`); corrupt.add(m.id); return null }+ throw err+ }}// "Preparing the transcription model" while it is timedthis.set({ phase: 'downloading', fraction: 1 })- const t = await speed.measure(paths.get(m.id)!)- if (t.gpuOff) gpuOff = true- console.log(`speed check: ${m.id} took ${t.rtf === null ? 'too long' : `${t.rtf.toFixed(2)} x`} the clip's length`)+ const t = await speed.measure(paths.get(m.id)!, onCpu ? { cpu: true } : undefined)+ if (t.gpuOff && !onCpu) { gpuOff = true; ranOnCpu.add(m.id) }+ console.log(`speed check: ${m.id}${onCpu ? ' on the processor' : ''} took ${t.rtf === null ? 'too long' : `${t.rtf.toFixed(2)} x`} the clip's length`)return t.rtf- // small may lag a little behind live: base and tiny are very weak outside English (#107)- }, { lagsOk: (m) => m.id.startsWith('whisper-small') })- for (const [id, p] of paths) if (id !== r.model?.id) rmSync(p, { force: true })- return { path: r.model && paths.get(r.model.id), result: { model: r.model?.id ?? null, rtf: r.rtf, ...(gpuOff ? { gpuOff } : {}) } }+ // small may lag a little behind live: base and tiny are very weak outside English (#107). With graphics, a model too+ // slow there is timed on the processor too (turbo never: 4 to 9 times too slow there); a built-in Radeon can be slower+ }, { lagsOk: (m) => m.id.startsWith('whisper-small'), cpuToo: (m) => graphics && !m.gpuOnly && !ranOnCpu.has(m.id) && !corrupt.has(m.id) })+ // the smallest fallback may be one that downloaded corrupted: then the smallest that did not+ const model = r.model && !corrupt.has(r.model.id) ? r.model : [...candidates].reverse().find((c) => paths.has(c.id) && !corrupt.has(c.id)) ?? null+ for (const [id, p] of paths) if (id !== model?.id) rmSync(p, { force: true })+ return { path: model && paths.get(model.id), result: { model: model?.id ?? null, rtf: r.rtf, ...(r.cpuRtf ? { cpuRtf: r.cpuRtf } : {}), ...(gpuOff ? { gpuOff } : {}), ...(r.cpu && model === r.model ? { cpu: true } : {}), ...(r.afterMeeting || model !== r.model ? { afterMeeting: true } : {}) } }}/**diff --git a/app/test/setup.test.ts b/app/test/setup.test.tsindex 13759638..0803e051 100644--- a/app/test/setup.test.ts+++ b/app/test/setup.test.ts@@ -5,7 +5,6 @@ import { describe, expect, it, vi } from 'vitest'import { speedKey, type Catalog, type Hardware } from '@yogurt/picker'import bundled from '../../catalog/catalog.json'import { SetupController, type SetupDeps, type SpeedDeps, type SpeedResult } from '../src/main/setup'-import { tooSlow } from '../src/main/localCheck'import { fakeDownloadDeps } from '../src/main/fake'import { DiskSpaceError, type DownloadDeps } from '../src/main/downloader'import type { SetupState } from '../src/shared/types'@@ -411,11 +410,16 @@ describe('the speed check (Windows and Linux): speech models timed on this compuconst gpuPc: Hardware = { os: 'linux', arch: 'x64', cpuModel: 'AMD Ryzen 5 5600X', totalRamGB: 16, freeDiskGB: 500, gpu: { kind: 'discrete', name: 'NVIDIA GeForce RTX 3060', vramGB: 12 }, cores: 12 }const url = (id: string) => catalog.asr.find((a) => a.id === id)!.url/** fake timings per model file, and a store kept in memory */- function speed(rtf: Record<string, number | null>, saved?: SpeedResult) {+ function speed(rtf: Record<string, number | null>, saved?: SpeedResult, onCpu: Record<string, number | null> = {}) {const timed: string[] = []let stored = saved+ const idOf = (path: string) => catalog.asr.find((a) => path.includes(a.url.split('/').pop()!))!.idconst deps: SpeedDeps = {- measure: async (path) => { const id = Object.keys(rtf).find((k) => path.includes(catalog.asr.find((a) => a.id === k)!.url.split('/').pop()!))!; timed.push(id); return { rtf: rtf[id] } },+ measure: async (path, o) => {+ const id = idOf(path)+ timed.push(o?.cpu ? `${id}@cpu` : id)+ return { rtf: (o?.cpu ? onCpu[id] : rtf[id]) ?? null }+ },load: () => stored, save: (r) => { stored = r },}return { deps, timed, stored: () => stored }@@ -546,28 +550,68 @@ describe('the speed check (Windows and Linux): speech models timed on this compuexpect(s.stored()?.model).toBe('whisper-small-q5_1')})- it("none keeps up: setup stops with the plain words, stores that, and says it again next time without timing; Try again times again", async () => {+ // a Reddit report: "won't install due to performance requirements". Recording works on any computer; where speech+ // can't keep up live, the transcript is written from the recording after the meeting+ it('none keeps up: setup still gets ready, with the best model that read the clip, transcribed after the meeting; kept for next time', async () => {for (const os of ['win32', 'linux'] as const) {const pc = { ...cpuPc, os }- const s = speed({ 'whisper-small-q5_1': 2, 'whisper-base-q5_1': 1.1, 'whisper-tiny-q5_1': null })+ const s = speed({ 'whisper-small-q5_1': null, 'whisper-base-q5_1': 0.8, 'whisper-tiny-q5_1': 0.6 })const first = setup({ getHardware: async () => pc, speed: s.deps })- await first.c.start()- expect(first.c.state).toMatchObject({ phase: 'error', message: tooSlow(os) })- expect(first.c.installed()).toBeUndefined()- expect(s.stored()).toMatchObject({ model: null, rtf: { 'whisper-small-q5_1': 2, 'whisper-base-q5_1': 1.1, 'whisper-tiny-q5_1': null } })- expect(s.timed).toHaveLength(3)+ await first.c.start(); await first.c.idle()+ expect(first.c.state.phase).toBe('ready')+ expect(first.c.installed()?.asr).toContain('ggml-base-q5_1.bin')+ expect(first.c.installed()?.asrAfterMeeting).toBe(true)+ expect(first.c.installed()?.llm).toBeTruthy()+ expect(s.stored()).toMatchObject({ model: 'whisper-base-q5_1', afterMeeting: true, rtf: { 'whisper-small-q5_1': null, 'whisper-base-q5_1': 0.8, 'whisper-tiny-q5_1': 0.6 } })+ // the ones not kept are deleted again+ expect(existsSync(join(first.root, 'asr', name(url('whisper-tiny-q5_1'))))).toBe(false)const again = setup({ getHardware: async () => pc, speed: s.deps, modelsDir: first.root })- await again.c.start()- expect(again.c.state).toMatchObject({ phase: 'error', message: tooSlow(os) })+ await again.c.start(); await again.c.idle()+ expect(again.c.state.phase).toBe('ready')+ expect(again.c.installed()?.asrAfterMeeting).toBe(true)expect(s.timed).toHaveLength(3)- expect(again.rec.asked).toEqual([])-- await again.c.retry()- expect(s.timed).toHaveLength(6)}})+ it('a computer an earlier version found too slow is timed again, never stopped', async () => {+ const s = speed({ 'whisper-small-q5_1': 0.3 }, { key: speedKey(cpuPc), model: null, rtf: { 'whisper-small-q5_1': 2 }, at: 1 })+ const { c } = setup({ getHardware: async () => cpuPc, speed: s.deps })+ await c.start(); await c.idle()+ expect(c.state.phase).toBe('ready')+ expect(s.timed).toEqual(['whisper-small-q5_1'])+ expect(c.installed()?.asrAfterMeeting).toBeUndefined()+ })++ it('a Ryzen 7 7735U with a Radeon 680M (32 GB, Windows): graphics slower than the processor, so whisper keeps to the processor, live', async () => {+ const pc: Hardware = { os: 'win32', arch: 'x64', cpuModel: 'AMD Ryzen 7 7735U with Radeon Graphics', totalRamGB: 33.4, freeDiskGB: 500, gpu: { kind: 'unified', name: 'AMD Radeon(TM) Graphics', vramGB: 2 }, cores: 16 }+ const s = speed({ 'whisper-large-v3-turbo-q5_0': null, 'whisper-small-q5_1': 1.6 }, undefined, { 'whisper-small-q5_1': 0.45 })+ const { c, rec } = setup({ getHardware: async () => pc, speed: s.deps })+ await c.start(); await c.idle()+ expect(c.state.phase).toBe('ready')+ // turbo is never timed on the processor+ expect(s.timed).toEqual(['whisper-large-v3-turbo-q5_0', 'whisper-small-q5_1', 'whisper-small-q5_1@cpu'])+ expect(c.installed()).toMatchObject({ asrCpu: true })+ expect(c.installed()?.asr).toContain('ggml-small-q5_1.bin')+ expect(c.installed()?.asrAfterMeeting).toBeUndefined()+ expect(s.stored()).toMatchObject({ model: 'whisper-small-q5_1', cpu: true })+ // the 14 GB 26B is never downloaded for graphics that share the memory+ expect(rec.asked).not.toContain(bigUrl)++ const again = setup({ getHardware: async () => pc, speed: s.deps })+ await again.c.start(); await again.c.idle()+ expect(again.c.installed()).toMatchObject({ asrCpu: true })+ expect(s.timed).toHaveLength(3)+ })++ it('without graphics the processor is not timed twice', async () => {+ const s = speed({ 'whisper-small-q5_1': 2, 'whisper-base-q5_1': 0.3 })+ const { c } = setup({ getHardware: async () => cpuPc, speed: s.deps })+ await c.start(); await c.idle()+ expect(s.timed).toEqual(['whisper-small-q5_1', 'whisper-base-q5_1'])+ expect(c.installed()?.asrCpu).toBeUndefined()+ })+it('a model that keeps failing its checksum is skipped for the next one', async () => {const s = speed({ 'whisper-small-q5_1': 0.1, 'whisper-base-q5_1': 0.2 })const inner = fakeDownloadDeps({ stepMs: 0 })diff --git a/app/test/transcription.test.ts b/app/test/transcription.test.tsindex eebb1b2c..06be3bbb 100644--- a/app/test/transcription.test.ts+++ b/app/test/transcription.test.ts@@ -417,12 +417,12 @@ describe('when whisper cannot keep up', () => {}return { made, make }}- function hooks(make: (model: string) => import('../src/main/asr/server').WhisperServer, smaller: string[] = [], capture = true) {+ function hooks(make: (model: string) => import('../src/main/asr/server').WhisperServer, smaller: string[] = [], capture = true, afterMeeting = false) {const starts: Array<(m: Meeting) => void> = [], stops: Array<(m: Meeting) => void> = []const warns: string[] = [], queued: string[] = []disposers.push(hookTranscription({store, modelPath: () => '/turbo.bin', smallerModels: () => smaller, send: () => {}, warn: (c) => warns.push(c), server: make, serverIdleMs: 60_000, holdMs: 0,- queued: (id) => queued.push(id), onStart: (fn) => { starts.push(fn) }, onStop: (fn) => { stops.push(fn) },+ queued: (id) => queued.push(id), onStart: (fn) => { starts.push(fn) }, onStop: (fn) => { stops.push(fn) }, afterMeeting: () => afterMeeting,}))const procs: ReturnType<typeof fakeProc>[] = []if (capture) hookCapture({@@ -451,6 +451,23 @@ describe('when whisper cannot keep up', () => {restore()})+ it('the speed check found no model that keeps up live: the meeting records, says so, nothing is read live, and the saved recording gives the transcript', async () => {+ const restore = quietly()+ const s = servers(await inference(), Infinity)+ const h = hooks(s.make, [], true, true)+ const m = meeting()+ h.begin(m)+ h.procs[0].say('them', 500)+ h.procs[0].say('me', 3000)+ await vi.waitFor(() => expect(h.warns).toEqual(['live-paused']))+ await h.end(m)+ expect(store.segments(m.id)).toEqual([])+ expect(s.made.every((x) => x.timed === 0)).toBe(true)+ expect(store.meeting(m.id)?.transcriptionState).toBe('queued')+ expect(h.queued).toEqual([m.id])+ restore()+ })+it('too slow on the processor with a smaller model on disk: that one takes over and live transcription goes on', async () => {const restore = quietly()const s = servers(await inference())diff --git a/docs/README.md b/docs/README.mdindex cf9b7868..e96ea28d 100644--- a/docs/README.md+++ b/docs/README.md@@ -10,7 +10,7 @@ Download Yogurt from [GitHub Releases](https://github.com/FrigadeHQ/yogurt/relea- **Windows:** Windows 10 version 2004 or later, x64. Run the `.exe` installer. It's signed by Frigade Inc.- **Linux:** x64, Ubuntu 22.04 or a compatible newer system, with PulseAudio or PipeWire. Make the `.AppImage` executable in its file properties, then open it. If it doesn't open, install FUSE 2 first: `sudo apt install libfuse2` on Ubuntu 22.04, `sudo apt install libfuse2t64` on 24.04 and newer. GNOME needs the AppIndicator extension to show the tray icon.-On first run, Yogurt downloads the models it needs. Windows and Linux also check transcription speed and stop setup if the computer cannot keep up. Recording works as soon as setup finishes. The notes model keeps downloading in the background, and notes and questions work offline once it's in. Calendar access and speaker names from calls are available on Mac only.+On first run, Yogurt downloads the models it needs. Windows and Linux also check transcription speed; a computer that can't transcribe live still records, and its meetings are transcribed right after they end. Recording works as soon as setup finishes. The notes model keeps downloading in the background, and notes and questions work offline once it's in. Calendar access and speaker names from calls are available on Mac only.## Mac permissionsdiff --git a/packages/picker/src/asr.ts b/packages/picker/src/asr.tsindex d1d5dbe8..72c0da98 100644--- a/packages/picker/src/asr.ts+++ b/packages/picker/src/asr.ts@@ -44,15 +44,38 @@ export function asrCandidates(hw: Hardware, c: Catalog, opts: { exclude?: string/*** Times the candidates in order and keeps the first that keeps up; nothing smaller is timed after it.* measure gives the realtime factor (time taken over the clip's length), or null when it ran out of time.+ *+ * cpuToo: a model that is too slow on the graphics is timed on the processor too. Graphics built into the processor+ * (a Radeon 680M through Vulkan) can be slower there than the processor itself; whichever keeps up is kept (cpu: true).+ *+ * None keeps up: there is still a model, never none (a computer that once got "too slow" could not record at all). It+ * is read after the meeting instead of live (afterMeeting): the best one that read the clip within its own length,+ * else the fastest, else the smallest. A meeting is recorded either way and its transcript follows.*/-export async function pickBySpeed<M extends { id: string }>(candidates: M[], measure: (m: M) => Promise<number | null>, opts: { lagsOk?: (m: M) => boolean } = {}): Promise<{ model: M | null; rtf: Record<string, number | null> }> {+export async function pickBySpeed<M extends { id: string }>(candidates: M[], measure: (m: M, onCpu?: boolean) => Promise<number | null>, opts: { lagsOk?: (m: M) => boolean; cpuToo?: (m: M) => boolean } = {}): Promise<{ model: M | null; rtf: Record<string, number | null>; cpuRtf?: Record<string, number | null>; cpu?: true; afterMeeting?: true }> {const rtf: Record<string, number | null> = {}+ const cpuRtf: Record<string, number | null> = {}+ const withCpu = () => (Object.keys(cpuRtf).length ? { cpuRtf } : {})+ const keepsUp = (m: M, r: number | null) => r !== null && r <= (opts.lagsOk?.(m) ? LAGS_A_LITTLE_RTF : KEEPS_UP_RTF)for (const m of candidates) {const r = await measure(m)rtf[m.id] = r- if (r !== null && r <= (opts.lagsOk?.(m) ? LAGS_A_LITTLE_RTF : KEEPS_UP_RTF)) return { model: m, rtf }+ if (keepsUp(m, r)) return { model: m, rtf, ...withCpu() }+ if (opts.cpuToo?.(m)) {+ const c = await measure(m, true)+ cpuRtf[m.id] = c+ if (keepsUp(m, c)) return { model: m, rtf, cpuRtf, cpu: true }+ }}- return { model: null, rtf }+ const best = (m: M) => {+ const g = rtf[m.id] ?? Infinity, c = cpuRtf[m.id] ?? Infinity+ return { m, t: Math.min(g, c), cpu: c < g }+ }+ const timed = candidates.map(best)+ const fastest = timed.filter((x) => Number.isFinite(x.t)).sort((a, b) => a.t - b.t)[0]+ const chosen = timed.find((x) => x.t <= 1) ?? fastest ?? (candidates.length ? { m: candidates[candidates.length - 1], cpu: false } : undefined)+ if (!chosen) return { model: null, rtf }+ return { model: chosen.m, rtf, ...withCpu(), ...(chosen.cpu ? { cpu: true as const } : {}), afterMeeting: true }}/** What the speed depends on: the processor and the graphics. A different one of either and the check runs again. */diff --git a/packages/picker/src/pick.ts b/packages/picker/src/pick.tsindex 65c6660b..ae905eb8 100644--- a/packages/picker/src/pick.ts+++ b/packages/picker/src/pick.ts@@ -46,6 +46,8 @@ function evaluate(hw: Hardware, model: CatalogModel, build: CatalogBuild): Choicif (pool.device === 'split' && onCard >= 1) continue // fits on the card: that's the gpu pool// no usable card, or one too small for it (a 4 GB GTX 1650): it would run from memory, so it isn't offered (#32)if (model.gpuOnly && (pool.device === 'cpu' || onCard < GPU_ONLY_MIN_ON_CARD)) continue+ // graphics built into the processor off a Mac (a Radeon 680M) run it from the same memory, at the processor's speed+ if (model.gpuOnly && hw.os !== 'darwin' && hw.gpu.kind === 'unified') continueconst secPerToken = (bytesPerToken * onCard) / pool.bw + (pool.cpuBw ? (bytesPerToken * (1 - onCard)) / pool.cpuBw : 0)const estTokPerSec = Math.round((1 / secPerToken) * EFFICIENCY * 10) / 10const choice: Choice = {diff --git a/packages/picker/test/asr.test.ts b/packages/picker/test/asr.test.tsindex 62bbfec3..0cfc3bc2 100644--- a/packages/picker/test/asr.test.ts+++ b/packages/picker/test/asr.test.ts@@ -52,6 +52,10 @@ describe('the measured speed check (Windows and Linux)', () => {it('with graphics: turbo first, then down to the smallest', () => {expect(ids(asrCandidates(machines.linux3060, catalog))).toEqual(['whisper-large-v3-turbo-q5_0', 'whisper-small-q5_1', 'whisper-base-q5_1', 'whisper-tiny-q5_1'])})+ it('a Ryzen 7 7735U: with its Radeon 680M every model is tried, on the processor alone small and smaller', () => {+ expect(ids(asrCandidates(machines.ryzen680m, catalog))).toEqual(['whisper-large-v3-turbo-q5_0', 'whisper-small-q5_1', 'whisper-base-q5_1', 'whisper-tiny-q5_1'])+ expect(ids(asrCandidates(machines.ryzen7735u, catalog))).toEqual(['whisper-small-q5_1', 'whisper-base-q5_1', 'whisper-tiny-q5_1'])+ })it('on the processor alone turbo is never tried (it measured 4 to 9 times too slow)', () => {expect(ids(asrCandidates(machines.winLaptop8, catalog))).toEqual(['whisper-small-q5_1', 'whisper-base-q5_1', 'whisper-tiny-q5_1'])})@@ -91,9 +95,35 @@ describe('pickBySpeed', () => {const t = timed({ turbo: null, small: null, base: null, tiny: 0.19 })expect((await pickBySpeed(list, t.measure)).model).toBe(list[3])})- it('none keeps up: no model, with every time it measured', async () => {- const t = timed({ turbo: 9, small: 2, base: 1.1, tiny: 0.6 })- expect(await pickBySpeed(list, t.measure)).toEqual({ model: null, rtf: { turbo: 9, small: 2, base: 1.1, tiny: 0.6 } })+ // a computer that can't keep up live still records: the transcript is written from the recording after the meeting+ it('none keeps up: the best one that read the clip at all is kept for after the meeting, with every time it measured', async () => {+ const t = timed({ turbo: null, small: null, base: 0.8, tiny: 0.6 })+ expect(await pickBySpeed(list, t.measure)).toEqual({ model: list[2], rtf: { turbo: null, small: null, base: 0.8, tiny: 0.6 }, afterMeeting: true })+ })+ it('none read the clip in its own length: the fastest one, after the meeting', async () => {+ expect(await pickBySpeed(list, timed({ turbo: 9, small: 2, base: 1.1, tiny: 1.05 }).measure)).toMatchObject({ model: list[3], afterMeeting: true })+ })+ it('none finished at all: still the smallest, after the meeting, never no model', async () => {+ expect(await pickBySpeed(list, timed({ turbo: null, small: null, base: null, tiny: null }).measure)).toMatchObject({ model: list[3], afterMeeting: true })+ })+ it('graphics slower than the processor (a Radeon 680M through Vulkan): the processor is timed too, and kept where it keeps up', async () => {+ const asked: string[] = []+ const gpu: Record<string, number | null> = { turbo: 2, small: 0.9, base: 0.6 }, cpu: Record<string, number | null> = { small: 0.4, base: 0.2 }+ const measure = async (m: { id: string }, onCpu?: boolean) => { asked.push(`${m.id}${onCpu ? '@cpu' : ''}`); return (onCpu ? cpu : gpu)[m.id] }+ // turbo is never tried on the processor: it measured 4 to 9 times too slow there+ const r = await pickBySpeed(list, measure, { cpuToo: (m) => m.id !== 'turbo' })+ expect(r).toEqual({ model: list[1], rtf: { turbo: 2, small: 0.9 }, cpuRtf: { small: 0.4 }, cpu: true })+ expect(asked).toEqual(['turbo', 'small', 'small@cpu'])+ })+ it('graphics that keep up are kept: the processor is not timed', async () => {+ const asked: string[] = []+ const r = await pickBySpeed(list, async (m, onCpu) => { asked.push(`${m.id}${onCpu ? '@cpu' : ''}`); return 0.2 }, { cpuToo: () => true })+ expect(r).toEqual({ model: list[0], rtf: { turbo: 0.2 } })+ expect(asked).toEqual(['turbo'])+ })+ it('after the meeting on whichever was faster for that model', async () => {+ const r = await pickBySpeed(list, async (m, onCpu) => (m.id === 'small' ? (onCpu ? 0.7 : 0.95) : null), { cpuToo: (m) => m.id !== 'turbo', lagsOk: () => false })+ expect(r).toMatchObject({ model: list[1], afterMeeting: true, cpu: true })})})diff --git a/packages/picker/test/fixtures.ts b/packages/picker/test/fixtures.tsindex f1e6d522..2d5bb94f 100644--- a/packages/picker/test/fixtures.ts+++ b/packages/picker/test/fixtures.ts@@ -42,5 +42,9 @@ export const machines = {cpu33: hw({ os: 'linux', arch: 'x64', cpuModel: 'AMD Ryzen 7 5800XT', totalRamGB: 33.3, gpu: { kind: 'none', name: '', vramGB: 0 } }),gtx1650_33: hw({ os: 'linux', arch: 'x64', cpuModel: 'AMD Ryzen 7 5700X', totalRamGB: 33.3, gpu: { kind: 'discrete', name: 'NVIDIA GeForce GTX 1650', vramGB: 4 } }),win1650_33: hw({ os: 'win32', arch: 'x64', cpuModel: 'AMD Ryzen 7 5700X', totalRamGB: 33.3, gpu: { kind: 'discrete', name: 'NVIDIA GeForce GTX 1650', vramGB: 4 } }),+ // a Reddit report: Ryzen 7 7735U (8 cores, 16 threads), Radeon 680M built in, 32 GB, Windows 11. The notes engine+ // sees the 680M through Vulkan sharing the memory (unified), or sees nothing usable (none)+ ryzen680m: hw({ os: 'win32', arch: 'x64', cpuModel: 'AMD Ryzen 7 7735U with Radeon Graphics', totalRamGB: 33.4, gpu: { kind: 'unified', name: 'AMD Radeon(TM) Graphics', vramGB: 2 }, cores: 16 }),+ ryzen7735u: hw({ os: 'win32', arch: 'x64', cpuModel: 'AMD Ryzen 7 7735U with Radeon Graphics', totalRamGB: 33.4, gpu: { kind: 'none', name: '', vramGB: 0 }, cores: 16 }),tiny4: hw({ os: 'win32', arch: 'x64', cpuModel: 'Intel Celeron', totalRamGB: 4, gpu: { kind: 'none', name: '', vramGB: 0 } }),}diff --git a/packages/picker/test/pick.test.ts b/packages/picker/test/pick.test.tsindex 0943b68e..ab9e13db 100644--- a/packages/picker/test/pick.test.ts+++ b/packages/picker/test/pick.test.ts@@ -67,6 +67,9 @@ describe('pick', () => {it('a 4 GB card (GTX 1650) on Linux or Windows: never the 26B', () => {for (const hw of [machines.gtx1650_33, machines.win1650_33]) expect(offered(pick(hw, models))).not.toContain('gemma-4-26b-a4b')})+ it('graphics built into the processor (Radeon 680M) share the memory: never the 26B there either', () => {+ expect(offered(pick(machines.ryzen680m, models))).not.toContain('gemma-4-26b-a4b')+ })it('a card that holds most of it still gets it (RTX 3060 12 GB), and Macs are unchanged', () => {expect(id(pick(machines.linux3060, models).recommended)).toBe('gemma-4-26b-a4b')expect(id(pick(machines.rtx3060_32, models).recommended)).toBe('gemma-4-26b-a4b')@@ -108,6 +111,14 @@ describe('pick', () => {expect(r.liteMode).toBe(false)expect(r.all.map((c) => c.model.id)).toContain('gemma-4-e2b')})+ it('a Ryzen 7 7735U with a Radeon 680M and 32 GB always gets a notes model, whether the graphics are usable or not', () => {+ for (const hw of [machines.ryzen680m, machines.ryzen7735u]) {+ const r = pick(hw, models)+ expect(r.recommended).not.toBeNull()+ expect(r.starter).not.toBeNull()+ expect(r.recommended!.build.sizeGB).toBeLessThan(13)+ }+ })it('nothing fits → recommended null, no crash', () => {const r = pick(machines.tiny4, models)expect(r.recommended).toBeNull()