offmute-v2 0.0.1-opus.0 β†’ 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 CHANGED
@@ -1,120 +1,96 @@
1
- # offmute-v2 πŸŽ™οΈβ±οΈ
1
+ # offmute-v2
2
2
 
3
- **Timestamp-correct, diarized meeting transcription.** Point it at a video or audio file and get back a transcript where every speaker turn is on the right millisecond, labelled with the speaker's name (when it can be inferred) and tone β€” as **SRT**, **Markdown**, or **JSON**.
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.
4
7
 
5
- It's the successor to [offmute](https://github.com/southbridgeai/offmute): great diarized transcripts, but now with real timestamps.
8
+ > πŸ“ **Full write-up:** _"offmute-v2: GLM vs Opus"_ β€” **coming soon** at
9
+ > http://southbridge.ai/blog/offmute-v2-glm-vs-opus
6
10
 
7
- ```bash
8
- export GEMINI_API_KEY=... # multimodal understanding
9
- export ASSEMBLYAI_API_KEY=... # word-level timing
10
- npx offmute-v2 meeting.mp4 -i "Two founders chatting; label them by name."
11
- # β†’ meeting.srt meeting.md meeting.json
12
- ```
11
+ ---
13
12
 
14
- ## Why it's accurate
13
+ ## This repo is an agent-vs-agent experiment
15
14
 
16
- No single model is good at everything, so offmute-v2 uses each for what it's best at and **fuses** them:
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):
17
18
 
18
- | Job | Tool | Why |
19
- |-----|------|-----|
20
- | **WHEN** β€” word-level timestamps | ASR (AssemblyAI) | sub-second accurate; LLM timestamps drift minutes over a long file |
21
- | **WHO / HOW** β€” names, tone, hard audio | multimodal LLM (Gemini) | infers names from context, hears tone, handles crowds/interruptions; raw ASR diarization can't |
22
- | **fuse** | token alignment | maps the LLM's words onto the ASR's timestamps |
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
- The LLM writes the transcript and decides who's talking; the ASR supplies the clock; an alignment pass marries them. (Details in [`docs/SPEC.md`](docs/SPEC.md).)
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).
25
27
 
26
- ### Measured on a 32-minute talk (founder presentation + audience Q&A)
28
+ ## The receipts (per branch, in `docs/`)
27
29
 
28
- Against a hand-checked reference transcript:
30
+ Each build branch carries its own review trail:
29
31
 
30
- - **Word error rate: 8.1%**
31
- - **Speaker attribution: 98.8%** (word-level)
32
- - **Turn-boundary timing: 0.04s median, 0.43s p90** error
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
33
38
 
