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.

System context: PowerConduit talks to the speech service over Deepgram's wire format, with Deepgram as fallbackPowerConduitaudio, commandsWS /v1/listen, POST /v1/speak,a key on every requestpartials, finals, PCM audioonly when the serviceis unreachableAppsAndroid, desktopvccdthe PowerConduit serviceUnidatum SpeechCPU only, Deepgram shapesDeepgram cloudfallback only

Components

Components: a Go front, fast workers for partials, final workers for punctuated text, a TTS worker, all pinned to a CPU budgetGo front (pinned to the fast cpus)Fast workers (1 thread per cpu)Final workers (2 threads each)TTS workeraudio, textaudio framespartials, endpointone utterancetextClientWebSocket or HTTPAuth, session limit,ordered outputModel routingby languageRetention storehourly JSONL, 1 daySupervisorrestarts dead workersSilero VADStreaming FastConformer80 ms, sherpa-onnxParakeet-TDT 0.6B v3English finalsWhisper small, int8other languagesKokoro v1.0through sherpa-onnxCPU budget checkhalf the cores, P-cores only

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.

One live stream: partials from the fast worker while you speak, one punctuated final after the pauseClient (vccd)Go frontFast workerFinal workerWebSocket /v1/listen with key and queryconnection open (401 bad key, 503 full)loop: 16 kHz linear16 audio, 100 ms framesbinary audio frameaudiopartial text, lower-case: Results is_final falseendpoint after the pause (endpointing 300-350 ms)the whole utterancepunctuated final with word timesResults is_final true, speech_final trueif the final pass takes longer than 8 s, the fast text is sent as the finalCloseStreamMetadata, then close

Model routing

Model routing: English goes to Parakeet, other languages and auto-detect to Whisper; partials come from the English streaming modelende, fr, es ... or multien or multiStream or filewith a language parameterlanguage?Parakeet-TDT v3fast, ignores keytermsWhisper smallmultilingual, keyterms as promptStreaming FastConformerEnglish partials onlyPunctuated finalwith word timesPartialslower-case, every 80 ms

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 than max_cpus.
  • Performance cores only on the hybrid Intel desktop: with exclude_efficiency_cores = true the 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_setaffinity and 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 /speak with {"text","voice","speed"}: PowerConduit's Kokoro sidecar style, raw PCM with an X-Sample-Rate header.
  • WS /v1/speak: Speak, Flush, Clear, Close in; binary audio, Metadata, Flushed, Cleared out. This is the route a voice assistant uses, because Clear is 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.

Where it runs: one profile file per host, checked against the CPU budget at startRunning nowPrepared, not deployedprivate network onlyvccd and other clientskey from config, never in codei9-14900K desktop8 P-core threads, systemdMac mini M4launchd, 4 slotssecond i9 desktophalf the cores, profile onlyMac mini M1profile onlyEC2 compute-optimisedsame binary, internal LB

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. Only linear16 audio 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_final nor UtteranceEnd for a turn; clients should also end a turn on held finals after a timeout, as PowerConduit does.