offmute-v2 0.0.5 β†’ 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,293 +1,310 @@
1
+ <!-- prettier-ignore-start -->
1
2
  <div align="center">
2
3
 
3
- # offmute-v2 πŸŽ™οΈβ±οΈ
4
+ <img src="https://raw.githubusercontent.com/SouthBridgeAI/offmute-v2/master/docs/assets/mascot.png" alt="offmute β€” a frog that listens carefully" width="460">
4
5
 
5
- ### `npx offmute-v2 meeting.mp4`
6
+ # offmute-v2
6
7
 
7
- **Timestamp-correct, diarized meeting transcription.** Point it at a video or audio file and get
8
- back a transcript where every speaker turn lands on the right millisecond β€” labelled with the
9
- speaker's name (when it can be inferred) and their tone β€” as **SRT**, **Markdown**, and **JSON**.
8
+ **State-of-the-art meeting transcription.**<br>
9
+ Every word on the right millisecond. Every speaker told apart β€” and named.
10
10
 
11
- [![npm](https://img.shields.io/npm/v/offmute-v2?color=cb3837&logo=npm)](https://www.npmjs.com/package/offmute-v2)
12
- [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
13
- [![node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)](#requirements)
11
+ <br>
14
12
 
15
- πŸ“ **Read the full write-up β€” _"offmute-v2: GLM vs Opus"_ β€” coming soon at
16
- [southbridge.ai/blog/offmute-v2-glm-vs-opus](http://southbridge.ai/blog/offmute-v2-glm-vs-opus)**
13
+ ```bash
14
+ npx offmute-v2 meeting.mp4
15
+ ```
16
+
17
+ [![npm](https://img.shields.io/npm/v/offmute-v2?color=cb3837&logo=npm)](https://www.npmjs.com/package/offmute-v2)&nbsp;
18
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)&nbsp;
19
+ [![node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)](#requirements)&nbsp;
20
+ [![built by three frontier models](https://img.shields.io/badge/built%20by-GLM%20%C3%97%20Opus%20%C3%97%20Fable-8A2BE2)](#the-story)
21
+
22
+ **[Quick start](#quick-start)** Β· **[What you get](#what-you-get)** Β· **[Why it's accurate](#why-its-accurate)** Β· **[Daemon](#daemon-mode)** Β· **[Costs](#costs-you-can-see)** Β· **[CLI](#cli-reference)** Β· **[Library](#library)** Β· **[The story](#the-story)**
17
23
 
18
24
  </div>
25
+ <!-- prettier-ignore-end -->
19
26
 
20
27
  ---
21
28
 
22
- It's the successor to [offmute](https://github.com/southbridgeai/offmute): the same great diarized,
23
- tone-aware transcripts β€” now with **real timestamps**, SRT output, a resumable pipeline, and a
24
- browser build. No single model is good at everything, so offmute-v2 uses each for what it's best at
25
- and **fuses** them.
29
+ <div align="center">
30
+
31
+ <img src="https://raw.githubusercontent.com/SouthBridgeAI/offmute-v2/master/docs/assets/whos-speaking.png" alt='Iron Man: "Who&apos;s speaking?" β€” Ant-Man, inside the suit: "It&apos;s your conscience. We don&apos;t talk a lot these days."' width="440">
32
+
33
+ _the eternal diarization problem β€” Tony had **one** unknown speaker and an AI in his helmet, and still needed help_
34
+
35
+ </div>
36
+
37
+ Speech-to-text is a solved problem. _Meetings_ are not: who said what, through interruptions,
38
+ across an hour, with names attached and timestamps you can trust. Every tool picks one half β€”
39
+ ASR services nail the clock but garble the people; LLMs understand the people but
40
+ [hallucinate the clock](#why-its-accurate). offmute-v2 runs both and fuses them, word by word.
41
+
42
+ The result: **best-in-class WER, ~99% speaker attribution, sub-second turn boundaries** on
43
+ hand-checked real recordings β€” with speakers identified _by name_ from context alone, and every
44
+ name verified by a second model before it ships.
45
+
46
+ ## Quick start
26
47
 
27
48
  ```bash
28
- export GEMINI_API_KEY=... # multimodal understanding (or GOOGLE_API_KEY)
29
- export ASSEMBLYAI_API_KEY=... # word-level timing
49
+ export GEMINI_API_KEY=... # the ears (aistudio.google.com/apikey)
50
+ export ASSEMBLYAI_API_KEY=... # the clock (assemblyai.com β€” $0.15/hr)
30
51
 
31
- npx offmute-v2 meeting.mp4 --instructions "Panel of founders; label them by name."
32
- # β†’ meeting.md (written right next to meeting.mp4)
52
+ npx offmute-v2 meeting.mp4
53
+ # β†’ meeting.md, right next to meeting.mp4
33
54
  ```
34
55
 
35
- That's it. `bunx offmute-v2 meeting.mp4` works too.
36
-
37
- ## What you get
56
+ That's the whole thing. First run checks your setup and tells you what any missing keys would
57
+ unlock. Every run shows you what it will cost before spending, and what it spent after:
38
58
 
39
- A clean, sub-second-aligned, speaker-labelled transcript with tone. By default offmute-v2 writes a
40
- **single `meeting.md` next to your input file** β€” add `--formats srt,md,json` (and/or `-o <dir>`) for
41
- SubRip subtitles and JSON. The same content, three ways:
59
+ ```text
60
+ offmute-v2 0.1.0 team-call.mp4
42
61
 
43
- **`meeting.srt`** (`--formats srt` β€” drop straight onto the video):
62
+ estimate ~$0.30 [gemini-3.1-pro-preview: 4 chunks + describe β‰ˆ $0.22 Β· assemblyai: 28min β‰ˆ $0.07 Β· …]
63
+ βœ“ preparing media Β· extracting keyframes 28s
64
+ βœ“ listening for context 41s
65
+ βœ“ transcribing 3/3 chunks 38s
66
+ βœ“ timestamps (AssemblyAI) Β· 154 utterances, 5813 words, 2 speakers 23s
67
+ βœ“ aligning timestamps Β· split 3 mixed-voice boundaries 0s
68
+ βœ“ resolving speakers 0s
69
+ β—† identified 3 speakers: {"Speaker A":"Hrishi","Speaker B":"Chibi","Speaker C":"Daniel"}
70
+ βœ“ naming speakers (deepseek-chat + gemini-flash-latest second opinion) 12s
71
+ βœ“ finalizing Β· 65 segments 0s
72
+ receipt 6 LLM calls Β· 63k in / 12k out Β· ~$0.32 Β· 2m49s
44
73
 
45
- ```srt
46
- 1
47
- 00:00:00,160 --> 00:00:00,720
48
- Speaker D: GPU
74
+ β†’ /Users/you/team-call.md
49
75
 
50
- 2
51
- 00:00:01,199 --> 00:00:05,440
52
- Presenter: And I'm inspired. I think I'm going to apply to NTU this fall. (confident, joking)
76
+ 65 segments Β· 3 speakers Β· 23m of audio Β· ~$0.32 Β· 2m 49s
53
77
  ```
54
78
 
55
- **`meeting.md`** (the **default** β€” skimmable, grouped by speaker, with talk-time):
79
+ ## What you get
56
80
 
57
- ```markdown
58
- _Duration: 1914s Β· Speakers: 5_
81
+ A transcript that reads like a person took minutes, timed like a machine kept the clock:
59
82
 
83
+ ```markdown
60
84
  ## Speakers
61
85
 
62
- - **Presenter** (1461s)
63
- - **Speaker B** (97s) Β· **Speaker C** (87s) Β· ...
86
+ - **Hanjun Kim** β€” 4m 37s
87
+ - **Ang Li** β€” 6m 30s
88
+ - **Moderator** β€” 5m 30s
64
89
 
65
90
  ## Transcript
66
91
 
67
- [00:00] **Speaker D**: GPU
68
- [00:01] **Presenter** _(confident, joking)_: And I'm inspired. I think I'm going to apply to NTU this fall.
92
+ `[00:32]` **Hayden Salmon:** I said 25%. I was wrong.
93
+
94
+ `[00:35]` **Ang Li:** I said 5%.
95
+
96
+ `[00:46]` **Hanjun Kim:** Hey everybody. I'm Hanjun Kim. I'm a strategy professor at INSEAD,
97
+ and I study how the economics of building, scaling, and designing companies are changing with AI.
69
98
  ```
70
99
 
71
- **`meeting.json`** (`--formats json`) β€” every segment with `start`/`end`, `speaker`, `text`,
72
- `tone[]`, `timingSource`, `confidence`, and word-level timings β€” for downstream tooling.
100
+ Same-speaker runs merge into readable paragraphs; tone shows up only when it matters
101
+ (_(laughing)_, _(sarcastic)_) instead of decorating every line. One file by default; five formats
102
+ when you want them:
103
+
104
+ | format | what it's for |
105
+ | ---------------- | ---------------------------------------------------------------------------------------- |
106
+ | `md` _(default)_ | the transcript you actually read β€” merged paragraphs, `[mm:ss]` anchors |
107
+ | `srt` | subtitles β€” cue width capped, timing word-accurate, drop straight onto the video |
108
+ | `html` | one self-contained shareable page β€” speaker colors, click-to-copy timestamps, no JS deps |
109
+ | `txt` | plain text for grepping and piping |
110
+ | `json` | every segment with `start`/`end`, speaker, tone, confidence, word-level timings |
111
+
112
+ Add `--summary` for a `meeting.summary.md` with the TL;DR, decisions, and action items.
73
113
 
74
114
  ## Why it's accurate
75
115
 
76
- LLMs are brilliant at _understanding_ speech (who's talking, through interruptions, in a crowd,
77
- with tone) but [terrible at timestamps](#how-it-works). ASR models are the opposite: sub-second
78
- timing, but mediocre diarization and no sense of tone. offmute-v2 runs **both** and marries them:
116
+ Multimodal LLMs are the best diarizers in the world β€” they follow speakers through
117
+ interruptions, infer names from "hey everybody, I'm Hanjun", and hear tone. They are also
118
+ _hopeless_ at time: left alone, Gemini's timestamps drift **minutes** over a long recording.
119
+ ASR services are the mirror image: word timings accurate to centiseconds, but speakers as
120
+ anonymous clusters and text that keeps every "um".
79
121
 
80
- | Job | Tool | Why |
81
- | ------------------------------------------------- | ----------------------------------- | --------------------------------------------------------------------- |
82
- | **WHO / HOW** β€” speakers, names, tone, hard audio | multimodal **LLM** (Gemini) | infers names from context, hears tone, handles crowds & interruptions |
83
- | **WHEN** β€” word-level timestamps | **ASR** (AssemblyAI / Groq Whisper) | sub-second accurate; LLM timestamps drift _minutes_ over a long file |
84
- | **fuse** | edit-distance **alignment** | transfers the ASR's clock onto the LLM's richer words |
122
+ So each does the half it's the best in the world at:
85
123
 
86
124
  ```mermaid
87
125
  flowchart LR
88
126
  IN["🎬 audio / video"] --> PRE["preprocess<br/>16kHz mono + keyframes"]
89
- PRE --> LLM["multimodal LLM<br/>diarize Β· transcribe Β· tone<br/><i>(per chunk)</i>"]
90
- PRE --> ASR["ASR<br/>word-level timestamps<br/><i>(whole file)</i>"]
91
- LLM --> AL["align<br/>edit-distance fuse"]
127
+ PRE --> LLM["multimodal LLM<br/>words Β· speakers Β· tone<br/><i>(chunked, concurrent)</i>"]
128
+ PRE --> ASR["ASR<br/>word-level clock<br/><i>(whole file)</i>"]
129
+ LLM --> AL["alignment<br/>one edit-distance pass"]
92
130
  ASR --> AL
93
- AL --> GF["gap-fill<br/>recover dropped speech"]
94
- GF --> CON["consistency<br/>stable speakers"]
95
- CON --> ID["identify names<br/><i>(optional, level 3)</i>"]
96
- ID --> FIN["finalize β†’<br/>SRT Β· MD Β· JSON"]
131
+ AL --> POST["gap-fill Β· mixed-voice splits<br/>speaker resolution"]
132
+ POST --> ID["name verification<br/><i>(two models + evidence checks)</i>"]
133
+ ID --> OUT["md Β· srt Β· html Β· txt Β· json"]
134
+ ```
135
+
136
+ The fuse is a [Needleman–Wunsch](https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm)
137
+ alignment over the two word streams β€” the LLM's text inherits the ASR's clock. Around that core,
138
+ the seams that actually determine day-to-day quality:
139
+
140
+ - **Names shown are names verified.** Two different reasoner models read the full transcript and
141
+ name the speakers independently. They must agree β€” or produce an evidence quote that actually
142
+ appears in the transcript. A stated self-introduction outranks both; an unresolvable
143
+ disagreement stays an honest `Speaker A` rather than becoming a confident guess. One person
144
+ can never be two voices.
145
+ - **Conversation partners never merge.** ASR diarizers over-split one voice into two clusters;
146
+ naive fixes merge them back by label β€” and fuse two _real people_ when the LLM mislabels.
147
+ offmute-v2 checks the turn-taking pattern: clusters that alternate like a conversation are
148
+ different humans, whatever the labels say.
149
+ - **Mega-segments get split at voice boundaries.** When the LLM folds someone's interjection
150
+ into another speaker's turn, word-level timing exposes the foreign voice and the segment is
151
+ split at the exact word.
152
+ - **Chunk seams never double-print.** Segments are ownership-partitioned across chunk overlaps,
153
+ and boundary-spanning duplicates are trimmed word-by-word.
154
+ - **Nothing silently goes stale.** Every stage caches to disk, keyed on the input file _and_ the
155
+ config β€” change the model and the cache invalidates itself. Re-run for a new format and it's
156
+ ~2 seconds and $0.00. Kill it mid-run and it resumes where it stopped.
157
+
158
+ Measured on a hand-checked 32-minute talk with audience Q&A: **β‰ˆ8% WER, ~99% word-level speaker
159
+ attribution, first cue within 40ms of reference.** Receipts, methodology, and an independent
160
+ re-score live in `[docs/](https://github.com/SouthBridgeAI/offmute-v2/tree/fable/docs)` and the
161
+ [write-up](https://southbridge.ai/blog/offmute-v2-glm-vs-opus).
162
+
163
+ ## Daemon mode
164
+
165
+ Point it at the folder your recorder drops files into, and stop thinking about it:
166
+
167
+ ```bash
168
+ offmute-v2 watch ~/Recordings --summary
97
169
  ```
98
170
 
99
- **Measured** on a hand-checked 32-minute talk (founder presentation + audience Q&A): **β‰ˆ8% word
100
- error rate** and **~99% word-level speaker attribution**, with turn boundaries riding AssemblyAI's
101
- word timing (first cue at `00:00:00,160`, exactly matching ground truth). Full methodology, runs,
102
- and an independent re-score live in [`docs/`](#receipts--how-this-repo-was-built) and the article.
103
-
104
- ## Features
105
-
106
- - 🎯 **Timestamp-correct** β€” word-level timing from ASR, fused onto LLM text by alignment.
107
- - 🎭 **Diarization + tone** β€” separates speakers through interruptions; annotates `(laughing)`,
108
- `(hesitant)`, `(confident)`, …
109
- - πŸ§‘β€πŸ€β€πŸ§‘ **Three levels of speaker labelling** β€” separation β†’ stable `Speaker A/B` β†’ real names
110
- inferred from context (`--level 3`).
111
- - 🎬 **Video-aware** β€” samples keyframes for visual context (who's on screen, demos, slides).
112
- - ⚑ **Chunked + concurrent** β€” long files are split with overlap and stitched back with
113
- **ownership-partition** dedup (no double-printed sentences at chunk seams).
114
- - ♻️ **Resumable & stoppable** β€” every stage caches to disk (in the **OS temp dir** by default;
115
- the path is printed each run, and `-i <dir>` keeps it wherever you like). Re-runs skip finished
116
- work, Ctrl-C leaves partials. The cache is keyed on the input **and** the config, so changing
117
- `--model` never serves you a stale transcript.
118
- - πŸ”€ **Pluggable providers** β€” Gemini for the LLM; AssemblyAI _or_ Groq Whisper for timing.
119
- - 🌐 **Runs in the browser** β€” a pure, node-free core + `fetch` providers + ffmpeg.wasm.
120
- - πŸ”Ž **Fully inspectable** β€” every LLM prompt+response is logged to `llm-calls.jsonl`; all
121
- intermediates are plain JSON.
122
-
123
- ## Usage
124
-
125
- ### CLI
171
+ - waits for files to finish copying before starting (size-stability check)
172
+ - never reprocesses a finished file, across restarts β€” killed jobs resume from cache
173
+ - OS notification when each transcript lands
174
+ - `--jobs N` to run several at once, `--no-backlog` to skip what's already there
175
+
176
+ ## Costs you can see
177
+
178
+ An honest tool tells you what it's about to spend:
179
+
180
+ - **estimate before any paid call** β€” duration-based, per provider, printed up front
181
+ - **itemized receipt after** β€” real token counts, per model, embedded in the JSON metadata too
182
+ - **lifetime accounting** β€” `offmute-v2 stats` shows hours processed, characters produced, and
183
+ cost by model, accumulated in `~/.offmute`
184
+
185
+ Typical numbers: a 30-minute meeting on the default (best) model runs β‰ˆ **$0.30–0.45**;
186
+ `--model gemini-3.5-flash` cuts that ~4Γ— with quality that holds up remarkably well.
187
+
188
+ ## Fix a name in two seconds
189
+
190
+ The models only have the audio β€” if nobody says their own name, you'll get an honest
191
+ `Speaker A`. Fixing it doesn't cost a re-run:
126
192
 
127
193
  ```bash
128
- npx offmute-v2 <input> [options]
194
+ offmute-v2 rename meeting.mp4 "Speaker A=Priya" "Speaker B=Jay"
129
195
  ```
130
196
 
131
- | Option | Default | Description |
132
- | --------------------------- | ------------------ | ------------------------------------------------------------------------------------- |
133
- | `-o, --output <dir>` | _next to input_ | where to write the transcript(s); default is the input file's own folder |
134
- | `--instructions <text>` | – | guide diarization / labelling, e.g. `"host is Alice; group callers as 'Caller'"` |
135
- | `--model <name>` | `gemini-3.1-pro-preview` | multimodal LLM; use `gemini-2.5-flash` / `gemini-flash-latest` for faster/cheaper runs |
136
- | `--level <1\|2\|3>` | `2` | 1 = separation Β· 2 = stable anon Β· 3 = identify names |
137
- | `--timestamped <p>` | `assemblyai` | timing provider: `assemblyai` Β· `whisper-groq` Β· `none` |
138
- | `--reasoner <name>` | `deepseek-chat` | text model for the name-identification pass (level 3) |
139
- | `--chunk-seconds <n>` | `600` | chunk length Β· `--overlap-seconds` (default `60`) |
140
- | `--formats <list>` | `md` | which outputs to write (`srt`, `md`, `json`) |
141
- | `--passes <list>` | all | run/resume a subset of stages |
142
- | `--force` | – | ignore caches and recompute |
143
- | `--only-chunk <n>` | – | process a single chunk (debugging) |
144
- | `-i, --intermediates <dir>` | auto | cache dir (auto-derived per input) |
197
+ It finds the run's cache, applies the names, regenerates the outputs, and remembers the fix for
198
+ future re-runs. Or tell it who was in the room up front: `--speakers "Priya,Jay"` β€” if one known
199
+ name is left over and one voice unnamed, they bind by elimination.
200
+
201
+ ## CLI reference
145
202
 
146
203
  ```bash
147
- npx offmute-v2 meeting.mp4 --level 3 # name the speakers
148
- npx offmute-v2 meeting.mp4 --model gemini-2.5-pro # higher quality
149
- npx offmute-v2 talk.mov --timestamped whisper-groq # free/fast timing, no AssemblyAI
150
- npx offmute-v2 meeting.mp4 --passes align,consistency,finalize # resume from cache
204
+ offmute-v2 <input> [options] # transcribe (default command)
151
205
  ```
152
206
 
153
- ### Library
207
+ | option | default | |
208
+ | --------------------------------------- | ------------------------ | --------------------------------------------------------------- | --- | ------------------------------------------------------------ |
209
+ | `-o, --output <dir>` | next to input | where transcripts land |
210
+ | `--formats <list>` | `md` | any of `md,srt,txt,html,json` |
211
+ | `--summary` | off | also write TL;DR / decisions / action items |
212
+ | `--instructions <text>` | – | guide the ear: _"the host is Alice; spell it Xiao, not Shao"_ |
213
+ | `--speakers <names>` | – | who was in the room (helps naming; comma-separated) |
214
+ | `--model <name>` | `gemini-3.1-pro-preview` | `gemini-3.5-flash` for ~4Γ— cheaper/faster |
215
+ | `--timestamped <p>` | `assemblyai` | `elevenlabs` (Scribe v2) Β· `whisper-groq` (free) Β· `none` |
216
+ | `--reasoner <name>` | `deepseek-chat` | naming/summary model β€” DeepSeek, Gemini, GLM, Kimi, GPT, Claude |
217
+ | `--level <1 | 2 | 3>` | `3` | 1 separation Β· 2 anonymous-consistent Β· 3 **verified names** |
218
+ | `--identify <mode>` | `dual` | two reasoners + adjudication Β· `single` |
219
+ | `--md-style <s>` | `merged` | merged paragraphs Β· `turns` for one block per turn |
220
+ | `--chunk-seconds` / `--overlap-seconds` | `600` / `60` | chunking |
221
+ | `--force` | – | ignore caches and recompute |
222
+ | `-i <dir>` | OS temp, per input | cache location (printed each run) |
223
+
224
+ ```bash
225
+ offmute-v2 watch <dir> # daemon: transcribe files as they appear
226
+ offmute-v2 rename <file> "Old=New" # retcon speaker names from the run cache
227
+ offmute-v2 models # what each role can use + what your keys unlock
228
+ offmute-v2 doctor # ffmpeg + keys + live API health check
229
+ offmute-v2 stats # lifetime hours, characters, cost by model
230
+ ```
154
231
 
155
- The primary line takes a single options object. Only `input` is required β€” `outputDir` defaults to
156
- the input file's folder and `formats` defaults to `["md"]`:
232
+ ## Library
157
233
 
158
234
  ```ts
159
235
  import { transcribe } from "offmute-v2";
160
236
 
161
237
  const { segments, speakers, metadata } = await transcribe({
162
238
  input: "meeting.mp4",
163
- // outputDir: "./out", // optional β€” defaults next to the input
164
- model: "gemini-flash-latest",
165
- level: 3,
239
+ formats: ["md", "json"],
166
240
  instructions: "Three-person panel; label by name.",
167
- formats: ["srt", "md", "json"], // optional β€” defaults to ["md"]
168
- apiKeys: { gemini: "...", assemblyai: "..." }, // optional; falls back to env
241
+ apiKeys: { gemini: "...", assemblyai: "..." }, // optional β€” falls back to env
169
242
  });
170
243
 
171
- console.log(segments[0]); // { start, end, speaker, text, tone, timingSource, ... }
244
+ console.log(segments[0]);
245
+ // { start: 0.16, end: 4.2, speaker: "Speaker A", speakerName: "Hanjun Kim",
246
+ // text: "...", tone: ["laughing"], confidence: 0.97, words: [...] }
247
+ console.log(metadata.cost); // { estimatedUsd, actualUsd, lines, ... }
172
248
  ```
173
249
 
174
- Individual stages (`alignSegments`, `assignGlobalSpeakers`, `finalizeSegments`, formatters, …) are
175
- exported too, so you can build your own pipeline.
176
-
177
- ### Browser
178
-
179
- The fusion core (align / consistency / identify / finalize / format) is pure TypeScript with **zero
180
- node-only imports**, so it bundles tiny and runs in the browser via `offmute-v2/browser` β€” using
181
- `fetch`-based providers and `ffmpeg.wasm` for in-browser audio extraction. See
182
- [`docs/`](#receipts--how-this-repo-was-built) / the browser example for the integration seam.
183
-
184
- ## How it works
185
-
186
- A multi-stage pipeline where each stage persists a JSON intermediate (so it's resumable and
187
- debuggable):
188
-
189
- 1. **preprocess** β€” ffmpeg β†’ compact mono 16 kHz **mp3** + scene-aware keyframes (a 9.6 GB `.mov`
190
- becomes a few MB of audio in seconds β€” transparent for speech, but a fraction of lossless size).
191
- 2. **describe** β€” a quick multimodal pass builds a meeting summary + speaker roster to prime
192
- transcription.
193
- 3. **llm-transcribe** β€” each chunk goes to the LLM for verbatim text, diarization, and tone. Output
194
- is plain text with coarse `mm:ss` markers, parsed leniently (truncated text degrades gracefully
195
- where truncated JSON would be unrecoverable β€” a lesson from [ipgu](#credits)).
196
- 4. **timestamped** β€” the whole file goes to ASR for word-level timing + a speaker backbone.
197
- 5. **align** β€” the heart: the LLM's token stream is aligned against the ASR word stream with a
198
- Needleman–Wunsch edit-distance DP, transferring accurate word times onto the richer LLM text.
199
- 6. **gap-fill** β€” anywhere ASR heard speech that no LLM segment covers, an ASR fallback is inserted
200
- so nothing is dropped.
201
- 7. **consistency** β€” the ASR voice clusters act as a global backbone, merging the LLM's per-chunk
202
- labels into stable speakers (and fixing ASR over-splits).
203
- 8. **identify** _(level 3)_ β€” a reasoning model maps `Speaker A` β†’ real names using context + a
204
- voice-cluster hint.
205
- 9. **finalize** β€” overlap fixes, clamping, readable subtitle-sized blocks, and SRT/MD/JSON.
206
-
207
- > [!NOTE]
208
- > The hard parts of this problem are **chunk overlap** and **alignment**. offmute-v2 partitions
209
- > overlap by _ownership_ (each word is emitted by exactly one chunk) so sentences are never
210
- > double-printed at seams, and aligns the _whole_ chunk in one DP pass so common words like "it"
211
- > can't mis-match to a later occurrence.
212
-
213
- ## Built twice, in the open: GLM vs Opus
214
-
215
- This repo is also an **agent-vs-agent experiment**. offmute-v2 was built **twice, from one identical
216
- prompt**, by two different models running in **Claude Code** β€” a head-to-head on a hard,
217
- AI-resistant build (fusing the ideas of [offmute], [meeting-diary], and [ipgu] into one
218
- timestamp-accurate diarizer):
219
-
220
- | Branch | Built by | npm tag | What it is |
221
- | ----------------------------- | ---------------------------- | ------------------- | ---------------------------------------------- |
222
- | [`master`](../../tree/master) | GLM line + post-launch fixes | `offmute-v2@latest` | the daily-driven, hardened build (this README) |
223
- | [`glm`](../../tree/glm) | **GLM-5.2** | `offmute-v2@glm` | the frozen GLM experiment build |
224
- | [`opus`](../../tree/opus) | **Claude Opus 4.8** | `offmute-v2@opus` | the frozen Opus experiment build |
250
+ Every pipeline stage (`alignSegments`, `assignGlobalSpeakers`, `identifySpeakersV2`, the
251
+ formatters) is exported individually β€” bring your own pipeline if you like. A browser build of
252
+ the pure fusion core ships as `offmute-v2/browser` (fetch providers + optional ffmpeg.wasm).
225
253
 
226
- ```bash
227
- npx offmute-v2@glm meeting.mp4 # the GLM build, exactly as submitted
228
- npx offmute-v2@opus meeting.mp4 # the Opus build, exactly as submitted
229
- ```
254
+ ## What can go wrong (honestly)
230
255
 
231
- The `glm` and `opus` branches have **independent histories** β€” each is the full, unedited commit
232
- trail of that model's build, every review round, and every fix. The headline finding (spoiler):
233
- once a chunk-overlap dedup bug is accounted for, the two are a near dead-heat on accuracy, and the
234
- differences are in code conventions, error DX, and packaging. The full analysis is in the article.
256
+ - **Two similar voices, nobody says a name** β†’ you get correct turn-taking with `Speaker A/B`
257
+ labels, not a confident wrong guess. That's by design; `rename` or `--speakers` closes the gap.
258
+ - **Heard names get spelled by ear** β€” "Hanjun" may render as "Hanjin" between runs. The
259
+ recording's filename and your `--instructions` both feed the namer; `rename` fixes stragglers.
260
+ - **Network blips** β†’ every upload retries with backoff for ~90s; if a run still dies, re-running
261
+ resumes from cache and re-pays nothing that finished.
262
+ - **It costs money** β€” roughly a dollar an hour of audio on the best models, a quarter of that on
263
+ flash. The estimate prints before anything is spent.
235
264
 
236
- ## Receipts & how this repo was built
265
+ ## Requirements
237
266
 
238
- Everything is open for inspection:
267
+ - **Node β‰₯ 20** and **ffmpeg** in PATH (`brew install ffmpeg` / `apt install ffmpeg`)
268
+ - `GEMINI_API_KEY` (or `GOOGLE_API_KEY`) β€” required, the ears
269
+ - One clock, strongly recommended: `ASSEMBLYAI_API_KEY` (default) Β· `ELEVENLABS_API_KEY`
270
+ (Scribe v2 β€” the sharpest diarization we've tested) Β· `GROQ_API_KEY` (free whisper timing)
271
+ - Nice-to-have: `DEEPSEEK_API_KEY` β€” makes speaker naming cost ~$0.003 a run
239
272
 
240
- - **Per-branch review trails** (on [`glm`](../../tree/glm/docs) / [`opus`](../../tree/opus/docs)):
241
- `docs/spec.md`, `docs/review-1/`, `docs/review-2/` (run-throughs, code reads, an independent
242
- review, and each model's diagnosed fixes), and the append-only `intermediates/process_log_*.md`
243
- dev journals.
244
- - **Releasing & npm tags:** [`RELEASING.md`](RELEASING.md) β€” published via GitHub Actions **npm
245
- Trusted Publishing (OIDC)**, no tokens, with provenance.
273
+ Keys can also be injected via the library API instead of the environment. Run
274
+ `offmute-v2 doctor` to see where you stand.
246
275
 
247
- ## Diarization levels
276
+ ## The story
248
277
 
249
- 1. **Separation** β€” who speaks when.
250
- 2. **Anonymous-consistent** β€” `Speaker A/B`, stable across the whole file _(default)_.
251
- 3. **Identification** β€” real names inferred from context (needs `DEEPSEEK_API_KEY`, or point
252
- `--reasoner` at another provider). Use `--instructions` to steer (e.g. _"everyone except the
253
- host is 'Audience'"_).
278
+ This repo is an experiment receipt as much as a tool. The same brief β€” fuse
279
+ [offmute](https://github.com/southbridgeai/offmute)'s LLM diarization,
280
+ [meeting-diary](https://github.com/hrishioa/meeting-diary)'s ASR timing, and
281
+ [ipgu](https://github.com/hrishioa/ipgu)'s alignment discipline β€” was given independently to two
282
+ frontier models working autonomously. Both built the whole thing; both landed on the same
283
+ architecture; the differences live in the seams. Their unedited process logs, self-reviews, and
284
+ my manual reviews are preserved on the
285
+ `[glm](https://github.com/SouthBridgeAI/offmute-v2/tree/glm)` and
286
+ `[opus](https://github.com/SouthBridgeAI/offmute-v2/tree/opus)` branches, published as
287
+ `offmute-v2@glm` and `offmute-v2@opus`. A third line β€” this one,
288
+ `offmute-v2@fable`, now the primary β€” took everything both learned and kept going.
254
289
 
255
- ## Requirements
256
-
257
- - **Node β‰₯ 20** and **`ffmpeg`/`ffprobe`** on `PATH` (CLI / library). The browser build uses
258
- ffmpeg.wasm instead.
259
- - **API keys** (from env or the `apiKeys` option):
260
- - `GEMINI_API_KEY` (or `GOOGLE_API_KEY`) β€” required.
261
- - `ASSEMBLYAI_API_KEY` β€” required for timing (or use `--timestamped whisper-groq` + `GROQ_API_KEY`).
262
- - `DEEPSEEK_API_KEY` β€” optional, for `--level 3` name identification.
290
+ Full write-up: **["The frontier is open-source today"](https://southbridge.ai/blog/offmute-v2-glm-vs-opus)**.
263
291
 
264
292
  ## Development
265
293
 
266
294
  ```bash
267
- git clone https://github.com/SouthBridgeAI/offmute-v2.git
268
- cd offmute-v2 # master = the primary build
269
- npm ci
270
- npm run typecheck && npm run lint && npm test
271
- npm run build # tsup β†’ dist/ (node + browser bundles)
272
- npm run dev -- meeting.mp4 # run from source
295
+ git clone https://github.com/SouthBridgeAI/offmute-v2 && cd offmute-v2
296
+ npm install
297
+ npm test # vitest
298
+ npm run typecheck # strict tsc
299
+ npm run dev -- path/to/file.mp4
273
300
  ```
274
301
 
275
- To compare against the experiment builds, check out the [`glm`](../../tree/glm) or
276
- [`opus`](../../tree/opus) branch (the Opus build uses Bun: `bun install && bun run build`).
277
-
278
- ## Credits
279
-
280
- Built on three predecessors, with their hard-won lessons carried forward:
302
+ Releases ship via npm Trusted Publishing β€” see
303
+ [RELEASING.md](https://github.com/SouthBridgeAI/offmute-v2/blob/fable/RELEASING.md) for the
304
+ branch/dist-tag map.
281
305
 
282
- - **[offmute]** — multimodal describe→transcribe, diarization, tone.
283
- - **[meeting-diary]** β€” ASR word-timestamps + speaker diarization.
284
- - **[ipgu]** β€” chunk/merge discipline and structured extraction from LLM output.
285
-
286
- Created by [Southbridge](https://southbridge.ai). Thanks to the model teams β€” including
287
- [z.ai](https://z.ai) for GLM-5.2 and Anthropic for Claude Opus.
306
+ ---
288
307
 
289
- **License:** Apache-2.0.
308
+ Built by [Southbridge](https://southbridge.ai) Β· created by [Hrishi Olickel](https://twitter.com/hrishioa)
290
309
 
291
- [offmute]: https://github.com/southbridgeai/offmute
292
- [meeting-diary]: https://github.com/southbridgeai/meeting-diary
293
- [ipgu]: https://github.com/hrishioa/ipgu
310
+ If offmute-v2 saved you an afternoon of "who said that?", **[a star](https://github.com/SouthBridgeAI/offmute-v2)** keeps the frog listening. 🐸