34
- In a few places it diarizes *better* than the hand-checked reference (e.g. splitting an audience question from the speaker's answer where the reference merged them).
39
+ Browse them on [`glm`](../../tree/glm/docs) and [`opus`](../../tree/opus/docs).
35
40
 
36
- ## CLI
41
+ ## Quick start
37
42
 
38
43
  ```bash
39
- npx offmute-v2 <input> [options]
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
40
52
  ```
41
53
 
42
- | Option | Default | Description |
43
- |--------|---------|-------------|
44
- | `-i, --instructions <text>` | – | guide speaker labelling/focus, e.g. "host is Alice; group callers as 'Caller'" |
45
- | `-m, --model <model>` | `gemini-flash-latest` | LLM (e.g. `gemini-pro-latest` for max quality) |
46
- | `--asr <provider>` | `assemblyai` | `assemblyai` or `none` (LLM-only timing, less precise) |
47
- | `--no-video` | – | ignore the video track (audio only) |
48
- | `--keyframes <n>` | `8` | video frames sampled for visual context |
49
- | `--no-sub-segment` | – | keep whole speaker turns instead of subtitle-sized cues |
50
- | `--no-identify` | – | skip the speaker name-resolution pass |
51
- | `--thinking-level <lvl>` | `MINIMAL` | `MINIMAL\|LOW\|MEDIUM\|HIGH` (MINIMAL is best for transcription) |
52
- | `-o, --out <dir>` | `.` | where to write outputs |
53
- | `-f, --format <fmt>` | `all` | `srt \| md \| json \| all` |
54
- | `--intermediates-dir <dir>` | `.offmute_<name>` | cache dir (resumable) |
55
- | `--no-cache` | – | ignore cached intermediates |
56
-
57
- Intermediates (extracted audio, ASR JSON, raw LLM output, keyframes) are saved and reused, so re-runs are cheap and interrupted runs resume.
58
-
59
- ## Library
54
+ As a library (this `master`/GLM line takes a single options object β€” `input` and `outputDir`
55
+ are required):
60
56
 
61
57
  ```ts
62
- import { transcribe, toSRT, toMarkdown } from "offmute-v2";
63
-
64
- const { transcript, srt, markdown } = await transcribe("meeting.mp4", {
65
- instructions: "Panel of three; label by name.",
66
- llmModel: "gemini-flash-latest",
67
- onProgress: (e) => console.log(e.stage, e.message),
58
+ import { transcribe } from "offmute-v2";
59
+
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
68
66
  });
69
-
70
- console.log(transcript.speakers); // [{ id, label, named, description }]
71
- console.log(transcript.segments[0]); // { start, end, speakerId, text, tone, ... }
72
67
  ```
73
68
 
74
- Long files (>35 min) are automatically chunked with overlap and stitched back together; the whole-file ASR voice clusters keep speaker identity consistent across chunks.
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.
75
73
 
76
- **More options:** `signal: AbortSignal` to cancel (cooperatively, at stage/chunk boundaries); `onLlmCall(rec)` to observe every LLM call (`{label, promptText, responseText, usage}`); `knownSpeakers`, `subSegment`, `identifySpeakers`, `asr: "none"`. Every LLM call (prompt + response) and the raw→parsed diarization are also written to `intermediates/<name>/llm/` and `diarize.parsed.json` for inspection.
74
+ ## Build from source
77
75
 
78
- ## Browser
79
-
80
- Runs **entirely in the browser** (`offmute-v2/browser`, ~50KB, zero deps): decode with
81
- ffmpeg.wasm, call the providers over `fetch`, fuse with the pure core. You hand it a
82
- loaded `@ffmpeg/ffmpeg` instance and your keys β€” one call does the rest (chunking and
83
- all):
76
+ ```bash
77
+ git clone https://github.com/SouthBridgeAI/offmute-v2.git
78
+ cd offmute-v2 && git checkout glm # or: opus
84
79
 
85
- ```ts
86
- import { FFmpeg } from "@ffmpeg/ffmpeg";
87
- import { transcribeInBrowser } from "offmute-v2/browser";
88
-
89
- const ffmpeg = new FFmpeg();
90
- await ffmpeg.load();
91
-
92
- const { srt, markdown, transcript } = await transcribeInBrowser(file /* File/Blob */, {
93
- ffmpeg,
94
- apiKeys: { gemini: GEMINI_KEY, assemblyai: ASSEMBLYAI_KEY }, // injected by the host
95
- instructions: "Host is Alice; label callers as 'Caller'.",
96
- useVideo: true,
97
- onProgress: (e) => console.log(e.stage, e.message),
98
- });
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)
99
83
  ```
100
84
 
101
- A runnable demo is in [`examples/browser/index.html`](examples/browser/index.html) (loads
102
- ffmpeg.wasm from a CDN). Lower-level pieces (`GeminiFetchClient`, `transcribeWithAssemblyAIFetch`,
103
- `extractAudioWasm`, and the pure `assembleTranscript`) are exported too β€” see
104
- [`docs/BROWSER.md`](docs/BROWSER.md). The fetch providers are isomorphic, so they work in
105
- Node 18+ as well.
106
-
107
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.
108
89
 
109
- - Node β‰₯ 18 and `ffmpeg`/`ffprobe` on PATH (CLI / Node library).
110
- - API keys from env or injected (`apiKeys` option): `GEMINI_API_KEY` (or `GOOGLE_API_KEY`), `ASSEMBLYAI_API_KEY`.
111
-
112
- ## Diarization levels
113
-
114
- 1. **Separation** β€” who speaks when. 2. **Anonymous-consistent** β€” Speaker A/B, stable throughout. 3. **Identification** β€” real names from context. offmute-v2 targets **3**, with instruction-driven grouping (e.g. "everyone except the host is 'Audience'").
115
-
116
- ## Credits
117
-
118
- Builds on three predecessors: **offmute** (multimodal describe→transcribe, tone), **ipgu** (chunk/merge discipline, timestamp validation), **meeting-diary** (ASR word-timestamps + diarization). Created by [Southbridge](https://southbridge.ai).
90
+ ## License
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.
119
93
 
120
- License: Apache-2.0.
94
+ [offmute]: https://github.com/southbridgeai/offmute
95
+ [meeting-diary]: https://github.com/southbridgeai/meeting-diary
96
+ [ipgu]: https://github.com/hrishioa/ipgu