-
Notifications
You must be signed in to change notification settings - Fork 73
QVAC-17876 feat[bc]: migrate SDK parakeet transcription to 0.6.0 GGML #2184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ishanvohra2
merged 15 commits into
tetherto:main
from
ishanvohra2:feat/parakeet-ggml-sdk
May 23, 2026
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0210a01
feat[bc]: migrate SDK parakeet transcription to 0.6.0 GGML
f78dfcb
Merge branch 'main' into feat/parakeet-ggml-sdk
ishanvohra2 25ab4a7
doc: standardize parakeet transcription example headers
c8d146e
fix: address PR review β restore API docs, legacy endOfTurn wire
1debf0f
fix: stabilize parakeet-stream-iterator-throw on iOS e2e
dbb84cb
Merge branch 'main' into feat/parakeet-ggml-sdk
ishanvohra2 51301e1
feat[api]: wire Sortformer v2.1 streaming example and model constant
3856836
Merge branch 'main' into feat/parakeet-ggml-sdk
ishanvohra2 1b29789
feat[api]: adopt Sortformer v2.1 registry models in SDK
932105f
Merge branch 'main' into feat/parakeet-ggml-sdk
ishanvohra2 bf2687e
chore: remove manual parakeet entry from 0.11.0 breaking changelog
eedeafe
Merge branch 'main' into feat/parakeet-ggml-sdk
ishanvohra2 44f7d9a
fix unit test
6a54cd2
Merge branch 'main' into feat/parakeet-ggml-sdk
ishanvohra2 7bc9ed9
Merge branch 'main' into feat/parakeet-ggml-sdk
ishanvohra2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
packages/sdk/examples/transcription/parakeet-microphone-stream.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| /** | ||
| * Microphone β Parakeet duplex streaming (`transcribeStream`). | ||
| * | ||
| * Usage: | ||
| * bun run examples/transcription/parakeet-microphone-stream.ts | ||
| * | ||
| * Streams microphone audio through `transcribeStream` with | ||
| * `parakeetStreamingConfig`. Uses the EOU checkpoint so you may see | ||
| * `{ type: "endOfTurn", source: "parakeet" }` events; CTC/TDT models | ||
| * emit transcript text only. Parakeet does not yield standalone VAD events. | ||
| * | ||
| * Requirements: FFmpeg installed, microphone access. | ||
| */ | ||
| import { | ||
| loadModel, | ||
| unloadModel, | ||
| transcribeStream, | ||
| PARAKEET_EOU_120M_V1_Q8_0, | ||
| } from "@qvac/sdk"; | ||
| import { spawnSync } from "child_process"; | ||
| import { startMicrophone } from "../audio/mic-input"; | ||
|
|
||
| const SAMPLE_RATE = 16000; | ||
|
|
||
| try { | ||
| const r = spawnSync("ffmpeg", ["-version"], { stdio: "ignore" }); | ||
| if (r.error || r.status !== 0) throw new Error("FFmpeg not found"); | ||
| } catch { | ||
| console.error("Error: FFmpeg is required. Install it and try again."); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| let modelId: string | null = null; | ||
| let ffmpeg: ReturnType<typeof startMicrophone> | null = null; | ||
|
|
||
| async function cleanup() { | ||
| console.log("\n\nStopping..."); | ||
| ffmpeg?.kill(); | ||
| if (modelId) await unloadModel({ modelId }); | ||
| console.log("Done."); | ||
| } | ||
|
|
||
| process.on("SIGINT", () => { | ||
| void cleanup().finally(() => process.exit(0)); | ||
| }); | ||
| process.on("SIGTERM", () => { | ||
| void cleanup().finally(() => process.exit(0)); | ||
| }); | ||
|
|
||
| try { | ||
| console.log("Loading Parakeet (EOU) streaming model..."); | ||
| modelId = await loadModel({ | ||
| modelSrc: PARAKEET_EOU_120M_V1_Q8_0, | ||
| modelType: "parakeet", | ||
| onProgress: (p) => console.log(`Download: ${p.percentage.toFixed(1)}%`), | ||
| }); | ||
| console.log("Model loaded.\n"); | ||
|
|
||
| ffmpeg = startMicrophone({ sampleRate: SAMPLE_RATE, format: "s16le" }); | ||
|
|
||
| const session = await transcribeStream({ | ||
| modelId, | ||
| parakeetStreamingConfig: { | ||
| chunkMs: 1000, | ||
| emitPartials: true, | ||
| }, | ||
| }); | ||
|
|
||
| ffmpeg.stdout.on("data", (chunk: Buffer) => session.write(chunk)); | ||
|
|
||
| console.log( | ||
| "Listening... speak and pause to see transcripts. End-of-turn boundaries fire when the EOU model emits an <EOU> token.\n", | ||
| ); | ||
|
|
||
| for await (const event of session) { | ||
| switch (event.type) { | ||
| case "text": | ||
| if (event.text.trim()) { | ||
| process.stdout.write(`${event.text}`); | ||
| } | ||
| break; | ||
| case "endOfTurn": | ||
| console.log("\n[endOfTurn] turn boundary detected\n"); | ||
| break; | ||
| } | ||
| } | ||
| await cleanup(); | ||
| process.exit(0); | ||
| } catch (error) { | ||
| console.error("Error:", error); | ||
| await cleanup(); | ||
| process.exit(1); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.