Skip to content

Agents and LLMsHarness and toolingreference

A self-hosted transcription service for coding agents

A transcription stack runs on one GPU (graphics processing unit) shared with an LLM (large language model) engine, and a coding agent reaches it through tools that never return a raw transcript. The agent gets a summary and a bundle path, and the analysis tools compute from the cached bundle. A recorded conversation becomes a reviewable document without diarized text filling the agent’s context.

Every number, model name and default below is read from the whisper-transcribe service source, the agent-side video-review-core.ts library and the whisper skill, as of 2026-10-20. Figures that are defaults in code are labelled as defaults; the timings in the pipeline section are observed, not benchmarked. The overlap and metrics tools are arithmetic over diarized transcripts, and their accuracy is bounded by the heuristics described below.

This is the transcription half of a larger workstation setup. Scheduling one GPU between LLM, image and training work covers GPU scheduling and the cost of a model swap. Which model runs which agent work covers the vision-fallback path that also uses the whisper stack.

TL;DR:

  • Two Python services in a Compose stack: whisper (transcription, diarization, frame description and OCR (optical character recognition) on port 7860) and whisper-live (live transcription over a WebSocket).
  • The default model is turbo, with five other sizes. Translation defaults to "auto": a 30-second language-ID (identifier) pre-pass, then translation to English for non-English audio.
  • A 60-minute recording takes 2-3 minutes without diarization and 8-10 minutes with it, on a consumer GPU (observed).
  • Voice prints store a 256-dimensional speaker embedding and auto-name that speaker in every later transcript from the same service.
  • video_extract returns speaker shares, duration, a mic-routing warning, a format-tag suggestion and a bundle path. The bundle is cached on disk, so re-analysis is instant.
  • video_overlap, video_metrics and video_doc read the cached bundle.
  • Question-flow classification is form-based and about 70% accurate. Overlap counts cannot tell a steering question from an information-seeking one.
  • A transcription job evicts the LLM engine. The next agent turn pays a cold-context prefill of 40-90 seconds to first token at about 200k tokens of history.

whisper stack (Compose)agent harness(pi, Claude Code)video_* toolswhisper MCP server(status, YouTube)GPU proxy :11434chatwhisper :7860HTTPHTTPLLM enginellm modeone GPUwhisper modevalkeyjob queuewhisper-live
  1. The harness calls six tools (video_extract, video_overlap, video_metrics, video_doc, video_enroll, video_name) that use the whisper service’s HTTP (Hypertext Transfer Protocol) API (application programming interface) on port 7860. On pi they are extension tools. On Claude Code a toolkit MCP (Model Context Protocol) server wraps the same core library.
  2. whisper handles transcription, diarization, VLM (vision-language model) frame description, OCR and voice prints. whisper-live does streaming. valkey holds the FIFO (first in, first out) job queue that serialises every consumer (bot, MCP, web UI (user interface), curl).
  3. The GPU runs the LLM engine or whisper, never both. A transcription job stops the LLM container and the next chat request restarts it. The GPU proxy owns that lifecycle and is covered in the GPU scheduling page.

You needUseReturnsNotes
A transcript plus a cached bundle for re-analysisvideo_extractSummary + bundle pathTakes minutes for a long recording. The raw transcript stays on disk.
Who talked over whomvideo_overlapPer-speaker overlap stats, event list, pair-cluster matrixInstant from cache. Minimum collision 0.3 s (default).
Rate, fillers, turn-gap percentiles, question flowvideo_metricsPer-speaker metrics, per-pair gap matrix, question outcomes, block analysisInstant from cache. Heuristic, about 70% accurate on classifications.
A markdown evidence bundle to write a review fromvideo_docTranscript + visual timeline + overlap summary + speaker tableInstant from cache. The agent writes the document.
Auto-naming across future transcriptsvideo_enrollEnrolment confirmationStores a 256-d voice print server-side.
Correct labels in one cached bundlevideo_nameUpdated bundleClient-side only; enrols nothing.

Only video_extract runs the GPU pipeline. The other tools finish in under a second.


POST /api/jobs(model, language,translate, diarize)poll every 4 s(timeout 1800 s)202 + job_idPOST /api/describe(frames: true only)donebundle on diskXDG_DATA_HOME/video-review/donevideo_overlapvideo_metricsvideo_doc

