← Open Source

Wyoming protocol server for faster whisper speech to text system.

Python
Momentum
+0stars in 24 hours0.0%
423
Stars
128
Forks
19
Contributors
Created 2023-10-02 · Updated 2026-12-03 · #25691 today
Top developers
synesthesiamcandrewsdanielrheinbay
README

Wyoming Faster Whisper

Wyoming protocol server for the faster-whisper speech to text system.

Home Assistant Add-on

Source

Local Install

Clone the repository and set up Python virtual environment:

git clone https://github.com/OHF-Voice/wyoming-faster-whisper.git
cd wyoming-faster-whisper
script/setup

Run a server anyone can connect to:

script/run --model tiny-int8 --language en --uri 'tcp://0.0.0.0:10300' --data-dir /data --download-dir /data

The --model can also be a HuggingFace model like Systran/faster-distil-whisper-small.en (but see Distil-Whisper models are not compatible if you want name biasing)

NOTE: Models are downloaded to the first --data-dir directory.

Server-side VAD Endpointing

By default, the server waits for the client to send audio-stop before it transcribes. Set --vad-endpointing to a number of seconds to end the command after that much Silero-detected silence and send the transcript immediately:

script/run --uri 'tcp://0.0.0.0:10300' --data-dir /data \
    --vad-endpointing 0.7

When enabled, the Wyoming service advertises that it does not require external VAD, so Home Assistant leaves endpointing to this server. Speech must be detected before the silence timer starts; brief pauses reset when speech resumes, and a command is allowed to run for at least one second. Audio received after the endpoint is ignored until the client's eventual audio-stop.

This is independent of the existing VAD options. --vad-filter still controls Faster Whisper's filtering during transcription, while --vad-clip still trims the completed batch WAV before transcription. They can be used together with --vad-endpointing; the only intentional interaction is replacing Home Assistant's external endpointing while this option is enabled.

Reported Languages

The Wyoming service advertises the languages the configured backend can actually transcribe, not a fixed list. Under the default --stt-library auto the backend is chosen per language, with faster-whisper as the fallback for anything the specialized backends don't claim, so all of Whisper's languages are reported. Pinning a backend narrows it:

Backend Languages
faster-whisper, transformers Whisper's 100 (just en for a .en checkpoint)
qwen3-asr 31
sherpa 25 (Parakeet TDT v3)
sherpa --sherpa-streaming de, en, es, fr (the published Kroko models)
funasr en, ja, ko, yue, zh, zh-CN, zh-HK, zh-TW (SenseVoice)
onnx-asr ru (GigaAM), lt (LT_ausys), and Canary-1b-v2's other 23

--language is checked against this list at startup, and a region-qualified code is accepted everywhere — en-US selects the same backend and model as en, and zh-HK/zh_HK stays Cantonese rather than falling back to Mandarin.

This matters because Home Assistant picks the pipeline's STT language out of this list. A backend that over-reports gets handed languages it will transcribe as gibberish; one that under-reports is unreachable for languages it handles well.

Codes are reported in the form Home Assistant matches against, which is why Cantonese is advertised as zh-HK rather than only yue. Home Assistant treats yue and zh as unrelated languages, and home-assistant/intents ships zh-CN/zh-HK/zh-TW with no bare zh or yue — so a backend that says only yue can never be reached by a Cantonese pipeline. Both Cantonese-capable backends (funasr, qwen3-asr) advertise zh-HK and decode it as Cantonese, while zh-CN and zh-TW still fall through to Mandarin.

Which Backend auto Picks

Under --stt-library auto (the default) the backend and model are chosen per language, from whichever extras are installed:

Language Backend and model
en sherpa: Parakeet TDT v2
de, es, fr, hu, it, nl, pl, pt, ro sherpa: Parakeet TDT v3
bg, sk onnx-asr: Canary-1b-v2 (int8) with at least 5 GiB of memory, otherwise Parakeet TDT v3
ru onnx-asr: GigaAM
lt onnx-asr: LT_ausys
zh, yue, ja, ko funasr: SenseVoice
everything else faster-whisper: tiny-int8 on ARM, base-int8 otherwise

