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
Speech (Windows, Linux): the small model is kept even when it lags a little behind live, instead of falling back to base or tiny, which are very weak outside English; every computer times its models again once (#107)
christianmatbaf805918278
diff --git a/app/src/main/setup.ts b/app/src/main/setup.tsindex e2f52b36..4cf08b99 100644--- a/app/src/main/setup.ts+++ b/app/src/main/setup.ts@@ -296,7 +296,8 @@ export class SetupController {if (t.gpuOff) gpuOff = trueconsole.log(`speed check: ${m.id} 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 } : {}) } }}diff --git a/app/test/setup.test.ts b/app/test/setup.test.tsindex b8176764..dabdca61 100644--- a/app/test/setup.test.ts+++ b/app/test/setup.test.ts@@ -476,16 +476,23 @@ describe('the speed check (Windows and Linux): speech models timed on this compuexpect(s.stored()).toBeUndefined()})- it('on the processor alone: small first (never turbo), then smaller until one keeps up; the result is stored', async () => {+ it('on the processor alone: small first (never turbo), kept even when it lags a little, since base is weak outside English (#107); the result is stored', async () => {const s = speed({ 'whisper-small-q5_1': 0.88, 'whisper-base-q5_1': 0.42, 'whisper-tiny-q5_1': 0.19 })const { c, rec } = 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', 'whisper-base-q5_1'])+ expect(s.timed).toEqual(['whisper-small-q5_1'])expect(rec.asked).not.toContain(turboUrl)+ expect(c.installed()?.asr).toContain('ggml-small-q5_1.bin')+ expect(s.stored()).toMatchObject({ key: speedKey(cpuPc), model: 'whisper-small-q5_1', rtf: { 'whisper-small-q5_1': 0.88 } })+ })+ it('small slower than the clip itself: then smaller until one keeps up', async () => {+ const s = speed({ 'whisper-small-q5_1': 1.3, 'whisper-base-q5_1': 0.42, 'whisper-tiny-q5_1': 0.19 })+ const { c, rec } = 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(rec.asked).not.toContain(url('whisper-tiny-q5_1'))expect(c.installed()?.asr).toContain('ggml-base-q5_1.bin')- expect(s.stored()).toMatchObject({ key: speedKey(cpuPc), model: 'whisper-base-q5_1', rtf: { 'whisper-small-q5_1': 0.88, 'whisper-base-q5_1': 0.42 } })})it('with graphics turbo is timed first and kept when it keeps up', async () => {diff --git a/packages/picker/src/asr.ts b/packages/picker/src/asr.tsindex 121da05c..ea92e366 100644--- a/packages/picker/src/asr.ts+++ b/packages/picker/src/asr.ts@@ -22,6 +22,14 @@ export function pickAsr(hw: Hardware, c: Catalog, opts: { exclude?: string[] } =* (final) reading of a clip takes at most half the clip's length.*/export const KEEPS_UP_RTF = 0.5+/**+ * small may take up to the clip's length rather than fall back to base or tiny, which are very weak outside English+ * (#107). It lags a little behind live; whisper skips silence, so with each side talking about half the time it still+ * about keeps up over a meeting.+ */+export const LAGS_A_LITTLE_RTF = 1+/** part of the speed check's key: a change to how it picks measures every computer again, once */+export const SPEED_CHECK_VERSION = 'v2'/*** Windows and Linux: the speech models the speed check tries, best first (a Mac has none: it never measures). On the@@ -37,15 +45,15 @@ 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.*/-export async function pickBySpeed<M extends { id: string }>(candidates: M[], measure: (m: M) => Promise<number | null>): Promise<{ model: M | null; rtf: Record<string, number | null> }> {+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> }> {const rtf: Record<string, number | null> = {}for (const m of candidates) {const r = await measure(m)rtf[m.id] = r- if (r !== null && r <= KEEPS_UP_RTF) return { model: m, rtf }+ if (r !== null && r <= (opts.lagsOk?.(m) ? LAGS_A_LITTLE_RTF : KEEPS_UP_RTF)) return { model: m, rtf }}return { model: null, rtf }}/** What the speed depends on: the processor and the graphics. A different one of either and the check runs again. */-export const speedKey = (hw: Hardware): string => [hw.os, hw.arch, hw.cpuModel, hw.cores ?? '', hw.gpu.kind, hw.gpu.name].join('|')+export const speedKey = (hw: Hardware): string => [SPEED_CHECK_VERSION, hw.os, hw.arch, hw.cpuModel, hw.cores ?? '', hw.gpu.kind, hw.gpu.name].join('|')diff --git a/packages/picker/src/index.ts b/packages/picker/src/index.tsindex 61a6094a..4542c135 100644--- a/packages/picker/src/index.ts+++ b/packages/picker/src/index.ts@@ -2,4 +2,4 @@ export * from './types'export { bandwidthGBs } from './bandwidth'export { pick, MIN_TOK_PER_SEC, LITE_AGENT_SCORE } from './pick'export { CatalogSchema, validateCatalog } from './catalog-schema'-export { asrCandidates, KEEPS_UP_RTF, pickAsr, pickBySpeed, speedKey } from './asr'+export { asrCandidates, KEEPS_UP_RTF, LAGS_A_LITTLE_RTF, pickAsr, pickBySpeed, SPEED_CHECK_VERSION, speedKey } from './asr'diff --git a/packages/picker/test/asr.test.ts b/packages/picker/test/asr.test.tsindex 2f7f1605..64ec655f 100644--- a/packages/picker/test/asr.test.ts+++ b/packages/picker/test/asr.test.ts@@ -1,5 +1,5 @@import { describe, expect, it } from 'vitest'-import { asrCandidates, KEEPS_UP_RTF, pickAsr, pickBySpeed, speedKey } from '../src/asr'+import { asrCandidates, KEEPS_UP_RTF, LAGS_A_LITTLE_RTF, pickAsr, pickBySpeed, SPEED_CHECK_VERSION, speedKey } from '../src/asr'import { machines } from './fixtures'import real from '../../../catalog/catalog.json'import type { Catalog } from '../src/types'@@ -76,6 +76,16 @@ describe('pickBySpeed', () => {expect(await pickBySpeed(list, t.measure)).toEqual({ model: list[2], rtf: { turbo: 4.4, small: 0.88, base: 0.5 } })expect(KEEPS_UP_RTF).toBe(0.5)})+ // #107: base and tiny are very weak outside English. small may lag a little behind live rather than fall back to them:+ // whisper skips silence (VAD), so with both sides talking about half the time it still about keeps up over a meeting.+ it('a model allowed to lag a little is kept up to twice the strict limit, before anything smaller', async () => {+ const t = timed({ turbo: 4.4, small: 0.88, base: 0.3 })+ const lags = (m: { id: string }) => m.id === 'small'+ expect(await pickBySpeed(list, t.measure, { lagsOk: lags })).toEqual({ model: list[1], rtf: { turbo: 4.4, small: 0.88 } })+ expect(LAGS_A_LITTLE_RTF).toBe(1)+ // too slow even so: down the list as before+ expect((await pickBySpeed(list, timed({ turbo: 4.4, small: 1.4, base: 0.3 }).measure, { lagsOk: lags })).model).toBe(list[2])+ })it('a run that ran out of time counts as too slow', async () => {const t = timed({ turbo: null, small: null, base: null, tiny: 0.19 })expect((await pickBySpeed(list, t.measure)).model).toBe(list[3])@@ -87,6 +97,10 @@ describe('pickBySpeed', () => {})describe('speedKey: the speed check runs again only when the computer changes', () => {+ it('carries the speed check version, so a change to how it picks measures again once (#107)', () => {+ expect(speedKey(machines.linux3060).startsWith(`${SPEED_CHECK_VERSION}|`)).toBe(true)+ expect(SPEED_CHECK_VERSION).toBe('v2')+ })it('the same computer gives the same key; other graphics or processor a new one', () => {const k = speedKey(machines.linux3060)expect(speedKey({ ...machines.linux3060, freeDiskGB: 1 })).toBe(k)