Architecture

Transcription strategy

VoiceFlow uses an accuracy-first, two-pass Whisper strategy: transcribe, score the result, and only re-run with different settings when quality looks poor.

Model

whisper-large-v3

Strategy

v2_accuracy_first

Re-run threshold

score < 0.70

The transcription request

The WAV is posted as multipart form data to Groq's OpenAI-compatible endpoint, authenticated with your API key.

POST /openai/v1/audio/transcriptions
file:            recording.wav        (audio/wav)
model:           whisper-large-v3
response_format: verbose_json
temperature:     0
language:        en                   (or omitted for auto-detect)
prompt:          dictionary spellings + "transcribe exactly"

verbose_json returns the text plus a detected language and per-segment data, which feeds the quality scoring below.

Two-pass accuracy strategy

A first pass (Pass A) runs at temperature 0 with the dictionary-biased prompt. Its output is scored. Only if the score falls below 0.70 does a second pass (Pass B) run with a neutral prompt and a small temperature bump, giving the model a different shot at ambiguous audio. The higher-scoring pass wins; ties break toward the longer transcript.

Pass Adictionary · temp 0
Score Aquality heuristics
score < 0.70?else keep A
Pass Bneutral · temp 0.2
Pick winnerhigher score
Pass B is conditional — clean audio is transcribed once. The winner is chosen by score, then by length on ties.

Quality scoring

Each candidate starts at a score of 1.0 and loses points against heuristics that catch common Whisper failure modes — runaway repetition, implausible speaking rates, and dictionary echoing. The remaining score decides whether Pass B runs and which pass is kept.

Too few tokens−0.35
Low words/sec−0.25
High repetition−0.25
Dictionary-heavy−0.25
Very high words/sec−0.20
Long repeat run−0.20

Penalties are subtracted from a starting score of 1.0, then clamped to [0, 1]. A recording that trips several checks drops below the 0.70 re-run threshold.

CheckTriggers whenCatches
few-tokens≤1 token, >2.5sLong audio that transcribed to almost nothing.
words-per-second<0.45 or >6Implausibly slow or fast output relative to duration.
repetition-ratio>0.6 unique lossThe same words repeated — a classic Whisper loop.
repeat-run≥4 in a rowA single token stuttered many times.
dictionary-ratio≥0.85 dict tokensOutput that is mostly dictionary terms — likely prompt echo.

Diagnostics

The chosen pass, both scores, and their reasons are attached to the result as diagnosticsand saved with the history record. They're also logged, so you can see why a particular transcription was re-run or rejected.

Diagnostics are how the two-pass strategy stays debuggable — each record remembers which strategy version produced it and how each pass scored.