video_extract runs three steps, the last two optional or cheap:

  1. Transcription and diarization. POST /api/jobs enqueues on the valkey FIFO with the model, language hint, translation policy and diarization flag. The tool polls GET /api/jobs/<id> every 4 seconds until the job reaches done, failed or the timeout (default 1800 seconds). The result is word-level segments with speaker labels and, with diarization on, one 256-dimensional WeSpeaker embedding per speaker.
  2. Frame description, when frames: true. POST /api/describe extracts frames at an interval (default 10 seconds, capped at 60 frames) and sends each to a VLM for a one-sentence description. It is the visual track for recordings with screen shares, slides or a whiteboard.
  3. Bundling. Segments, frames, speaker list, embeddings and parameters are written as a JSON (JavaScript Object Notation) bundle under XDG_DATA_HOME/video-review/<hash>.json. The key is a truncated SHA-256 (Secure Hash Algorithm) of the server-side file path and the extract parameters, so the same recording extracted with and without diarization gives two bundles. An index.json beside the bundles supports lookups across bundles.

The extract summary holds:

  • File name and recording duration.
  • Active speech share: clocked speaking time as a percentage of wall time.
  • Per-speaker speaking shares, longest first.
  • A warning when the enrolled owner is near-silent (possible mic-routing failure).
  • A format-tag suggestion when the bundle is untagged (table below).
  • The bundle path.
Call shapeSuggested tag
2 speakers, both named1:1
One speaker holds at least 60% of speech and at least one speaker is unnamedcustomer (presentation format)
3 or more speakers, at least half namedreview (team call)

The tag is a free-form label stored on the bundle. video_metrics builds per-format longitudinal baselines from it.

/api/jobs returns 202 Accepted with a job_id at once. The poll loop runs inside the tool call, so the agent’s 30-second bash timeout does not apply and the model is not re-prompted while the job runs.

A 60-minute call on turbo takes 8-10 minutes with diarization and 2-3 minutes without, on an RTX 5090 (observed, not a benchmark). That is 3-4 times as long with diarization, which runs a separate neural model over the audio. Skip it when only a transcript is needed.

The translate parameter defaults to "auto". The service runs a 30-second language-ID pre-pass, and if the detected language is not English it transcribes with task=translate. English audio is not translated. translate: true forces translation and translate: false keeps the source language. The default exists because the downstream summarisation LLM reads English best.

Whisper’s per-segment decoder sometimes ignores the translate task token on deliberately multilingual audio, where each short segment is in a different language. The per-chunk language detection wins and those segments stay untranslated. The downstream LLM reads them natively and still produces a coherent English summary, so summarisation works end to end. A verbatim all-English transcript would need a post-processing LLM translation step, which the service lists as deferred until someone needs it.

Diarization assigns each word to a speaker (SPEAKER_00, SPEAKER_01, …). Overlap detection, per-speaker metrics, question-flow attribution and block analysis all need word-level speaker timing. A bundle extracted without diarization has segments only, no speaker labels and no word timing, and the analysis tools return an error on it.

A voice print is a 256-dimensional speaker embedding stored server-side under a name. Once enrolled, the speaker is auto-named in every later transcript the service produces, whether it comes through the agent tools, the web UI, the Discord bot or curl.

Enrolment uses an existing diarized bundle. video_enroll takes action: "add", the bundle path and the diarized label to pull the embedding from (M-SPEAKER_01, not a display name). The server already returned the embedding with the transcription job, so no audio is re-run. Enrolling the same name twice adds a second reference vector and improves matching.

Names reach a bundle by two paths:

  1. Server-side matching. When a job finishes, the server compares each diarized speaker’s embedding with all enrolled voice prints. Matches above a cosine-similarity threshold fill speaker_names in the job result, and the cached bundle stores them under bundle.names.
  2. Client-side relabelling. video_name takes a {label: name} map and rewrites segment speakers, word speakers and the speaker list. The map can be manual or inferred from address cues in the transcript (“Hi, Alice” -> the next different speaker is probably Alice). The extension’s suggestNames() extracts these cues with high, medium or low confidence. A greeting pile-in where several speakers greet at once cannot be attributed to a responder, so it is emitted at low confidence.

A bundle keeps the original diarized labels as stable ids and a names record mapping them to display names. Embedding keys are not renamed, so video_enroll can always pull a vector by the diarized label. Renaming a label that already has a name updates the existing entry.


Conversation analysis from word-level timing

Section titled “Conversation analysis from word-level timing”

The analysis tools use per-word speaker labels with start and end timestamps. Segment boundaries are rounded to utterance edges, so two speakers can overlap inside what a segment-level view shows as sequential turns. Word timing catches the overlap.

