Refine each utterance with Whisper
A second neural network, Whisper, that rereads each finished utterance before it is typed: what it changes, which hardware it needs, the libcublas remedy for a graphics card, and the optional package that installs it.
Vosk keeps what it does best: the text shown as you speak, the cutting of utterances, the wake and stop phrases. The refinement adds a second neural network, Whisper, through the faster-whisper library. When Vosk ends an utterance, its audio (30 seconds at most) goes to Whisper, in the language of the session; Whisper’s text, with the capitals and the punctuation it places, replaces Vosk’s just before typing: an utterance is typed once it is finished and reread.
It is off by default. Command phrases (wake, stop) are never refined, utterances are typed in the order they were spoken, and when Whisper takes longer than refine.timeout_ms (2000 ms) after the end of the utterance, or returns nothing usable, the text of Vosk is typed instead; each fallback is counted.
Install the refinement
The refinement is a second optional package, of the same version as the main one:
# Debian 12+, Ubuntu 24.04+, Mint 22+...
sudo apt install ./vosk-cli-dictation-whisper_0.6.1~beta_all.deb
# Fedora
sudo dnf install ./vosk-cli-dictation-whisper-0.6.1~beta-1.fc44.noarch.rpm
# openSUSE Leap
sudo zypper install ./vosk-cli-dictation-whisper-0.6.1~beta-1.leap160.noarch.rpm
# Arch Linux
sudo pacman -U ./vosk-cli-dictation-whisper-0.6.1_beta-1-any.pkg.tar.zst
faster-whisper is not packaged by the distributions: the package adds it to the Python environment of the main package with pip (about 100 MB, network access at that point only). Removing the package uninstalls from that environment what it added, and nothing else. From a Git checkout, pip install faster-whisper in the virtual environment does the same.
The weights of each Whisper size download at its first use, under ~/.local/share/vosk-cli-dictation/whisper-models: 75 MB for tiny, 1.6 GB for large-v3-turbo. Vosk’s text is typed in the meantime.
Choose it
From the icon menu, entry “Refinement” (the icon), or on the control socket:
printf 'set-refine whisper:small\n' | socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/vosk-cli-dictation.sock
printf 'set-refine none\n' | socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/vosk-cli-dictation.sock
The reply is OK followed by the state, then the size loads in the background; an unknown size is answered ERR bad-argument. The choice is remembered, and “Revert to the configuration” clears it. In config.yaml, the refine section holds the factory values:
refine:
engine: none # none | whisper
model: auto # auto | tiny | base | small | medium | large-v3-turbo
device: auto # auto | cpu | cuda
compute_type: auto # float16 on cuda, int8 on cpu
timeout_ms: 2000
The hardware decides
- With an NVIDIA graphics card,
large-v3-turbo, the largest size, answers in about 310 ms at the 95th percentile per utterance. It is the automatic choice (model: auto). - On a processor, no size stays under 500 ms per utterance:
tinytakes 3.4 s at the 95th percentile on a Raspberry Pi 4 and 1.3 s on an eight-core x86 machine. The automatic choice is therefore no refinement on a processor; a size is chosen by hand, withtimeout_msraised to match.
vosk-cli-dictation --diagnose prints, in its “Refinement” section, the engine, whether faster-whisper is found, the hardware chosen and the weights folder.
The graphics card needs libcublas
The card is used only when the system provides the CUDA 12 library libcublas.so.12; the packages do not ship it. On Debian and Ubuntu (the packages are in non-free on Debian):
sudo apt install libcublas12 libcublaslt12
Without it, a detected card is ignored: the refinement runs on the processor and the dictation prints this remedy. device: cuda without the library is refused with the same message.
What it changes
On the project’s test set (synthetic speech: it compares engines, it does not promise a real rate), French word errors with Whisper large-v3-turbo:
| Vosk model | Without refinement | With refinement |
|---|---|---|
| Light | 15.4 % | 12.0 % |
| Full | 10.1 % | 12.2 % |
With the full model the words do not improve, and the refinement mainly adds capitals and punctuation. English goes from 14.4 % to 2.8 %, German from 21.8 % to 18.6 % (the typed text from 46.1 % to 20.1 %, since Vosk places no capital on nouns), Spanish from 13.6 % to 9.8 %. The small sizes (tiny, base, small) spoil French text.
Read the counters
vosk-cli-dictation --status
When an engine is chosen, a second line gives the utterances refined, the fallbacks to Vosk for delay, the errors, the rejections, the command phrases left as they were and the mean latency. --info carries the same counters (refine_stats). Many delay fallbacks mean the size is too heavy for the hardware: choose a smaller one, or raise timeout_ms.