How it works
Two models, one Go front, a CPU budget
Unidatum Speech is a single binary and a few Python workers. The front speaks Deepgram's protocol; the workers hold the models; a profile file per host says which cores they may use.
System context
PowerConduit's service, vccd, is the first client. It opens a WebSocket to /v1/listen for each conversation and posts to /v1/speak for replies, with a key on every request. Because the wire format is Deepgram's, vccd uses the same client code for both, and falls back to Deepgram only when this service is unreachable or refuses the stream.
The service listens on a private address only. It is not a public endpoint and has no account system: a short list of keys in a private environment file, and HTTP 401 for anything else.
Components
Go front
Authentication, the session limit (HTTP 503 when full), the Deepgram message shapes, ordered output per stream, a retention store of final text in hourly files purged after one day, Prometheus metrics at /metrics, /health, and a supervisor that restarts a dead worker. It costs 0.002 to 0.006 cores and about 14 MB.
Fast workers
One process and one thread per cpu. Silero VAD finds speech; the streaming FastConformer (80 ms chunks, sherpa-onnx) emits lower-case partials and the endpoint when the pause has lasted endpointing milliseconds. A stream is pinned to one fast worker, so these cpus set the number of live streams.
Final workers
Two threads each. Parakeet-TDT 0.6B v3 for English, Whisper small (int8, CTranslate2) for other languages and detection. Each takes one whole utterance and returns punctuated text with word times and a confidence. If a final takes longer than 8 s the fast text is sent instead, counted in final_fallbacks_total.
TTS worker
Kokoro v1.0 through sherpa-onnx, 24 kHz 16-bit mono. Text is split into sentences and each is streamed as soon as it is ready, so the first audio arrives after about one sentence. One thread per speaker; a full queue answers 503 with Retry-After.
Wire between Go and Python
Length-prefixed frames over pipes: audio in, partials, endpoints and finals out. The worker protocol is described in service/worker/unidatum_worker/wire.py, so a different model can be dropped behind the same frame.
Profiles
One TOML file per host: the cpu list per role, worker counts, model directories, the session cap, timeouts, the retention period and defaults such as language = "en" and endpointing_ms = 300. unidatum-speech -check -config file validates a plan without starting.
One live stream
The client sends 16 kHz, 16-bit mono PCM in frames of about 100 ms at real-time pace. Every frame goes to the fast worker; partials come back as Results with is_final: false, lower-case and unpunctuated, each replacing the last. When the pause ends the utterance, the whole utterance goes to a final worker and the punctuated final comes back as Results with is_final: true and speech_final: true.
Measured medians on the desktop: first partial 0.95 s after speech starts (the streaming model looks ahead before it emits), English final 0.75 s after speech ends (p90 1.07 s), Whisper final 1.7 s. Those include the 300 ms of silence that ends the utterance.
Control messages are Deepgram's: KeepAlive, Finalize (forces the pending final, returned with from_finalize: true), CloseStream (pending finals, then Metadata). Configure is accepted and ignored. Optional events: SpeechStarted with vad_events=true and UtteranceEnd after utterance_end_ms of silence.
Model routing
Routing is by the language parameter, not by model (which is accepted, so nova-3 is fine, and ignored). English goes to Parakeet: fast, accurate, and deaf to keyterms. Any other language code goes to Whisper small, which also takes up to 50 keyterm values as a prompt. multi means Whisper with language detection.
Partials exist for English only, because the streaming model is English; other languages get finals only. A final replaces the partials and can differ from them. On the Mac profiles the Parakeet list is longer (English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Romanian), set by parakeet_languages in the config.
Measured accuracy of the final pass on clean English: Parakeet v3 2.6% word error rate, Whisper small 4.0%. End to end through the Deepgram SDK: 3.3% and 3.85%.
The CPU budget is a rule, not a default
- At most half the cores per host (
max_fraction = 0.5), and never more thanmax_cpus. - Performance cores only on the hybrid Intel desktop: with
exclude_efficiency_cores = truethe service refuses to start if any assigned cpu is an efficiency core, or if cpus overlap or are offline. The measured reason: efficiency cores give roughly half the capacity (a Parakeet stream lags 1.35 s there against 0.71 s on a performance core). - One hardware thread per core. The desktop layout is fast workers on cpus 0, 2, 4; final workers on 6+8 and 10+12; text to speech on 14. Cpus 14 and 15 are the hyperthreads of one core, so a second TTS thread there adds nothing (RTF 0.56 against 0.53).
- Low priority. The front is pinned to the fast cpus; workers pin themselves with
sched_setaffinityand run at nice 10, so other jobs on the machine win. - On macOS there is no pinning; the cpu numbers in a Mac profile are slots that count threads against the budget.
Text to speech
Three routes, all streamed sentence by sentence as 16-bit mono PCM (24 kHz by default, 8 to 48 kHz selectable):
POST /v1/speak?model=aura-2-thalia-en&encoding=linear16&sample_rate=24000&container=wav|none: Deepgram's shape.aura-2-*names map to Kokoro voices (GET /v1/voices).POST /speakwith{"text","voice","speed"}: PowerConduit's Kokoro sidecar style, raw PCM with anX-Sample-Rateheader.WS /v1/speak:Speak,Flush,Clear,Closein; binary audio,Metadata,Flushed,Clearedout. This is the route a voice assistant uses, becauseClearis how an interruption stops the speech.
Speed: real-time factor 0.56 on one free desktop core (first audio 0.88 s), 0.76 / 0.41 / 0.28 on a Mac mini M4 with 1 / 2 / 4 threads. One core carries one speaker: two speakers on one core run at RTF 1.00 and fall behind. Voices are English-first; Piper for other languages is not built. An optional Fish Audio cloud provider (provider=fish, off by default) can answer /v1/speak with Fish's voices; it sends the text to Fish Audio and is the only route by which anything leaves the machine.
Where it runs
Linux: a tarball, packaging/install.sh (downloads about 1 GB of models and checks their hashes), a systemd user unit, keys in a private environment file. macOS on Apple silicon: packaging/install-macos.sh and a launchd agent, no root. The unit of scaling is the profile file; there is no built-in load balancing, so several hosts sit behind a round-robin proxy that can read sessions and capacity from /health.
Today it runs on an Intel Core i9-14900K desktop (eight performance-core threads: seven for speech to text, one for TTS) and on a Mac mini M4 (four slots). A second desktop and an M1 Mac mini have profiles prepared and nothing installed; a compute-optimised EC2 fleet is costed but not built.
Known limits, plainly
- The clean-speech benchmark is a ceiling. Phone audio, noise, accents and names will be worse, and the real-world word error rate is not measured yet.
- Parakeet (the English route) ignores keyterms; only the Whisper route uses them. There are no hotwords on the fast path. Short words are the weak spot: "check my email" can come out as "Jack my email".
- Partials are lower-case, unpunctuated and English only, with word times that are token emission times (late by about 0.3 s). Finals have acoustic times.
- Finals arrive later than Deepgram's: 0.7 to 0.9 s with Parakeet, 1.7 to 2.6 s with Whisper small, against about 0.3 to 0.5 s for Deepgram. PowerConduit compensates with 350 ms endpointing instead of 800.
- No diarization, redaction, numerals formatting, multichannel output, callbacks or
/v1/agent/converse. Onlylinear16audio in (8 to 96 kHz, 1 or 2 channels), resampled to 16 kHz. - The Whisper route has a minimal hallucination guard only.
- Retention is one day of final text in hourly files; no audio is ever stored. Correction learning is a design item only.
- The service may send neither
speech_finalnorUtteranceEndfor a turn; clients should also end a turn on held finals after a timeout, as PowerConduit does.