Words are grouped by speaker, then merged into utterances: consecutive same-speaker words no more than 0.6 seconds apart become one utterance. The merge runs per speaker. A merge over one globally time-sorted stream would interleave two overlapping speakers’ words and split both into short alternating utterances, inventing overlaps that never happened. Per-speaker merging keeps each speaker’s spans whole, and overlap becomes an interval intersection between different speakers.

computeOverlap() scans time-sorted utterances for a later utterance that starts inside an earlier one from a different speaker. Each collision records:

  • interrupter and interruptee.
  • The collision duration.
  • yielded: who stopped first. The interruptee stopping is a talk-over. The interrupter stopping is a false start or a short backchannel.

min_overlap_sec defaults to 0.30 seconds, which filters alignment jitter and short acknowledgements (“yeah”, “mm”). The output has per-speaker counts (times this speaker started over someone, times someone started over them), an event list sorted by time, and a pair-cluster matrix with, for each speaker pair, how often the first came in over the second and the total collision seconds.

A steering question that interrupts and an information-seeking question that overlaps a closing sentence look the same acoustically. The numbers describe what happened physically; the reviewer decides what it means.

computeMetrics() builds on the overlap analysis:

MetricDefinition
Words per minuteWords over clocked speaking time
Words per turnWords over utterance count
Filler rateFillers per 100 words, matched against a lexicon: um, uh, you know, sort of, kind of, basically, actually, I mean, to some extent, effectively
Turn-gap p25, median, p75Gap between the previous different speaker’s utterance end and this speaker’s start, in seconds. A negative gap means the speaker entered before the previous one finished.
Per-pair gap matrixMedian gap and sample count for each ordered pair (“B after A”). A pair needs at least 3 samples to appear.

The p25 shows the fast-response tail that the median hides.

analyzeQuestionFlow() works at sentence level inside utterances. Each question-marked sentence gets a dialogue act first (DAMSL-lite, Stolcke et al. 2000):

ActFormExample
questionInterrogative lead (what, why, how, is, do, can)“Did you try the new endpoint?”
checkStatement-form confirmation“So I use the admin SDK?”
tagDeclarative stem with a short question tail“That’s the second endpoint, right?”
backchannelPhatic continuer in question form“Really?”, “Is that right?”

Tags and backchannels are left out of the outcome analysis. For each question or check, the analyser scans forward up to a window (default 10 seconds) and assigns an outcome:

OutcomeCondition
elaborationA different speaker gives a substantive response with new information
assentA different speaker’s response matches the acknowledgement lexicon (“yeah”, “that makes sense”, “sounds good”, “fair enough”; 41 entries, multi-word phrases matched greedily)
self-answeredOthers give only backchannels, then the asker speaks next
unansweredNothing within the window. The answer may come later, so the label is low-confidence.

The classification is form-based and about 70% accurate against human-labelled dialogue-act corpora. The output says so, and the tool’s prompt guidelines tell the agent to check flagged instances against the transcript before asserting them.

Classifying by form gives two limits:

  • A steering question and an information-seeking question with the same surface form get the same label. “Did you try X?” followed by “yeah” is probably steering, but the tool reports only the assent.
  • check versus question depends on the interrogative-lead lexicon. “You tried the new endpoint?” is a check and “Did you try the new endpoint?” is a question, though in conversation they are the same act. The counts are reported but should not be over-read.

Diarization splits a held floor into many short turns because it inserts boundaries at acoustic pauses. computeBlocks() merges consecutive same-speaker utterances separated by no more than 3 seconds into blocks. The output is a per-speaker block count, duration percentiles and the share of words spoken inside blocks of 30 seconds or longer.

Long blocks are not a defect in themselves, since expert answers and stacked questions run long. The five longest blocks are returned as evidence to read before judging. Verbatim phrase repetitions inside a block (4 or more tokens, 2 or more content words) are flagged separately as a composing-aloud signature.

video_metrics appends a row per (speaker, bundle) to a JSON-lines file in the cache directory. When the same speaker appears in a later call with the same format tag, the tool prints the change in fillers per 100 words, gap median and long-block share against the prior results. A failed write does not block the metrics call. Re-running metrics on a bundle replaces that bundle’s rows.


/api/describe, used for video frames, is one of two vision endpoints. The other is /api/image, which takes raw image bytes as a multipart upload and returns a description plus OCR text. Both use the same VLM, reported in /api/status with the GPU device and compute type.

vision-fallback.ts uses /api/image. When the default cloud model is text-only, the extension replaces each image block in the outgoing request with a text description. The first-choice backend is the LLM engine, if its loaded model has vision. /api/image is the fallback because it needs no server-side file path. Descriptions are cached by image hash, so each image is described once.


