Vocal Helper — async producer/consumer pipeline turning a live PCM stream into diarized, transcribed utterances and (optionally) a rolling LLM summary. Stages: Voice Activity Detection → online speaker diarization (Hungarian-style cosine clustering on backend embeddings) → STT (pywhispercpp turbo) → optional analyst (a local model served via Ollama or vLLM, resolved by best-engine-ai-helper from a committed brief).
pip install vocal-helper==3.3.2 Copy PIP instructions
Vocal Helper belongs to a collection of libraries called AI Helpers developed for building Artificial Intelligence.
Local-first by design. vocal-helper runs entirely on your machine. Three stages, all local:
Your audio and transcripts are never uploaded to a third-party service: no telemetry, no account, no cloud lock-in.
That matters more here than almost anywhere else in the suite. Your voice, and everyone else's on the recording, is among the most personal data there is, and a transcript is a verbatim record of what was said and by whom. Keeping both on your own hardware is what makes this tool safe to point at a real meeting, interview, or therapy session.
Part of the AI Helpers suite: sovereignty over your data through local-first Open Source.
Vocal Helper turns audio into diarized, transcribed utterances, with an optional rolling Large Language Model (LLM) summary of the conversation.
Internally it is a producer/consumer pipeline. Each processing step — detecting speech, identifying the speaker, transcribing, summarising — runs as its own worker, and each worker hands its output to the next one down a queue. Think of a bakery: the dough moves from the mixer to the oven to the cooling rack, every station working on a different batch at the same time instead of waiting idle for the whole order to finish.
Vocal Helper ships on PyPI under semantic-versioned tags (currently v3.3.0); continuous integration (CI, an automated pipeline that runs the test suite and the linter on every push) stays green on main before any tag goes out.
It sits at the top of the AI Helpers dependency graph — the suite's most feature-complete and heaviest package — and builds on five siblings:
Each of those five has to work correctly for a single transcript to come out right, which makes this package the suite's most demanding integration test in daily use.
Every edge is a bounded asyncio.Queue ; every stage is its own coroutine. Colours follow the AI Helpers palette.
PCM frames ]):::source --> V[VAD
Silero v5 ONNX ]:::vad --> D[Online Diar
TitaNet · cosine clustering ]:::diar --> A[STT
whisper.cpp turbo ]:::asr -.-> L[LLM analyst
best-engine model · rolling summary ]:::llm classDef source fill:#CCE4FF,stroke:#007AFF,stroke-width:2px,color:#0b3d91 classDef vad fill:#00ffef,stroke:#79dbdc,stroke-width:2px,color:#003b3c classDef diar fill:#EFDCF8,stroke:#AF52DE,stroke-width:2px,color:#4a1063 classDef asr fill:#FFEACC,stroke:#FF9500,stroke-width:2px,color:#5a3300 classDef llm fill:#D4F5D9,stroke:#28CD41,stroke-width:2px,color:#144d1e,stroke-dasharray: 5 5 The dashed edge marks the analyst as optional (llm=None disables it).
full PCM buffer ]):::source --> D[Offline Diar
whole-buffer ]:::diar --> A[STT
Diarization is the one stage with a real backend fork — several competing implementations, each better in some cases — and there is no single winner: the best backend depends on the scenario.
vocal_helper.router (voh.select_diarization) plays the role of an aiguilleur, French for the railway signalman who switches each train onto the right track before it arrives. It reads three things about the job:
It turns that measured trade-off into one explicit, tested decision, so neither the CLI nor your own code ever hard-codes a backend. And it reports both quality (DER) and speed (RTF) for the scenario, not just a name.
The numbers below were re-validated on-machine against ground truth — studies/router_profile_validation.py, pyannote.metrics at collar 0.25, median DER and RTF, over bagarre (30 short mixes) plus the AMI dev-slice, with sherpa from ADR 0002. Read them as: DER is quality (lower is better), RTF is speed (below 1 is faster than real time).
Two findings, both measured here: offline has a real length crossover (nemo short ↔ pyannote long), so it needs a router; online has none, since vocal-helper's streaming clusterer is a latency-bound approximation where nemo wins at every length, so streaming always routes to nemo. voh.select_diarization(live=…, duration_s=…, max_speakers=…, torch_free=…, pyannote_available=…) returns a BackendPlan(mode, backend, expected_der, expected_rtf, reason); the quality/speed numbers are first-class fields and the reason carries the citation, so a choice is never a black box.
import vocal_helper as voh plan = voh.select_diarization(live=False, duration_s=45.0, max_speakers=3) print(plan.backend, plan.expected_der, plan.expected_rtf) # nemo 0.142 0.051, short, ≤4 speakers print(voh.select_diarization(live=False, duration_s=1800.0).backend) # 'pyannote', long form The router is enforced, not advisory: --diar-backend defaults to auto on the CLI and on POST /pipeline, so a file's real duration is probed and routed (short → nemo, long → pyannote) without you choosing. Pass an explicit pyannote / nemo / sherpa to override.
More recipes? See EXAMPLES.md for a self-contained, copy-runnable cookbook of the common workflows (live mic, URL replay, offline batch, subscribers, library + CLI usage).
Running the heavy stack on a Graphics Processing Unit (GPU)? See TECHNICAL_STACK.md for the full install recipe : CUDA + PyTorch, whisper.cpp with GGML_CUDA=on, pyannote 3.1 on MPS/CUDA, local Ollama, expected RTFs per GPU, and a reproducible install manifest covering the AI Helpers suite (os-helper, audio-helper, podcast-helper, youtube-helper, vocal-helper, music-helper).
Prerequisites: Python 3.10–3.13 and git, ffmpeg, PortAudio, cross-platform:
We recommend using Python environments. Check this link if you're unfamiliar with setting one up: 🥸 Tech tips.
No compiler needed for the base install. The core (vocal-helper, no extras) pulls prebuilt wheels on every common platform: pywhispercpp ships wheels for macOS arm64, Linux x86_64/aarch64 and Windows (cp39–cp314), so nothing compiles. The heavy pieces are opt-in: the [nemo] extra brings ~5 GB of PyTorch, and offline diarization fetches a model bundle on first use (see Model weights below). Base install = library + CLIs + ASR/VAD + LLM analyst.
pip install 'vocal-helper[all]' From source (no PyPI) git clone https://github.com/warith-harchaoui/vocal-helper.git cd vocal-helper pip install -e ".[all]" The [all] extra brings the mic and stream sources, every diarization backend (NeMo, the default, plus pyannote and sherpa), and the language-ID cross-check. Pick à la carte if you don't need everything:
The LLM analyst ships in the base install, but it still needs an engine resolved once per machine before its serving backend is up. best-engine-ai-helper reads the committed vocal_helper/llm.brief.yaml, chooses the backend + model for your hardware (Ollama on macOS / CPU, vLLM on a discrete GPU), and writes a gitignored vocal_helper/llm.engine.yaml. voh.resolve_engine() does this on first use, or run it explicitly:
# From the vocal_helper package directory (holds llm.brief.yaml): best-engine-ai-helper resolve --brief llm.brief.yaml --out llm.engine.yaml # then start the resolved backend, e.g. on macOS: ollama serve # the engine file's `serve:` line names the exact `ollama pull …` Model weights: no HuggingFace needed All model weights ship in a single self-hosted diarization-engines bundle (offline pyannote 3.1, NeMo Sortformer, the online pyannote/embedding embedder, SpeechBrain VoxLingua107, and the torch-free sherpa ONNX, pyannote-3.0 segmentation + TitaNet). Point vocal-helper at it once and the whole stack runs HuggingFace-free: no token, no gated downloads, HF_HUB_OFFLINE=1 safe.
Configure it in settings.yaml (the only config the project needs):
cp settings.yaml.example settings.yaml # settings.yaml already contains: # engines: # diarization_url: https://deraison.ai/diarization-engines-slim.zip # settings.yaml is git-ignored. What the URL is https://deraison.ai/diarization-engines-slim.zip is a self-hosted ZIP (~800 MB) that mirrors every gated/hub-hosted model the pipeline needs, so the project never has to authenticate against HuggingFace. It contains:
On first use it is downloaded once, verified against manifest.json, and cached under ~/.cache/vocal-helper; later runs load straight from the cache. Set $VH_DIARIZATION_ENGINES to a local directory (or your own mirror URL) for air-gapped / self-hosted deploys. TitaNet (the default online-diar embedder) loads from NVIDIA NGC, also without HuggingFace.
Two commands for text, four for text with speakers. The first run of each path downloads the weights it needs and caches them, so only the first one is slow.
pip install 'vocal-helper[all]' # or plain `vocal-helper` for the light core vocal-helper transcribe clip.wav # text only: no VAD, no diarization, no config cp settings.yaml.example settings.yaml # carries the diarization-engines URL vocal-helper file meeting.wav --no-real-time # + speakers; the router picks the backend transcribe is the short path because it skips the pipeline entirely. The four recipes below are the real surface: a live microphone, the Python API, a file through the streaming pipeline, and a file through the offline one.
# No token, no HuggingFace: weights come from the diarization-engines bundle. vocal-helper mic --llm Python API import asyncio import vocal_helper as voh async def main(): pipeline = voh.Pipeline( source=lambda: voh.sources.from_microphone(), config=voh.PipelineConfig( diar={"backend": "pyannote"}, asr={"model": "large-v3-turbo-q5_0", "language": "auto"}, # discovered from the audio llm={"engine": voh.resolve_engine()}, # remove to disable ), ) async for ev in pipeline.run(): if "text" in ev: print(f"[{ev['t0']:.1f} {ev['speaker']}] {ev['text']}") elif "summary" in ev: print(f"--- rolling summary ---\n{ev['summary']}") asyncio.run(main()) Replay a WAV through the online pipeline vocal-helper file path/to/conversation.wav --llm The file source preserves real-time pacing by default ; pass --no-real-time for as-fast-as-possible batch processing.
import asyncio, vocal_helper as voh async def main(): pipeline = voh.OfflinePipeline( source=lambda: voh.sources.from_wav_file("meeting.wav", real_time=False), config=voh.OfflinePipelineConfig( diar={"backend": "pyannote"}, # or "nemo" for ≤ 60 s clips asr={"language": "auto"}, # discovered from the audio, no default llm={"engine": voh.resolve_engine()}, # remove to disable ), ) async for ev in pipeline.run(): if "text" in ev: print(f"[{ev['t0']:.1f} {ev['speaker']}] {ev['text']}") elif "summary" in ev: print(f"--- digest ---\n{ev['summary']}") asyncio.run(main()) When to use which, and the router picks the backend for you:
vocal-helper is a toolbox, not an app. It exposes the same local pipeline through coherent surfaces so it composes into your own project without re-implementing the wiring. Everything runs locally: no surface sends audio to a remote service.
# language is discovered by default ('auto'), pass --language xx only to force one vocal-helper transcribe clip.wav vocal-helper file meeting.wav --offline --llm # local HTTP surface + transcript-viewer GUI (open http://127.0.0.1:8000/gui) uvicorn vocal_helper.api:app --host 127.0.0.1 --port 8000 & curl -F 'file=@clip.wav' http://localhost:8000/transcribe # language auto-discovered curl -F 'url=https://youtu.be/…' http://localhost:8000/pipeline # URL fetched locally ([stream]) # MCP surface: the same local app, exposed as agent tools vocal-helper-mcp The transcript-viewer GUI (GET /gui) A self-contained single page (HTML + Tailwind CDN + vanilla JS, no build step) served same-origin by the API. Drop an audio file or paste a URL, run diarized transcription locally, and read a speaker-labelled, colour-coded transcript (one stable colour per speaker) alongside the rolling summary. It POSTs to the same /pipeline endpoint (zero extra server logic) and contacts only the local server, so your audio never leaves the machine. Utterances reveal progressively (motion-guarded) so a long transcript reads as if it streams in.
The page speaks French and English. GET /gui?lang=fr|en picks one, a flag in the header toggles between them, and a code no catalogue carries falls back to the default rather than failing.
The English is the source, written in the markup itself. The French lives in vocal_helper/locales/fr/LC_MESSAGES/vocal_helper.po, a standard gettext catalogue read through os_helper.Catalog — the loader shared across the suite — so a translator works in the format every translation tool already speaks, on real sentences rather than on key names.
Edit the .po, then recompile with python -c "import os_helper as osh; osh.compile_catalogs('vocal_helper/locales')".
skills/vocal-helper/ packages vocal-helper as a Claude Skill and an OpenCode skill so an agent can transcribe / diarize / summarise on your behalf. See skills/README.md to install (symlink into ~/.claude/skills/ and ~/.opencode/skills/), and TRIGGERS.md for the exhaustive catalogue of what invokes it.
make_embedder(backend) and resolve_sherpa_models() replace the private names three repositories were importing across a boundary (_TitaNetEmbedder, _SherpaEmbedder, _resolve_sherpa_models). Both embedder backends emit the same 192-d TitaNet-large vector, so the choice is installation and platform, never quality: nemo through torch, sherpa through onnxruntime for iOS and Android.
Every stage can be observed without consuming the merged output stream :
async def on_voiced(seg): print("VAD:", seg["t0"], seg["t1"]) async def on_diar(seg): print(" → ", seg["speaker"], seg["t0"], seg["t1"]) pipeline.subscribe_voiced(on_voiced) pipeline.subscribe_diarized(on_diar) async for ev in pipeline.run(): ... Useful for WebSocket / SSE relays, live User Interface (UI) updates, or JSONL persistence.
Offline — pyannote community-1. On AMI (8 meetings, collar 0, overlap scored) it ties speaker-diarization-3.1 on the median, so a median comparison says there is nothing to choose between them. The difference is all in the tail:
One meeting carries all of it, and there community-1 is 3.3× better.
On three real 64-minute six-speaker panels it also over-splits least of everything measured — 2.7×, against 3.0× for 3.1, 3.7× for Sortformer 4spk-v1 and 19.7× for the sherpa-onnx path.
It is the default for _PyannoteOfflineDiar; a bundle that predates it falls back to 3.1 with a warning.
Online — diart. The opposite verdict, from the measurement operator-assistance-streaming had already made:
DiartDiarStage is the port. It costs an environment of its own, and it revises what it already emitted: diart re-sends its whole annotation each step, so snapshot_to_delta turns that into a stream and counts the revisions — the honest price of the 500 ms. Read that count next to the latency with LiveMetrics, never alone.
Still the default for the built-in online stage — cosine clustering. The pdbms study (2026-06-29, N=2089 per system) ranks streaming diarizers as hungarian_nemo (w=20 s, DER 0.13–0.20) up to 300 s and hungarian_pyannote (w=30 s, 0.30–0.45) beyond. OnlineDiarStage specialises that: the VAD already isolates each voiced segment, so the sliding window collapses to per-segment embedding plus cosine running-mean clustering. join_threshold is 0.50, raised from the 0.30 that was calibrated for pyannote/embedding before TitaNet became the default embedder and moved the cosine scale under it.
Plain WER cannot see how multi-speaker audio actually fails, so the module carries the metrics that can.
Offline quality has WER and DER; live has latency, flicker and queue wait, and no one of them is the answer alone.
m = voh.LiveMetrics() pipeline = voh.Pipeline(source=..., metrics=m) ... print(m.summary()) Latency is counted from the end of the speech, because that is when a listener starts waiting. The revision rate matters because text that jumps is unusable at any word error rate — and zero revisions is not automatically good, it is paid for in latency. Per-queue waits say where the time went: a slow total with no queue wait is a slow model, the same total with a large one is a starved consumer. Opposite fixes.
violations enforces the one rule the whole live design rests on: no update appears before the audio that produced it. A non-zero count means a clock, a buffer or a mock is lying, and every number beside it is fiction.
A pipeline that lost a stage used to return a normal, empty transcript with the reason only in a log. run() now raises StageCrashed, naming every stage that died, and pipeline.stage_failures carries the exceptions. Pass strict=False to opt back into leniency — a choice somebody makes rather than inherits.
Before a word is transcribed, vocal_helper.lid decides which language is being spoken for the whole file, or per region of a code-switched recording. This matters because a plain whisper "auto" pass locks onto the first language it hears and translates the rest into it; identifying the language acoustically first lets each region be transcribed in its own language. It also catches mislabeled data: on a 423-call corpus the acoustic census overrode the folder labels on 21 files (English and Dutch calls filed under "FR", etc.).
Discovery-first: no default language, no pairing. Detection returns the language the input actually is (whisper's true argmax over its full language head). There is no default language and no language pair; the language is discovered from the audio itself.
import vocal_helper as voh # Fast path, the right default for batch corpora that are mostly monolingual: regions = voh.detect_language_regions_fast(pcm, 16_000) for r in regions: print(f"{r.lang} [{r.t0:.1f}–{r.t1:.1f}s]") Opt-in routing hint. If you can only route a fixed set of languages, pass supported=("en", "fr", "es", "it", "pl", "nl") to re-rank detection within that set (so a close but un-routable relative, Galician over Spanish on a short window, never wins). This is entirely optional: leave it unset (None, the default) and the input speaks for itself.
Shipped since this list was first written: the --jsonl output writer, and the auto LLM-engine selector (voh.resolve_engine(), landed in 2.0.0). What's still open:
vocal-helper reached its first stable release at 1.0.0 and is currently at 3.x, following Semantic Versioning:
Special thanks to Mohamed Chelali, Bachir Zerroug and Edmond Jacoupeau.
This project is licensed under the BSD-3-Clause License: see the LICENSE file for details.
mic stream pyannote nemo sherpa llm studies api mcp lid all bench dev
voice speech asr diarization vad whisper pywhispercpp silero streaming producer-consumer asyncio ollama llm live
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