Parakeet TDT v3 decides the language from the audio itself; it cannot be told which one to expect. On short commands that was measured to be reliable for the languages above: on 541 recordings of 0.6–3.5 s from 11 speakers it picked another language twice, and it was more accurate than every Whisper size up to small (for example German 5.1% WER against 21.8% for base-int8, Hungarian 6.8% against 51.7%). On a Raspberry Pi 5 it answered a 3–5 s command in 0.4–0.6 s, against 3.5 s for tiny-int8.

French has no speaker in those recordings, so it was measured on 217 spoken voice-assistant commands from 55 speakers in Speech-MASSIVE instead: 8.1% WER against 46.5% for tiny-int8, 26.4% for base-int8, and 13.6% for small-int8. English came out for 2 of the 217.

For Bulgarian and Slovak it often is not: it transcribed 30% of the Bulgarian and over a third of the Slovak recordings as Polish or Russian. Canary-1b-v2 covers the same languages but takes the language as part of its prompt, which brings that to under 4% (Bulgarian 9.6% WER, Slovak 17.9%). It needs more: a 1 GB download and 1.8 GB of memory, against 1.0 GB for Parakeet, and 0.65 s rather than 0.36 s for a 3 s command on a Raspberry Pi 5. So it is only chosen when the machine (or the container's memory limit) has at least 5 GiB, which leaves out 4 GB boards like the Home Assistant Green. Without it Parakeet is still well ahead of Whisper there (Bulgarian 33.0% against 60.8% for base-int8).

The other languages Parakeet TDT v3 covers stay with Whisper until they are measured the same way. With --sherpa-streaming, German, Spanish, and French go to their streaming Kroko models instead of Parakeet; on the same recordings they were about as accurate (German 5.6% WER and Spanish 2.9% on the voice-datasets, French 9.4% on Speech-MASSIVE with greedy decoding), and German and Spanish finished about 30 ms after the audio ended. The other languages above have no streaming model, so they stay with faster-whisper (Bulgarian and Slovak still get Canary when there is memory for it, since it does not stream either way).

None of the backends auto picks besides faster-whisper take a prompt, so name biasing does not apply to them. Pass --stt-library faster-whisper (or qwen3-asr) to keep it.

Biasing Toward Your Home Assistant Names

Whisper has never heard of your thermostat. "What's the temperature of the Ecobee?" comes back as "What's the temperature of the incubi?" — the acoustics were fine, the model just has no reason to think that word exists.

Given a long-lived access token, the server reads the names in your home over the Home Assistant websocket API and feeds them to the model as a prompt, which fixes exactly that class of error:

script/run --uri 'tcp://0.0.0.0:10300' --data-dir /data \
    --hass-token "$TOKEN" --hass-api 'http://homeassistant.local:8123/api'

Requires the hass extra:

pip install 'wyoming-faster-whisper[hass]'

The token must belong to a Home Assistant administrator. Home Assistant only lets administrators list which entities are exposed to Assist, so a non-admin user's token authenticates but every refresh is refused as unauthorized. Create the token on that user's profile page, under Security → Long-lived access tokens.

It collects the names of conversation-exposed entities and their aliases, plus your area and floor names — the names a speaker can actually say. It also reads which area each exposed entity is in, so the areas you can actually command rank above the ones you can't. Nothing else is read, and no service is ever called.

The fetch is free in latency terms: it starts when the audio starts, while the speaker is still talking, and the names are ready by the time the audio stops. Home Assistant being slow or unreachable only costs freshness — the previous names are used, or none at all, and the transcript still comes back.

Option Default Purpose
--hass-token Long-lived access token. Enables everything above. Use WYO_WHISPER_HASS_TOKEN_FILE to keep it off the command line (see Environment Variables).
--hass-api http://homeassistant.local:8123/api Where to find Home Assistant.
--hass-refresh-seconds 0 Minimum seconds between refreshes. 0 refreshes every utterance, so a rename takes effect immediately.
--hass-prompt-max-tokens 200 Token budget for names. Whisper's hard cap is 223 and quality falls off before it.
--hass-prompt-timeout 1.0 How long to wait on an unfinished refresh before transcribing with the names already on hand.

A large home has more names than the budget holds, so they are added in priority order and cut off when it runs out:

  1. Areas and floors that hold an exposed entity — said in nearly every command ("turn on the office lamp"), and known to be real targets because something in them can actually be commanded.
  2. Entity names in the domains people say out loud — light, switch, fan, media_player, climate, scene, todo. These are the proper nouns that get misheard.
  3. The remaining areas and floors — sayable, but with nothing exposed in them there is no command they can complete.
  4. The remaining entity names — in a big home mostly sensors, which are hundreds in number and usually asked about by area ("the temperature in the office") rather than by their own name.

Aliases are not a tier of their own. An alias is what you say instead of the name the integration gave the thing, so each one sits directly behind the name it belongs to and shares its tier — a light's "standing light" is kept or dropped along with the light, never left out while lower-priority names get in.

Edit PRIORITY_DOMAINS in wyoming_faster_whisper/hass_api.py to change what lands in tier 2. Run with --debug to see how many names were dropped and the exact prompt used. --initial-prompt still works and is kept at the front of the prompt, ahead of anything discovered from Home Assistant.

This biases faster-whisper and qwen3-asr, the backends that take a prompt. Others ignore it.

Distil-Whisper models are not compatible

Distil-Whisper checkpoints (Systran/faster-distil-whisper-*, distil-small.en, distil-large-v3, …) were distilled without previous-text conditioning, so a prompt is at best wasted on them and at worst destroys the transcription. This applies to --initial-prompt as much as to --hass-token; the server warns at startup and sends the prompt anyway, since a very short one may be harmless.

Measured on the same clean commands, comparing no prompt against a 29-name (~97-token) list:

Model With a prompt
small.en Works as intended: Natalie Sparkly → Natalie's Heart Light
distil-small.en Breaks from ~52 prompt tokens on: avg_logprob falls below -1.0, every temperature fails, output truncates (Start a timer for 25 minutes → Start a timer.) or loops (Add Hot Dog, Hot Dog, Hot Dog, …)
distil-large-v3 Inert. No collapse at any size, but no biasing either — Ecobee still comes back EcoBe with the name in the prompt

Use a standard Whisper model to bias toward your names.

Prompt cost on qwen3-asr

For qwen3-asr the prompt is not free: the model has to read it before it starts decoding, at roughly 2.8ms per token, so a 50-name list can double the time for a short command.

The default model avoids this. The prompt sits ahead of the audio in the chat template, so its state depends only on the prompt and is computed once, then reused for every later utterance. The layout is chosen from the files present, so older model directories with decoder_init/decoder_step keep working as before — pass --model rhasspy/qwen3-asr-0.6b-onnx-int4 to use one.

Measured on a Pi 5 (4 threads, 3.2s command, 50 names):

split merged (default)
latency 3.42s 2.20s
peak RSS 2.25 GB 1.55 GB
on disk 1407 MB 785 MB

The latency win is for short commands. Long-form audio gains little (~1.04x on a 30s clip), because the cached prompt is a small share of that work — though the memory saving grows with length.

Accuracy is unchanged: on LibriSpeech test-other (n=200) the two produce byte-identical transcripts with no prompt (5.35% WER for both), and 5.33% vs 5.43% with a 50-name prompt.

Streaming on qwen3-asr

--qwen3-asr-streaming makes qwen3-asr transcribe while the speaker is still talking, so less of the work is left for after the audio stops. Qwen3-ASR is not a streaming model — what it hears later can change how it reads what came before — so every 2 seconds of new audio it decodes everything so far again, and the final pass after the audio stops still reads all of it: the transcript is the model's full-context answer, not a stitched-together one.

What makes the later passes cheaper is that each one is given the previous pass's transcript as a draft. The model checks the whole draft in the same single pass that reads the audio, keeps every token of it that matches what it would have generated, and only generates from where they differ. Checking a token costs a fraction of generating one, and since a pass that heard most of the audio is usually right about most of it, the final pass mostly checks. When a word in the draft is wrong ("thirteen" where the full audio says "13"), decoding picks the draft up again a couple of tokens later rather than giving up on the rest.

A draft never decides the transcript, only how fast it arrives. The one caveat is arithmetic: checking several tokens at once rounds slightly differently from generating them one at a time, which can tip a genuine near-tie. In testing that happened on 2 of 308 decodes: "13%" against "13 percent" from a Qwen3-ASR-1.7B export, and "Igboy" against "Igobi" (both wrong, for a name the model does not know) from the default 0.6B. Drafts are only used with the merged decoder layout (the -merged models, including the default). With the split layout (decoder_init + decoder_step) the draft would be checked by one graph and generated by another, which tipped near-ties far more often, so every pass there decodes without one.

Biasing toward your Home Assistant names works in streaming too, with one difference: a streaming session needs its prompt as soon as the audio starts, so it doesn't wait for a name refresh that is still running, as a batch transcription does. A newly exposed entity is picked up from the next command.

The trade is CPU while the speaker talks for latency once they stop. Measured on a desktop CPU (4 threads, English, no prompt, rhasspy/qwen3-asr-0.6b-onnx-int4-merged), time from audio-stop to transcript:

Audio batch --qwen3-asr-streaming
short commands, 1.9-3.5s (mean of 19) 0.44s 0.37s
6.9s 0.76s 0.52s
12.4s 1.62s 1.12s
17.4s 2.35s 1.64s

--vad-clip (bare, or --vad-clip qwen3-asr) applies here too, and saves short commands more on top: the final pass skips the silence around the speech, whose encoding and reading cost as much as speech does. The VAD runs as the audio arrives, so clipping adds nothing after audio-stop. On the same desktop it cut the time after audio-stop for 2-4s commands by 10% as recorded, and by 17% with 0.8s of trailing silence added — about what Home Assistant's own VAD waits for before it ends a command. As with batch clipping, the transcript can change: of seven test commands, one came out differently (equally wrong) when clipped.

Clipping also lets the final pass start before the audio stops. Once the speaker has been quiet for the clip's trailing pad (--vad-clip-pad-ms, 400 ms by default), the clipped audio is exactly what the final pass would read unless they speak again, so it is decoded straight away, and audio-stop returns that result (or waits for it to finish). Home Assistant's own VAD waits for a moment of silence before it stops the audio, which is usually long enough. With 0.8s of trailing silence, all 17 test commands of 1.9-3.5s had their transcript ready at audio-stop (from 0.31s on average with clipping alone); with none added, the mean was 35 ms. If the speaker carries on after a pause, the early result just becomes the draft for the next pass.

The 1.7B qwen3-asr model

qwen3-asr defaults to Qwen3-ASR-0.6B. A community int4 export of the 1.7B model, craigandrews/qwen3-asr-1.7b-onnx-int4-merged, has the same merged layout, so name biasing and --qwen3-asr-streaming work with it unchanged:

--stt-library qwen3-asr --model craigandrews/qwen3-asr-1.7b-onnx-int4-merged

It is for a desktop CPU or a GPU, not a Raspberry Pi: on a Pi 5 the 0.6B model already needs 1.55 GB and 2.2s for a 3.2s command with 50 names (see the table above), and the 1.7B model took about twice the time and 1.8 times the memory on a desktop. Measured on 25 short commands in eight languages, at revision d809a7c:

0.6B (default) 1.7B
download 0.79 GB 1.81 GB
desktop CPU (Ryzen 9 5950X, 4 threads) 0.50s per command, 1.4 GB RAM 1.0s, 2.5 GB
GPU (RTX 2080 Ti) 0.15s, 2.0 GB VRAM 0.19s, 4.8 GB VRAM

What it buys is consistency more than accuracy. On these clips the two models mostly disagreed on style ("16" or "sixteen") and on spelling a name neither knew ("Ecobee"), which is what name biasing is for. But the 1.7B model gave the same 25 transcripts on onnxruntime 1.22 and 1.32 on a CPU and on CUDA, with a language set or auto-detected, while the 0.6B model settled its near-ties differently from one of those setups to the next. On a CPU in some of them, it misheard a Korean command that it gets right on a GPU.

Docker Image

docker run -it -p 10300:10300 -v /path/to/local/data:/data rhasspy/wyoming-whisper \
    --model tiny-int8 --language en

NOTE: Models are downloaded to /data, so make sure this points to a Docker volume.

Source

Running Without Internet Access

A model that is already downloaded is loaded from disk without contacting Hugging Face, so a container that has been started once keeps working on a network with no route out. Only a model that is missing is fetched.

That matters on a network which drops outbound traffic rather than refusing it — a Docker bridge marked internal, for example. The update check that used to run on every start would sit there until the TCP connection timed out, and with restart: always the container boot-looped.

To rule out downloads entirely, pass --local-files-only (or WYO_WHISPER_LOCAL_FILES_ONLY=true) once the models you want are in /data. A model that is not there is then an error instead of a download:

services:
  whisper:
    image: rhasspy/wyoming-whisper
    volumes:
      - ./data:/data
    environment:
      WYO_WHISPER_MODEL: tiny-int8
      WYO_WHISPER_LANGUAGE: en
      WYO_WHISPER_LOCAL_FILES_ONLY: "true"
    networks:
      - no-internet

networks:
  no-internet:
    internal: true

Both images point HF_HOME, XDG_CACHE_HOME, and MODELSCOPE_CACHE at /data so the caches these libraries keep outside the model directory land on the volume too. The largest is the Xet chunk cache used while downloading, which can run to several GB. Outside Docker, set them yourself if you don't want them in ~/.cache.

Health Check

Both images carry a HEALTHCHECK, so docker ps reports healthy or unhealthy and a Compose stack can wait on it with depends_on: / condition: service_healthy. It sends the server a Describe and requires an Info with an ASR program back, rather than only opening a socket: the port is bound by the OS, so a connect-only check stays green even when the event loop is wedged, while a round trip proves the accept loop and the event handler are both still running.

The first 5 minutes don't count against it, because the server only starts listening once the model is loaded — which means downloading it on first run — and it takes 3 consecutive failures to turn the container unhealthy, because transcription runs on the event loop and a check can time out behind a long request.

To run it by hand:

docker exec whisper \
    /usr/src/.venv/bin/python3 -m wyoming_faster_whisper.health_check

It prints nothing and exits 0 when healthy, or prints unhealthy: <reason> and exits 1. That reason is what docker inspect shows under .State.Health.

The URI it checks is tcp://127.0.0.1:10300, or WYO_WHISPER_URI when the container sets one (a listen-everywhere host like 0.0.0.0 is rewritten to loopback). A --uri passed to docker run instead of the variable is invisible to the check, so give it the same one:

    healthcheck:
      test: ["CMD", "/usr/src/.venv/bin/python3", "-m",
             "wyoming_faster_whisper.health_check",
             "--uri", "tcp://127.0.0.1:10400"]

GPU Image

Dockerfile.gpu runs the speech-to-text backends on an NVIDIA GPU. It is not published to Docker Hub — you build it yourself, because it comes out around 10.7 GB (mostly the CUDA torch wheel) against ~1.6 GB for the CPU image, and Home Assistant OS has no GPU passthrough, so everyone who can use it is already running Docker directly.

git clone https://github.com/OHF-Voice/wyoming-faster-whisper.git
cd wyoming-faster-whisper
docker build -f Dockerfile.gpu -t wyoming-whisper:gpu .

Running it needs the NVIDIA Container Toolkit on the host, and --gpus:

docker run -it --gpus all -p 10300:10300 -v /path/to/local/data:/data \
    wyoming-whisper:gpu --language en

--device cuda is the default in this image; pass --device cuda:1 to pick a GPU or --device cpu to fall back. The default faster-whisper model is Systran/faster-whisper-small (float16) rather than the int8 model used on the CPU, and a GPU can comfortably run much larger ones:

docker run -it --gpus all -p 10300:10300 -v /path/to/local/data:/data \
    wyoming-whisper:gpu --model Systran/faster-whisper-large-v3 --language en

Notes and limits:

  • NVIDIA and amd64 only. CTranslate2, which faster-whisper is built on, has no ROCm or Intel XPU backend and publishes no arm64 CUDA wheel. The torch-based backends (--stt-library transformers, --stt-library funasr) would work on ROCm or XPU, but that would be a different image.
  • Budget the disk. ~10.7 GB for the image, plus build cache. Don't build it on a Pi by accident.
  • --stt-library sherpa runs on the CPU even in this image. A CUDA sherpa-onnx build exists, but sherpa-onnx bundles its own onnxruntime, and two CUDA-enabled onnxruntime builds in one process segfault. Its default Parakeet models are int8, which the CUDA provider gains little on, so the CPU wheel is the better half of that trade.

If --device cuda produces no speedup, check the log: the server warns when the installed onnxruntime or sherpa-onnx build has no usable CUDA support.

GPU Without Docker

For a local install rather than a container, the two onnxruntime-based backends have GPU counterparts of their extras — onnx-asr-gpu and qwen3-asr-gpu, which pull onnxruntime-gpu in place of onnxruntime:

pip install 'wyoming-faster-whisper[transformers,onnx-asr-gpu,qwen3-asr-gpu]'

faster-whisper additionally needs a CUDA-enabled CTranslate2 and torch built for your CUDA version, and it depends on onnxruntime (for its bundled Silero VAD), which will pull the CPU package back in and clobber onnxruntime-gpu — both install the same onnxruntime module and whichever lands second wins, silently, since the CPU provider still loads every model. Reinstall onnxruntime-gpu last. Dockerfile.gpu does exactly this and is the working reference.

Environment Variables

Every command-line option can also be set from the environment, which is what Docker Compose gives you to configure a container without rewriting its command:. The variable is the option's name, uppercased, with dashes as underscores and a WYO_WHISPER_ prefix:

Option Variable
--model WYO_WHISPER_MODEL
--language WYO_WHISPER_LANGUAGE
--stt-library WYO_WHISPER_STT_LIBRARY
--onnx-quantization WYO_WHISPER_ONNX_QUANTIZATION
--vad-endpointing WYO_WHISPER_VAD_ENDPOINTING
--hass-token WYO_WHISPER_HASS_TOKEN
...and so on for every option in --help

Precedence: a command-line argument always wins over the environment, so a variable left over in a container can never silently override an explicit argument. A variable that starts with WYO_WHISPER_ but matches no option is reported at startup rather than ignored, so a typo doesn't leave the server running with a default you thought you had changed.

A few options don't take a plain string on the command line, so they read one specially:

  • Flags (--debug, --vad-filter, --local-files-only, ...) take 1/true/yes/on or 0/false/no/off/empty. Unlike a plain "is it set?" test, WYO_WHISPER_DEBUG=false really does mean off.
  • --data-dir, which can be repeated, splits on : — WYO_WHISPER_DATA_DIR=/data:/media/models. Passing any --data-dir on the command line replaces the list rather than adding to it.
  • --vad-clip, which takes any number of values, splits on commas or spaces. Empty means the flag with no values, i.e. every library.
  • --zeroconf, whose value is optional, takes the name to announce, or empty for the default name.

Any other variable left empty means the same as not setting it at all, which is what a compose file or a .env produces for a value whose author left it blank. An empty WYO_WHISPER_URI gets you argparse's "the following arguments are required", not a server that starts up and fails on an empty string.

Secrets

Each variable also has a _FILE form naming a file to read the value out of: WYO_WHISPER_HASS_TOKEN_FILE=/run/secrets/hass_token. That is the convention Docker Compose and Swarm secrets use — a secret is mounted as a file rather than handed over as a variable — and it keeps a long-lived Home Assistant token out of both the process's command line and its environment. The file is preferred over the plain variable when both are set, and its trailing newline is stripped.

services:
  whisper:
    image: rhasspy/wyoming-whisper
    ports:
      - "10300:10300"
    volumes:
      - ./data:/data
    environment:
      WYO_WHISPER_MODEL: tiny-int8
      WYO_WHISPER_LANGUAGE: en
      WYO_WHISPER_HASS_API: http://homeassistant.local:8123/api
      WYO_WHISPER_HASS_TOKEN_FILE: /run/secrets/hass_token
    secrets:
      - hass_token

secrets:
  hass_token:
    file: ./secrets/hass_token.txt

In the Docker image, --uri, --data-dir, and --device have defaults baked into the entrypoint; those are dropped when the matching variable is set, so WYO_WHISPER_URI and friends work there too.

Nearby in the ranking

AI Rank for iPhone

Follow AI model rankings

Download on the App Store