The model names, the port numbers and the tool count belong to this setup.

  • Return a summary and a bundle path. A diarized transcript is thousands of tokens, and the agent can drill in with tools that read from disk.
  • Cache the expensive step. Transcription and diarization are GPU-bound and slow, and the analysis over the same data is instant.
  • Keep voice prints on the server. Every consumer of the service gets named speakers, and display names sit in a layer above the stable diarized labels.
  • Use a queue and a job-id endpoint for long jobs. Transcribing a long recording outlasts any reasonable HTTP timeout.

Recording to reviewwith an agentPer-speakeranalysis?diarize:true(8-10 min per hour)yesdiarize:false(2-3 min per hour)transcript onlyVisual trackmatters?Speakerenrolled?noframes:trueyesvideo_enroll or video_nameafter extractnovideo_overlap, video_metrics,then video_docyes (auto-named)
  1. Per-speaker analysis (overlap, metrics, blocks) needs diarize: true: 8-10 minutes for a 60-minute recording. A transcript alone takes 2-3 minutes with diarize: false.
  2. Screen shares or slides need frames: true.
  3. A speaker who is not enrolled gets named with video_enroll from the cached bundle, or relabelled with video_name.
  4. video_overlap gives who talked over whom and who yielded.
  5. video_metrics gives rate, fillers, turn-gap percentiles and question flow. Check the top events against the transcript.
  6. video_doc assembles the evidence bundle the agent writes the review from.

ClaimHow it was checkedStatus
Default model is turbo; five other sizes available (tiny through large)whisper skill SKILL.md line 124 (model default turbo, enum of tiny, base, small, medium, large, turbo)Documented
Translation default is "auto" (30 s LID (language identification) pre-pass, translate non-English)whisper skill SKILL.md line 127 (translate default "auto": “LID pre-pass, translate non-English to English”), whisper-transcribe docs/design/multilingual.md (”30s LID pre-pass via faster-whisper”)Documented
video_extract polls /api/jobs/<id> every 4 secondsrunTranscriptionJob() in lib/video-review-core.ts line 1138 (await sleep(4000))Code-verified
Default timeout for transcription is 1800 secondsvideo_extract parameter description in video-review.ts (“Max seconds to wait for transcription (default 1800).”)Code-verified
Bundle cache path is XDG_DATA_HOME/video-review/CACHE_DIR constant in lib/video-review-core.ts line 41 (XDG_DATA_HOME ?? join(homedir(), ".local", "share"), "video-review")Code-verified
Utterance merge gap is 0.6 secondsmergeUtterances() default gapSec = 0.6 in video-review-core.tsCode-verified
Overlap minimum threshold is 0.3 secondscomputeOverlap() default minOverlapSec = 0.3 in video-review-core.tsCode-verified
Block merge tolerance is 3 seconds, long-block threshold is 30 secondscomputeBlocks() defaults gapTolSec = 3, longBlockSec = 30 in video-review-core.tsCode-verified
Question-response window is 10 secondsanalyzeQuestionFlow() default windowSec = 10 in video-review-core.tsCode-verified
DAMSL-lite form-based classification is ~70% accurateTool prompt guidelines + comment in classifyQuestion() (“expect machine-DA accuracy (~70%), not perfection”)Documented
Voice-print embedding is 256-dimensional (WeSpeaker)Bundle interface speakerEmbeddings field comment (“256-d WeSpeaker voice embeddings”) in video-review-core.tsCode-verified
Whisper MCP server exposes 6 tools (whisper_status, yt_download, whisper_transcribe, yt_transcribe, yt_transcribe_playlist, wait_job) with exposure: directmcp.json entry for whisper (no exposure override = direct)Code-verified
/api/image accepts raw multipart bytes and returns description + OCRvision-fallback.ts lines 20-23 (“single-still VLM + OCR … accepts raw multipart bytes”)Code-verified
Vision-fallback caches descriptions by image hash on diskvision-fallback.ts lines 25-27 (“cached by image hash, in memory and on disk at ~/.cache/pi-vision-describe/<sha>.txt”)Code-verified
Whisper translate quirk: per-segment decoder can override translate on multilingual audiodocs/design/multilingual.md lines 26-30 (“faster-whisper’s per-segment decoder occasionally ignores the translate task token”)Documented
Diarization triples extract time: ~2-3 min text-only vs 8-10 min with it on a 60-min callLLM agent experience; not a measured benchmarkObserved
Eviction cold-prefill penalty: 40-90 s TTFT (time to first token) at ~200k contextagent-model-routing.mdx “Local-engine guards” table row for llmc-session-guard.tsDocumented