offmute-v2 0.0.1 → 0.0.2
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 +64 -135
- package/dist/browser.browser.js.map +1 -1
- package/dist/cli.cjs +84 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +84 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +78 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +78 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -7
package/README.md
CHANGED
|
@@ -1,167 +1,96 @@
|
|
|
1
1
|
# offmute-v2
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
**Timestamp-correct, diarized meeting transcription** — a video/audio file goes in; a
|
|
4
|
+
speaker-labelled, tone-annotated transcript with accurate timestamps comes out (SRT / Markdown /
|
|
5
|
+
JSON). It fuses a multimodal LLM (content, diarization, tone, speaker identity) with an ASR model
|
|
6
|
+
(word-level timing), aligned together. Runs as an npx CLI, a Node library, and in the browser.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
> 📝 **Full write-up:** _"offmute-v2: GLM vs Opus"_ — **coming soon** at
|
|
9
|
+
> http://southbridge.ai/blog/offmute-v2-glm-vs-opus
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
> (hypotheses, findings, gotchas) and `docs/spec.md` (design). Re-read when context compresses.
|
|
11
|
+
---
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## This repo is an agent-vs-agent experiment
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
offmute-v2 was built **twice, from a single identical prompt**, by two different models running in
|
|
16
|
+
**Claude Code** — as a head-to-head of how each does on a hard, AI-resistant build (combining the
|
|
17
|
+
ideas from [offmute], [meeting-diary], and [ipgu] into one timestamp-accurate diarizer):
|
|
15
18
|
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
| speaker accuracy | **94%** |
|
|
22
|
-
| alignment | 326/326 segments aligned to ASR word timing |
|
|
19
|
+
| Branch | Built by | npm | What it is |
|
|
20
|
+
|--------|----------|-----|------------|
|
|
21
|
+
| [`glm`](../../tree/glm) | **GLM-5.2** | `offmute-v2@latest` / `@glm` | the **primary**, daily-driven build |
|
|
22
|
+
| [`opus`](../../tree/opus) | **Claude Opus 4.8** | `offmute-v2@opus` | the comparison build, preserved with full history |
|
|
23
|
+
| `master` | — | — | this overview + the current primary (tracks `glm` for now; may diverge) |
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
the presenter into two speakers.
|
|
25
|
+
The two branches have **independent histories** — each is the full, unedited commit trail of that
|
|
26
|
+
model's build, including every review round and fix (so you can read exactly what happened).
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## The receipts (per branch, in `docs/`)
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Each build branch carries its own review trail:
|
|
31
31
|
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
32
|
+
- `docs/spec.md` — the plan & hypotheses
|
|
33
|
+
- `docs/review-1/` — first run-through review + the model's diagnosed fixes
|
|
34
|
+
- `docs/review-2/` — code-read + independent review + fixes
|
|
35
|
+
- `docs/comparison-response.md` (glm) / `docs/review-comparison-fixes.md` (opus) — each model's
|
|
36
|
+
response to the cross-model comparison
|
|
37
|
+
- `intermediates/process_log_*.md` — the model's append-only dev journal
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
preprocess → describe → llm-transcribe (per chunk) → timestamped (whole file)
|
|
39
|
-
↓
|
|
40
|
-
align (edit-distance: LLM text ↔ ASR word times)
|
|
41
|
-
↓
|
|
42
|
-
gap-fill (recover dropped content from ASR)
|
|
43
|
-
↓
|
|
44
|
-
consistency (merge ASR over-splits via LLM labels)
|
|
45
|
-
↓
|
|
46
|
-
identify (optional, DeepSeek: name speakers from content)
|
|
47
|
-
↓
|
|
48
|
-
finalize (dedup, overlap fix, clamp, format SRT/MD/JSON)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**The alignment** is the key idea (ts-aligner approach): align the whole chunk's LLM
|
|
52
|
-
token stream against the ASR word stream in one edit-distance DP pass, then split back
|
|
53
|
-
into segments — long ordered sequences pin common words unambiguously and transfer
|
|
54
|
-
accurate word timestamps onto the richer LLM text.
|
|
55
|
-
|
|
56
|
-
**Gap-fill** recovers content the LLM dropped: where ASR has speech in a time gap not
|
|
57
|
-
covered by any LLM segment (e.g. a dropped opening word), an ASR fallback segment is
|
|
58
|
-
inserted — so nothing the ASR heard is lost.
|
|
59
|
-
|
|
60
|
-
**Timestamped providers**: AssemblyAI Universal-2 (default — diarization + word
|
|
61
|
-
timestamps) or Groq Whisper (`--timestamped whisper-groq` — free/fast word timestamps,
|
|
62
|
-
no diarization; consistency then groups by LLM label).
|
|
63
|
-
|
|
64
|
-
## Diarization levels (selectable via `--level`)
|
|
39
|
+
Browse them on [`glm`](../../tree/glm/docs) and [`opus`](../../tree/opus/docs).
|
|
65
40
|
|
|
66
|
-
|
|
67
|
-
2. **Anonymous-but-consistent** — Speaker A/B throughout (ASR speakers merged by LLM label; default).
|
|
68
|
-
3. **Identification** — named speakers via content cues (DeepSeek).
|
|
41
|
+
## Quick start
|
|
69
42
|
|
|
70
|
-
## Usage
|
|
71
|
-
|
|
72
|
-
### npx CLI
|
|
73
43
|
```bash
|
|
74
|
-
export GEMINI_API_KEY=... # multimodal transcription
|
|
75
|
-
export ASSEMBLYAI_API_KEY=... #
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
npx offmute-v2 meeting.
|
|
79
|
-
|
|
80
|
-
npx offmute-v2
|
|
81
|
-
npx offmute-v2 meeting.
|
|
82
|
-
npx offmute-v2 meeting.mov --passes align,consistency,finalize # resume from intermediates
|
|
83
|
-
npx offmute-v2 meeting.mov --only-chunk 2 # debug one chunk
|
|
44
|
+
export GEMINI_API_KEY=... # multimodal transcription (or GOOGLE_API_KEY)
|
|
45
|
+
export ASSEMBLYAI_API_KEY=... # word-level timing
|
|
46
|
+
|
|
47
|
+
# primary (GLM) build:
|
|
48
|
+
npx offmute-v2@latest meeting.mp4
|
|
49
|
+
# explicitly pin a build:
|
|
50
|
+
npx offmute-v2@glm meeting.mp4
|
|
51
|
+
npx offmute-v2@opus meeting.mp4
|
|
84
52
|
```
|
|
85
53
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
`--instructions`, `--force`, `--only-chunk`, `--reasoner`.
|
|
54
|
+
As a library (this `master`/GLM line takes a single options object — `input` and `outputDir`
|
|
55
|
+
are required):
|
|
89
56
|
|
|
90
|
-
### Node library
|
|
91
57
|
```ts
|
|
92
58
|
import { transcribe } from "offmute-v2";
|
|
93
|
-
const result = await transcribe("meeting.mov", {
|
|
94
|
-
model: "gemini-2.5-flash",
|
|
95
|
-
level: 3,
|
|
96
|
-
instructions: "...",
|
|
97
|
-
apiKeys: { gemini: "...", assemblyai: "...", deepseek: "..." }, // injectable
|
|
98
|
-
formats: ["srt", "md", "json"],
|
|
99
|
-
});
|
|
100
|
-
// result.segments: Segment[], result.speakers: SpeakerInfo[]
|
|
101
|
-
```
|
|
102
59
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
model: "gemini-2.5-flash", level: 3, deepseekApiKey,
|
|
60
|
+
const { segments, speakers } = await transcribe({
|
|
61
|
+
input: "meeting.mp4",
|
|
62
|
+
outputDir: "./out",
|
|
63
|
+
model: "gemini-flash-latest", // or gemini-2.5-pro, gemini-3.1-pro-preview, …
|
|
64
|
+
formats: ["srt", "md", "json"],
|
|
65
|
+
// apiKeys: { gemini, assemblyai } // optional; falls back to env
|
|
110
66
|
});
|
|
111
67
|
```
|
|
112
|
-
The core (align/consistency/identify/finalize/format) is pure TS with no node deps and
|
|
113
|
-
bundles to ~35KB with zero node-only imports. The browser build uses fetch-based
|
|
114
|
-
providers (Gemini inline base64 + AssemblyAI REST). Best for audio ≤ ~20MB inline; for
|
|
115
|
-
longer files, chunk with ffmpeg.wasm and call the stages directly.
|
|
116
|
-
|
|
117
|
-
## Architecture
|
|
118
68
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
providers/ gemini (SDK), gemini-fetch + assemblyai-fetch (browser), openai-compat (DeepSeek/Groq)
|
|
124
|
-
transcribe/ llm transcription (prompt + JSON schema), describe (roster)
|
|
125
|
-
align/ normalize, edit-distance DP, aligner (flat-sequence alignment)
|
|
126
|
-
diarize/ consistency (merge by LLM label), identify (DeepSeek naming)
|
|
127
|
-
finalize/ dedup, overlap fix + clamp, format (SRT/MD/JSON with block-breaking)
|
|
128
|
-
eval/ scorer (WER, coverage, timing, speaker agreement vs reference)
|
|
129
|
-
utils/ time, srt, logger
|
|
130
|
-
scripts/ per-stage test scripts + eval
|
|
131
|
-
tests/ vitest unit tests (align, finalize)
|
|
132
|
-
```
|
|
69
|
+
Both branches publish the same `offmute-v2` CLI and library; they differ in pipeline internals (e.g.
|
|
70
|
+
GLM's ASR-backbone consistency + gap-fill, Opus's ownership-partition merge + voice-anchored
|
|
71
|
+
identify) and in the library call shape (the Opus build uses `transcribe(input, options)`). See each
|
|
72
|
+
branch's README and [`RELEASING.md`](RELEASING.md) for the `latest` / `glm` / `opus` npm tags.
|
|
133
73
|
|
|
134
|
-
|
|
135
|
-
whose output exists unless `--force`); the run is **stoppable** — results so far are
|
|
136
|
-
always on disk.
|
|
74
|
+
## Build from source
|
|
137
75
|
|
|
138
|
-
## Development
|
|
139
76
|
```bash
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
npm run dev # tsx src/cli.ts
|
|
143
|
-
npm run build # tsup → dist/ (node + browser bundles)
|
|
144
|
-
```
|
|
77
|
+
git clone https://github.com/SouthBridgeAI/offmute-v2.git
|
|
78
|
+
cd offmute-v2 && git checkout glm # or: opus
|
|
145
79
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
## Eval
|
|
151
|
-
```bash
|
|
152
|
-
npx tsx scripts/eval.ts path/to/output.json # score a run vs the reference SRT
|
|
80
|
+
# glm build (npm): npm ci && npm run build && npm test
|
|
81
|
+
# opus build (bun): bun install && bun run build && bun test
|
|
82
|
+
node dist/cli.js --help # (glm CLI entry is dist/cli.cjs)
|
|
153
83
|
```
|
|
154
84
|
|
|
155
|
-
##
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
|
|
159
|
-
- **Round 2** (code read + independent review): [`docs/review-2/human-review.md`](docs/review-2/human-review.md), [`docs/review-2/REVIEW.md`](docs/review-2/REVIEW.md), [`docs/review-2/REVIEWER_GUIDE.md`](docs/review-2/REVIEWER_GUIDE.md) → fixes in [`docs/review-2/review-fixes.md`](docs/review-2/review-fixes.md)
|
|
160
|
-
- **Response to the GLM-vs-Opus comparison:** [`docs/comparison-response.md`](docs/comparison-response.md)
|
|
161
|
-
- **Dev journal:** [`intermediates/process_log_thoughts_ideas_hypotheses_and_scratch_space.md`](intermediates/process_log_thoughts_ideas_hypotheses_and_scratch_space.md)
|
|
162
|
-
- **Releasing / npm tags:** [`RELEASING.md`](RELEASING.md)
|
|
163
|
-
|
|
164
|
-
The Opus-built variant lives on the [`opus`](../../tree/opus) branch; the experiment overview is on [`master`](../../tree/master).
|
|
85
|
+
## Requirements
|
|
86
|
+
- Node ≥ 20 and `ffmpeg`/`ffprobe` on PATH (CLI / library). Browser builds use ffmpeg.wasm.
|
|
87
|
+
- API keys from env or injected: `GEMINI_API_KEY` (or `GOOGLE_API_KEY`), `ASSEMBLYAI_API_KEY`;
|
|
88
|
+
optional `DEEPSEEK_API_KEY` / `GROQ_API_KEY` depending on the build/options.
|
|
165
89
|
|
|
166
90
|
## License
|
|
167
|
-
Apache-2.0.
|
|
91
|
+
Apache-2.0. Built on [offmute], [meeting-diary], and [ipgu]. Credit to the model teams — including
|
|
92
|
+
[z.ai](https://z.ai) for GLM-5.2.
|
|
93
|
+
|
|
94
|
+
[offmute]: https://github.com/southbridgeai/offmute
|
|
95
|
+
[meeting-diary]: https://github.com/southbridgeai/meeting-diary
|
|
96
|
+
[ipgu]: https://github.com/hrishioa/ipgu
|