A voice pipeline for ESPHome satellites that keeps Home Assistant out of the voice path. It connects to the device over the ESPHome native API, the same way HA does, and answers its voice_assistant events itself.
flowchart LR
sat["ESPHome satellite"]
stt["STT<br/>Wyoming"]
llm["LLM"]
mcp["MCP servers<br/>streamable HTTP"]
tts["TTS<br/>Wyoming"]
sat -- " voice_assistant events,<br/>mic audio (ESPHome API) " --> sirin(["Sirin"])
sirin --> stt
tts --> sirin
sirin -- " answer as WAV over HTTP,<br/>played by its media_player " --> sat
stt -. " text " .-> llm
llm -. " tool calls " .-> mcp
mcp -. " tool response " .-> llm
llm -. " text deltas " .-> tts
pip install -e . curl -fL --create-dirs -o models/silero_vad.onnx \ https://raw.githubusercontent.com/snakers4/silero-vad/v6.2.3/src/silero_vad/data/silero_vad.onnx echo "1a153a22f4509e292a94e67d6f9b85e8deb25b4988682b7e174c65279d8788e3 models/silero_vad.onnx" | sha256sum -c sirin # -v logs protocol events
The Docker image already contains the VAD model and the voice models. To recognize voices without Docker, download the voice models too; without them Sirin runs as before and logs that voices are not recognized:
voxlock=https://huggingface.co/arbazsiddiqui/voxlock/resolve/2413b292bc2c337bfc19a9802aaf3e011e68e9c4/onnx/v2 curl -fL --create-dirs -o models/voices/speaker.onnx \ https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/wespeaker_en_voxceleb_resnet34_LM.onnx curl -fL -o models/voices/enroll.onnx $voxlock/enroll.onnx curl -fL -o models/voices/chunk.onnx $voxlock/chunk_int8.onnx sha256sum -c <<EOF e9848563da86f263117134dfd7ad63c92355b37de492b55e325400c9d9c39012 models/voices/speaker.onnx 81f305c9b7a32f13d1401f53bb4c6301826a607c9e807e60912f36ef1b9fae29 models/voices/enroll.onnx c50ffdc8d723fd4f91cb08889f3d0143491f95967b705f35c444a0b4afe88172 models/voices/chunk.onnx EOF
Or with Docker:
docker compose up -d --build
The compose file publishes port 8765 from a bridge network, where Sirin cannot see the address satellites reach it at, so set SIRIN_PUBLIC_URL=http://<host LAN address>:8765 in .env; compose refuses to start without it. Settings are kept in ./data. CI publishes a multi-arch image (amd64, arm64) to ghcr.io/<owner>/sirin, which the compose file pulls unless you pass --build.
Then open http://<host>:8765/ and log in. At the first start Sirin creates the account admin and writes its
generated password to the log (docker compose logs sirin); change it with Password at the top of the page. A
forgotten password is replaced with sirin --reset-password <login> (in the container:
docker compose exec sirin sirin --reset-password admin). The admin adds people in the People card; a member can
log in and change their own password, and only an admin sees and edits the settings. The satellites need no login.
Fill in devices, STT, TTS, LLM and MCP servers. The LLM block can hold several models (for example a local one and a cloud one); active picks the one in use, and the system prompt is shared by all of them. Each block has a Test button: it checks the connection with the unsaved values and fills suggestions (TTS voices, ASR languages, LLM models, wake words of a device). Settings are stored in
the SQLite database data/sirin.db and applied without a restart. The JSON files of older versions (settings.json, reminders.json, oauth/) are not
read: configure a new install from the page.
Environment variables (or .env):
| Variable | Default | Purpose |
|---|---|---|
SIRIN_PUBLIC_URL |
this host's address on the route to each satellite, with SIRIN_PORT |
Base URL satellites download answers from; set it only behind a proxy or NAT |
SIRIN_HOST / SIRIN_PORT |
0.0.0.0 / 8765 |
HTTP server address |
SIRIN_AUDIO_TTL_S |
300 |
How long a finished answer stays downloadable |
SIRIN_DATA_DIR |
data |
Where the settings page stores its settings |
SIRIN_VAD_MODEL |
models/silero_vad.onnx |
Silero VAD ONNX model file |
SIRIN_VOICE_MODELS |
models/voices |
Directory with speaker.onnx, enroll.onnx and chunk.onnx; voices are recognized when it exists |
The settings page has no login. Keep the port reachable only from a trusted network.
MCP servers can use OAuth: turn on oauth, save, and press Authorize. The provider's login opens in a new tab and returns to /oauth/callback at the address you opened the settings page with. Tokens are kept in the database and refreshed automatically. The server must be saved under its current URL before you authorize it; changing its URL drops its tokens.
- ESPHome with
voice_assistantand audio over the API (any recent firmware). - A
media_playeron the device: the answer is played from a URL on this service. - For reminders, firmware with
voice_assistantannounce support (theANNOUNCEfeature flag). - Only one client can hold the voice subscription. If the device is also added to HA, disable its Assist pipeline in HA or remove the device from the ESPHome integration.
Every stage streams:
- mic → STT. Chunks go to the Wyoming ASR as they arrive. The server decides where the utterance ends: the device streams until the server sends
STT_VAD_END. End-of-utterance detection is Home Assistant's segmenter on top of the Silero VAD model (SIRIN_VAD_MODEL); tune it withvad.*on the settings page. - LLM → TTS. The pydantic-ai agent yields text deltas, including what the model says between tool calls. If the TTS server accepts streaming input (
supports_synthesize_streaming), the deltas go straight to it; otherwise the text is split into sentences and each one is synthesized as soon as it is complete. - TTS → device. The answer URL is sent in
RUN_START, andINTENT_PROGRESS tts_start_streaming=1follows the first audio. The device downloads the WAV while it is still being synthesized.
If the model fails (unreachable, timeout, too many tool rounds), the device says llm.error_reply instead of the answer; write it in the language you speak. With an empty error_reply the device gets an error event, as it does for STT and TTS failures.
When the answer ends with a question, the device listens again right after it, without the wake word (continue_conversation, the same rule Home Assistant uses). If nobody replies, the model is told that the user did not answer and decides what to say or do; the device does not listen again after that turn. To stop a model that ends every answer with a question, say so in the system prompt.
Dialog history is kept per device conversation_id for conversation_ttl_s seconds. MCP tools are exposed to the LLM with a <server>_ prefix. A server that is down or loses its connection is skipped and tried again every few seconds, up to once a minute, until it answers.
With the voice models in place, every speaker the devices hear becomes a voice: a turn of 1.5 seconds of speech or more that matches no known voice creates one, and it is recognized from then on. Nobody has to introduce themselves. On the Voices tab and in History, a person claims a voice: open a turn you said and press This is me. The voice is then yours, and so are its past turns. One person can own several voices (one speaker split in two, or a voice far from the microphone): each is recognized as that person. Not this voice takes a wrongly matched turn out of a voice. A member sees and manages only their own voices; the admin sees all of them, links them to people and deletes the unclaimed ones. An unclaimed voice disappears by itself once the history retention has removed its last turn.
A voice's profile is the mean of its confident turns: long enough, close to the profile, and close to every turn its person confirmed with This is me. A turn matched by mistake therefore does not pull the voice away, and you can take it out again.
For each utterance Sirin compares the first 1.5 seconds of speech with the known voices. The user's turn reaches the
LLM tagged with the person's name ([Voice: Anna] ...), or [Voice: not recognized] for a voice nobody claimed. A
claimed voice whose voiceprint exists also isolates: from that speech on, the audio goes through a target-speaker
network (VoxLock) that keeps only that voice, and each isolated stretch is compared with the voice again and muted
when it is somebody else, so another person or a TV that talks on after the command neither adds words to it nor
keeps the device listening. The voiceprint (about 10 MB) is made from the first turn of that voice with 3 seconds of
speech or more; the audio itself is not stored. Unclaimed voices never mute anything, so a TV cannot become the
voice that silences people.
Voices live in the database. When the voice models change, all voices and the embeddings of all turns are dropped.
Limits:
- The audio starts after the wake word, so the voice is taken from the first speech after it, not from the wake word itself.
- A command shorter than about a second is often too short to tell the voice; it is then recognized unchanged.
- If another voice is as loud as the speaker and talks at the same time, the network can keep the wrong one. That stretch is muted and the command is lost or cut.
- It is a convenience, not access control: a recording of a voice passes as that voice.
- Isolation takes about a quarter of one CPU core while a claimed voice speaks.
- How well short far-field phrases group into voices has not been measured yet; expect one person to collect several voices at first.
Besides the shared MCP servers on the settings page, every person can add their own on the My tools tab (for example their mail or calendar), with the same Test and Authorize buttons. The assistant offers a person's tools only in the turns where it recognizes that person's voice, and in the reminders that person set. A server's name is the prefix of its tools, so it must differ from the shared servers' names. The admin sees who has which server and whether it is connected, but not its address or headers.
A voice match is not access control: someone with a similar voice, or a recording, can get your tools too.
Every utterance is kept as one turn: the device, what was recognized, the answer, the tool calls with their results,
the time each stage took, an error if there was one, and how similar the voice was to the closest remembered one. The
History tab shows them newest first, filtered by device and day, and adds new turns while you watch. Everybody who
can log in reads it; nobody can edit it. A wake word followed by no speech is not kept. Turns older than
history.retention_days (30 by default, on the settings page) are deleted, except a turn that set a reminder which is
still pending.
The agent has built-in tools set_reminder, list_reminders and cancel_reminder ("remind me to turn off the stove in 10 minutes", "remind me tomorrow to eat", "every day at 8 tell me the weather", "every hour from 8 to 10 until Friday remind me to drink water"). A recurring reminder has a cron schedule in local time (0 8-10 * * *) and repeats until it is canceled or until its end time. When it sets a reminder, the LLM writes a note to itself. At the due time the agent runs that note, with all its tools, and the device that set the reminder announces the answer. Reminders are kept in the database and survive a restart. The Reminders tab lists the pending ones with who set them (the person of the voice that asked) and cancels them: a member sees and cancels their own and sees the ones nobody is known to have set; the admin sees and cancels all. If the device is offline, the reminder is retried every 30 s for up to an hour, then dropped. Reminders that came due while the service was down are dropped at startup; a recurring reminder skips that occurrence and stays scheduled for its next time.
Times are in the process's local time zone, the same one the LLM gets with each user turn ([Time: ...]). In the container, set it with TZ (see docker-compose.yml).