Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Local Live Voice — Rebuild Plan
- Status: Accepted 2026-10-01. P0 (measurement) done on Windows/NVIDIA and Linux CPU, Mac pending hardware; P1 (engine core) built and measured, see section 12. P2 (Dodaios integration) is next.
- Date: 2026-10-01
- Decision record: ADR-0037
- Supersedes: the recovery plan in
local-realtime-runtime-deep-dive.md(2026-08-08) and the backlog inlocal-realtime-supervisor-assessment.md(2026-08-11). Both stay as history. - Scope: the
local-realtimeprovider (the "Local voice" card): live, full-duplex voice with every model on the user's machine. GPT-Live, Gemini Live, OpenAI Realtime and the classic pipeline are out of scope, except where they share thedodaios/liveseam.
1. Summary
Local live voice does not work, and the evidence says it cannot be repaired in
place. No local call has produced audio since 2026-08-27. The managed engine
(Hugging Face speech-to-speech==0.2.12, patched) loads every model before it
opens its port, needs the network on every boot, serves one call at a time,
stops listening while it speaks, and needs at least 12 GB of accelerator memory.
Its installer cannot resolve on macOS, has never run on Linux, and refuses every
machine without a large NVIDIA card or Apple unified memory. Dodaios wraps it in
5,770 lines of supervision code that exist only to manage that process's failure
modes.
We replace the engine, not the live seam. A Dodaios-owned voice engine runs as
one child process with its own Python environment, speaks a small private
protocol over stdin/stdout, and implements the existing
RealtimeProvider/RealtimeSession contract. NativeLiveVoiceSession, the
tool layer and the browser audio path therefore stay. Inside the engine a small
cascade runs: Silero VAD, Smart Turn v3.2, Parakeet TDT 0.6B v3, a streaming
local LLM through Ollama, and a three-step TTS ladder (Piper, Pocket TTS,
Qwen3-TTS). Speech models run on the CPU by default; a GPU (CUDA or Apple MLX)
is used only where a measured self-test shows it helps. That makes a usable
core tier possible on every machine, including CPU-only Linux, and leaves the
GPU to the language model.
2. Evidence: what fails today
Sources: data/local_realtime_server.log and .log.1 (2026-08-07 to 09-26),
data/local_realtime_server.boot.json, data/flight_recorder/*.jsonl, the
managed venv, and the working tree on 2026-10-01. Numbers are observations on
the maintainer's Windows box (RTX 5070 Ti, 16 GB) unless marked otherwise.
2.1 Usage
| Signal | Observed |
|---|---|
| Local sessions 2026-08-07 to 08-28 | 108; 45 (42 %) produced any audio; 49 completed no turn |
| Last session with audio | 2026-08-27 20:12 (first audio after 12.5 s) |
| Last attempt | 2026-08-28 15:33, "realtime handshake exceeded 135.0s provider budget" |
| Sessions on the native path (since 2026-09-18) | 0; the path has never carried a real local call |
2.2 Boot
| Signal | Observed |
|---|---|
| Server generations | 174, of which 93 (53 %) never became ready |
| Why never ready | 47 offline: Hugging Face HEAD requests and an NLTK download on every boot, five retries per file, killed at the budget, respawned every ~5 min. 27 LLM warm-up timeouts: the engine aborts Ollama's model load after ~20 s. 6 Ollama not running. 13 stopped without an error line. |
| Spawn to ready (supervisor statistics) | 68 / 110 / 150 / 178 / 251 s (median 150 s); one boot on 09-26 took ~418 s |
| Idle release | [voice].local_idle_release_minutes = 15 stops the server; the warm loop re-arms only after a call ends, so most calls after a pause start cold |
2.3 Latency (speech end to first audio)
| Signal | Observed |
|---|---|
| First audio per user turn (n = 82) | p50 4.63 s, p90 12.9 s; none at or below 1.2 s |
| Stage p50 / p90 | STT 1.03 / 4.15 s, LLM 1.11 / 6.08 s, TTS first audio 0.35 / 1.00 s |
| Fixed waits in the launch flags | +800 ms "speculative reopen grace" on every complete turn; +2,000 ms when Smart Turn says "incomplete" |
| Worst turn under GPU contention | 49.8 s (09-26: STT 13.7 s, LLM 15.0 s, TTS first audio 19.8 s) |
2.4 Capacity, duplex, resources
- One pipeline slot: 12 "all 1 pipeline slots in use" rejections and 3 sessions that never drained.
- Half duplex: the engine's VAD drops audio while it answers, and Dodaios sends
interrupt_response=false. The user cannot interrupt. - VRAM: the spawn gate asks for 6 GB free. The stack needs about 12–14 GB (brain with a 32K context, Qwen3-TTS 1.7B with CUDA graphs, Parakeet) on a card that already carries ~9.4 GB of other GPU users. Under that pressure the TTS warm-up took 77 s to its first audio.
- On Windows every spawn opens a visible terminal window:
DETACHED_PROCESSoverridesCREATE_NO_WINDOWfor the console-script launcher (supervisor.py::_server_creationflags). Closing that window kills the server. - Health and proof drift: the install proof dates from 2026-08-08 and a
different brain; a pinned
pocket-ttsis missing from the venv while the status says ready;data/state/local_models_health.jsonreports "voice ok" with fresh timestamps while nothing runs.
2.5 Platform reach
Only Windows was ever run. The rest comes from code and wheel metadata.
| Platform | Today |
|---|---|
| macOS, Apple Silicon | The install cannot resolve. speech-to-speech 0.2.12 on Darwin requires transformers==5.6.2, torch==2.11.0 and MLX packages; Dodaios pins qwen-tts==0.1.1 (transformers==4.57.3), faster-qwen3-tts==0.3.2 (transformers<5) and torch==2.13.0. |
| Linux + NVIDIA | Below 12 GB refused. At 12 GB and above it needs a CUDA-13 driver, sm_75 or newer and the native qwentts-cpp-python package. Never run. |
| AMD/Intel GPU, CPU-only, headless | Refused by design ("no supported accelerator"). |
2.6 The call path since 2026-09-18
Commit 8f43cfc98 gave LocalRealtimeProvider native_tool_orchestration=True.
build_realtime_session (dodaios/realtime/factory.py:484) therefore hands
local calls to NativeLiveVoiceSession (dodaios/live/native.py). That path:
- never calls
can_open_duplex_session(). The 0.75 s honest refusal with a boot ETA is gone;audio_startblocks inside the provider's 120 s connect loop while the desktop waits up to 140 s; - ends a failed start with a generic, unspoken
provider_error; - uses only
providers[0]: configured fallbacks are ignored, and the free classic local pipeline is never offered; - skips the 5 s voice tool budget, the per-provider declaration budget (it declares up to 52 tools, 24 KB of JSON, to a 4–9B model), the scrub gate and output-language validation;
- maps
speech_started/interruptedonly to a browser flush. Nothing cancels the engine's response; - opens the local socket with
[brain.realtime].modelfirst, which after a switch from GPT-Live still readsgpt-live-1.
2.7 Why not repair in place
| # | Cause | Kind |
|---|---|---|
| 1 | Models load serially before the port binds; a healthy boot looks dead for minutes | Structural (inside the third-party engine) |
| 2 | Network on every boot; offline means a crash loop | Fixable, but every engine upgrade brings it back |
| 3 | One model copy per pipeline slot; deaf while answering | Structural (upstream redesign #363 is open, not shipped) |
| 4 | Serial stages behind one lock, fixed grace waits, every tool call a full extra LLM pass | Structural and fixable |
| 5 | Memory budgeted by label (12 GB floor), not by the measured workload | Structural (the stack really needs ~12 GB) |
| 6 | Mac, Linux and CPU unreachable | Structural (dependency set) |
| 7 | Native seam gaps (2.6) | Fixable, and fixed by this plan |
| 8 | Visible console window, stale health and install proofs | Fixable |
Fixing the fixable items leaves 1, 3, 5 and 6. They are properties of the
engine and its dependency set. Upstream speech-to-speech 1.0.0 (2026-09-06)
improves macOS and Linux, but its smoke tests cover only Linux and Apple
Silicon on Python 3.11, its fast GGML TTS path has no Windows wheel, and it
still binds one model copy per pipeline. It is the runner-up (section 5), not
the answer.
3. Requirements
- R1 Platforms. macOS 14+ on Apple Silicon; Windows and Linux with NVIDIA (Pascal to Blackwell, 6 GB and up); any x86-64 or arm64 machine on the CPU, including headless Linux (audio then comes from a browser tab on another device, as today). Every platform either works or says in one sentence why not and what to do.
- R2 Languages. German and English first; Spanish next (Piper voices exist). A language without a local voice says so.
- R3 Tools. The live model calls Dodaios tools through
LiveTools/ToolExecutor; results arrive withinVOICE_TOOL_BUDGET_Sor as an honest pending result. - R4 Turn-taking. Automatic end of turn by default (
turn_pause_ms=None). An explicit Settings pause is folded into the engine's own detection, never layered on top. Barge-in works while Dodaios speaks. - R5 Latency. Speech end to first audio p50 ≤ 0.8 s and p95 ≤ 1.2 s on NVIDIA with 8 GB or more and on Apple M-Pro/Max; measured and shown everywhere else.
- R6 Readiness. Once the user selects local voice, no model loads on the call path. A call during warm-up gets an honest spoken and visible state within 1 s.
- R7 Process integrity. One engine per app instance; it dies with Dodaios; no orphans, no port, no LAN listener.
- R8 Offline. After setup nothing touches the network at runtime.
- R9 Install. One click in the app, resumable, with progress; no hand-edited config, no tokens, no gated models, no GPL or non-commercial weights.
- R10 Ownership. Dodaios owns the real-time loop. Third-party code is limited to model runtimes behind small interfaces.
4. Target architecture
4.1 Overview
WebView (mic 48 kHz with echo cancellation, playback)
| /ws/audio (unchanged)
v
Dodaios app process
NativeLiveVoiceSession -- LiveTools -- ToolExecutor (seam kept, fixes in 4.4)
| RealtimeProvider / RealtimeSession
LocalVoiceProvider adapter (pure Python, any app interpreter 3.11-3.14)
| stdin/stdout, length-prefixed frames (protocol v1, 4.5)
v
Voice engine worker (child process, own uv venv, CPython 3.12)
audio 16 kHz -> Silero VAD -> Smart Turn v3.2 -> Parakeet v3 (speculative)
| final transcript
Dodaios decides the language, requests a response
v
LLM stream (Ollama, OpenAI-compatible, tools)
| text deltas | tool_call -> Dodaios -> tool_result
v
clause chunker -> TTS ladder -> audio 24 kHz
barge-in: VAD stays live while speaking -> cancel LLM + TTS -> interrupted
| HTTP on loopback
v
Ollama (separate service, managed by dodaios/brain/ollama_runtime.py), voice profile resident
4.2 Process model
- One worker per Dodaios instance, started by the adapter with
asyncio.create_subprocess_execandNO_WINDOW_CREATIONFLAGS(AP-1) inside adodaios/core/process_tree.pytree (Windows Job Object with kill-on-close, POSIX process group). - The worker exits on stdin EOF, so it dies with Dodaios. There is no pidfile, no lease, no port and no adoption logic. Two app instances (live and dev) get two workers; the memory gate (4.9) refuses a second premium stack honestly.
- Stdout carries only protocol frames. Logs go to a rotated file under the data dir and to stderr.
- The LLM stays in Ollama, a separate long-lived service. An app restart reloads only the speech models (seconds), not the language model. This replaces the old reason for letting the server outlive the app.
- Why not in the app process: CUDA and ONNX in the desktop process is what the dictation lane moved out (os-parity P-41, AP-24); a native crash would take the app down; and the latency-critical loop must not share the app's event loop, which already stalls under load.
4.3 Engine internals
Per session: listening -> user_speaking -> turn_pending -> responding (thinking | speaking | tool_wait) -> listening.
- Audio in. PCM16 at 16 kHz from the adapter (the session already resamples the browser's 48 kHz).
- VAD. Silero VAD v6 as an ONNX file loaded directly (no torch), 32 ms frames.
- Turn decision. After ~200 ms of trailing silence, Smart Turn v3.2
(ONNX, int8, CPU) scores the last ≤ 8 s. "Complete" ends the turn;
"incomplete" keeps listening for a bounded extension tuned in the bake-off
(8.5). An explicit
turn_pause_msreplaces the silence threshold and biases toward "incomplete";Noneadds nothing. - STT. Parakeet TDT 0.6B v3 int8 (sherpa-onnx offline recognizer) decodes as soon as the silence starts; if the user resumes, the result is dropped. The final transcript therefore costs almost nothing after the turn decision (RTFx 31–35 measured by onnx-asr on a desktop CPU).
- Response. The engine emits
input_transcript(final). Dodaios resolves the reply language once (dodaios/core/turn_language.py) and callsrequest_response()(creates_responses_automatically=False). The pipe round trip costs milliseconds. - LLM. Streaming chat completion on the voice profile (4.6). Text deltas feed a clause chunker: sentence end, or a clause boundary after a minimum length; aware of numbers and abbreviations in German and English.
- TTS. The first clause goes to TTS at once; later clauses queue. Audio leaves as PCM16 at 24 kHz, with output transcript deltas aligned to the clauses.
- Tools. A
tool_callpauses the LLM round and goes to Dodaios; thetool_resultresumes it. Heavy work classes get the ADR-0033 instant acknowledgment, spoken by the same engine voice. - Barge-in. VAD keeps running while the engine speaks (the browser's echo
cancellation removes Dodaios's own voice). Confirmed user speech (≥ 250 ms,
optionally a non-empty partial transcript) cancels the LLM stream and the
TTS queue, emits
speech_startedandinterrupted, and truncates the assistant turn in the history to the audio actually sent. - Cancellation. One token per response; every stage checks it between units of work (AP-19).
4.4 The seam: adapter contract and dodaios/live fixes
Adapter dodaios/plugins/realtime/local_voice.py (registered in the
jarvis.realtime entry-point group; the module loads nothing from dodaios.*):
- Class attributes:
supports_realtime=True,native_tool_orchestration=True,browser_audio=True,implicit_usage_fallback_allowed=False,credential_candidates=(),input_sample_rate=16000,output_sample_rate=24000,external_login_ready(cfg)(engine installed),from_runtime_config(cfg),prespawn_transport(start the worker, load models),warm_transport(await ready),handshake_budget_s≤ 5 s. can_open_duplex_session()answers from the worker's state in under 50 ms;duplex_unavailable_reasoncarries the user sentence and the ETA.open_session(cfg)sendssession.openwith instructions, language, tools and history. The session implementssend_audio,receive,request_response,send_tool_result,send_text,interrupt,truncate,update_sessionandclose, withcreates_responses_automatically=False,isolates_response_generations=Trueandsupports_tool_results=True.send_imageexists only when the selected LLM accepts images.
Fixes in dodaios/live/native.py. Gemini Live shares this file, so each fix
gets a regression test on both providers:
- Call
can_open_duplex_session()beforeopen_session(); refuse within 1 s with the provider's reason, spoken and visible (reuse_announce_start_failure). - Pass the provider's own model setting, never another provider's
[brain.realtime].model. - On
speech_startedwhile Dodaios speaks, callconnection.interrupt()and flush the browser. - Apply the 5 s
VOICE_TOOL_BUDGET_Sdeadline with an honest pending result (port the logic fromdodaios/realtime/session.py). - Respect a provider's
tool_declaration_budget_tokens. For the local engine, declare a curated direct set plusdiscover_tools/call_tool(4.6). - Forward the per-turn language decision with
update_session(language=...)beforerequest_response(). - When local voice is not ready and a fully local classic pipeline exists,
offer it. It is keyless, so the billing rule behind
allow_classic_fallback=Falsedoes not apply. Never fall back to a billed provider.
LiveTools, LiveLedger, recovery, runtime ownership, /ws/audio and the
browser client stay unchanged.
4.5 Protocol v1 (worker and adapter)
Frame: 4-byte big-endian length, 1-byte kind (J = UTF-8 JSON, A = PCM16
audio with an 8-byte header for session and sequence), payload. The version is
negotiated in hello.
Adapter to worker: hello{protocol, app_version},
configure{profile, models, voices, llm{base_url, model, options}, limits},
session.open{id, instructions, language, tools, history, turn_pause_ms},
audio frames, response.request{language}, tool.result{call_id, result},
text{content, kind}, interrupt, truncate{audio_end_ms},
session.update{instructions?, tools?, language?}, session.close,
selftest{suite}, shutdown.
Worker to adapter: hello{protocol, capabilities, engines},
state{phase, stage, progress, eta_s, reason}, speech_started,
transcript.input{partial|final, text, language, voiced_ms},
transcript.output{delta}, audio frames, tool.call{call_id, name, args},
response.done{status}, interrupted{self_initiated},
usage{input_text, output_text}, metrics{turn_id, stage timings},
error{code, message, recoverable}.
The adapter maps these one to one onto RealtimeEvent. The protocol does not
depend on the transport; a loopback WebSocket for a remote GPU machine would be
an added transport, not a redesign.
4.6 LLM
- Runtime. Ollama by default: Dodaios already installs, starts and stops it
on all three OSes. llama.cpp
llama-serveris a later alternative because of its prompt-cache control and prebuilt binaries for CUDA 12/13, Vulkan, ROCm, Metal and CPU. - Voice profile. A dedicated alias with
num_ctx=8192(4K is too small once a tool result arrives; more only costs prefill time), thinking off (reasoning_effort="none"on the OpenAI endpoint), kept resident while local voice is selected (keep_aliverefreshed by the engine), low temperature for tool rounds. - Prompt layout. Static system prompt and tool declarations first, history after, the per-turn directive last, so the prefix cache hits. The bake-off measures cache hits per runtime, because hybrid and sliding-window models (Qwen3.5) have regressed here before.
- Tools. A curated direct set of 8–12 frequent tools with compact schemas,
plus
discover_tools/call_toolfor the rest, within about 2K tokens. Every discovery step costs a full LLM round, so the direct set matters more locally than in the cloud. - Model per tier comes from the bake-off (8.2). Candidates: Qwen3.5 4B/9B, Ministral 3 3B/8B, Granite 4.2 3B/8B, Gemma 4 E4B/12B. No public measurement of German tool calls with thinking off exists; this is the largest open risk.
- Coupling. Selecting local voice marks Ollama as in use, so
dodaios/local_models/autostart.pystarts it at boot even when the Local models switch is off. During a local call, background work must not queue new generations on the same Ollama host.
4.7 Components
Defaults, to be confirmed or replaced by the bake-off.
| Role | Default | Runtime per platform | Size | Licence |
|---|---|---|---|---|
| VAD | Silero VAD v6 | onnxruntime CPU, all platforms | 2 MB | MIT |
| Turn | Smart Turn v3.2 (23 languages incl. German) | onnxruntime CPU, all platforms | 8 MB | BSD-2 |
| STT | Parakeet TDT 0.6B v3 (25 European languages) | sherpa-onnx int8 on CPU, all platforms; optional parakeet-mlx on Mac | 0.64 GB | CC-BY-4.0 |
| TTS floor | Piper (German thorsten, English, Spanish) | sherpa-onnx CPU, all platforms | ~60 MB per voice | Apache-2.0 runtime; per-voice cards |
| TTS natural | Pocket TTS (Kyutai, 100M; de, en, fr, es, it, pt, nl) | CPU torch, all platforms | 100M parameters | code MIT, weights CC-BY-4.0 (non-cloning repo) |
| TTS premium | Qwen3-TTS 0.6B / 1.7B (10 languages incl. German) | faster-qwen3-tts on CUDA (cu130 for Blackwell, cu126 for Pascal); mlx-audio on Mac | 2.5 / 4.5 GB + 0.7 GB tokenizer | Apache-2.0 |
| LLM | per tier (4.8) | Ollama (CUDA, ROCm, Metal, CPU) | 1.3–7 GB | per model (Apache-2.0 candidates) |
Excluded: Kokoro (no official German); XTTS-v2, Voxtral TTS, Fish/OpenAudio,
F5-TTS base weights and Higgs (non-commercial or research licences); the
LiveKit turn detector and TEN VAD (use restrictions); GPL piper1; gated
repositories (they need a user token); Supertonic (archived in 2026-09, pinned
fallback at most); native speech-to-speech models (as of 2026-10 none is
German-capable, small and cross-platform at once).
4.8 Capability tiers chosen by a measured self-test
Hardware detection only decides what to try. Setup then runs a 30–60 s self-test: STT real-time factor, TTS first audio and real-time factor per voice, LLM first token and tokens per second on the voice profile, and one synthetic round trip. It picks the highest tier that meets the latency target, and the card shows the measured expected response time.
Defaults after the P0 bake-off (section 12); speech always runs on the CPU.
| Machine class | LLM (Ollama) | Default voice | Premium option | Expected first audio |
|---|---|---|---|---|
| CPU only, incl. headless | qwen3.5:2b |
Pocket if its real-time factor ≥ 1.5, else Piper | — | ~2 s, labelled slow (estimate) |
| Mac 16 GB, base chip | qwen3.5:4b (unmeasured) |
— | 1.2–1.8 s (estimate) | |
| Mac Pro/Max | qwen3.5:4b (unmeasured) |
Qwen3-TTS via MLX after measuring | 0.8–1.2 s (estimate) | |
| NVIDIA 6–8 GB | qwen3.5:4b |
— | see section 12 | |
| NVIDIA 12 GB and up | qwen3.5:4b |
Qwen3-TTS 1.7B if the listening test favours it | see section 12 | |
| AMD or Intel GPU | qwen3.5:4b through Ollama ROCm/Vulkan |
— | measured by the self-test |
No 8–12B model called tools better than the 4B, and all were slower
(section 12.3), so the free memory of larger cards goes to the voice, not to a
bigger LLM. gemma4:12b-it-qat stays an opt-in for the best German on 16 GB+.
Premium keeps at least 20 % accelerator headroom at steady state. The gate
reads free memory (NVML on NVIDIA; available unified memory on macOS, a new
read in dodaios/hardware/detection.py), never the card's label.
4.9 Lifecycle, readiness and failure behaviour
- States:
not_installed -> installing(progress) -> stopped -> starting(stage, progress, eta) -> ready -> degraded(reason) -> failed(reason, log tail). - Ready means every selected engine passed a real inference in this process run: synthesize a phrase, transcribe it back, generate one LLM token. An open socket, files on disk or an old marker never count.
- Start: on selection (prepare, then hand over), at boot when selected (after the boot gate, AP-26), and lazily on a call. Targets: core ready within 15 s from a warm disk, premium within 60 s.
- A call during warm-up gets an answer within 1 s: "Local voice is still loading (about N s)", spoken and shown. It never waits 140 s in silence.
- Crash: worker exit becomes
error(recoverable=False); the session ends with a spoken reason; the worker restarts with backoff 1 s, 5 s, 30 s; three failures within 10 min meanfailed, with the log tail on the card. - Degrade, don't die: if premium TTS fails to load or runs out of memory,
the worker drops to Natural or Core and reports
degradedinstead of failing the call. - Idle: speech models stay resident while local voice is selected (core needs about 1.5 GB of RAM). Premium VRAM may be released after a configurable idle time; the worker reads that setting (AP-31).
- Offline: models live in a Dodaios model store with checksums. The worker
runs with
HF_HUB_OFFLINE=1and makes no NLTK or other network calls.
4.10 Install and packaging
- Environment:
uv venv --python 3.12under the data dir, using the uv bootstrap thatdodaios/society/browser/bootstrap.py::ensure_uvalready provides. It is independent of the app's interpreter and absent from the base install. - Locks: one hashed lock per platform profile, generated in CI:
win-x64-cpu,win-x64-cuda13,win-x64-cuda12(Pascal),mac-arm64,linux-x64-cpu,linux-x64-cuda13,linux-arm64-cpu. Core needs onlyonnxruntime,sherpa-onnxandnumpy(40 MB). Natural adds CPU torch (0.12–0.2 GB download). Premium adds CUDA torch (2 GB on Windows) andfaster-qwen3-tts, ormlxandmlx-audioon Mac. - Worker code: a self-contained pure-Python package (
dodaios/voice_engine/, nododaios.*imports). The installer copies it into the engine venv from the app's own files, so frozen builds work and no Dodaios code is downloaded. - Models: downloaded once with progress and resume, checksummed, from ungated repositories. Core ≈ 0.8 GB; Pocket adds a small checkpoint; Premium adds 3.2–5.2 GB.
- Proof: setup ends with the self-test. Its result is bound to the exact engine version, lock and model checksums; any change invalidates it.
- Uninstall removes the venv and the models and offers to delete the old
data/local_realtime/tree (several GB).
5. Decisions and alternatives
Each decision lists the recommended option first, then the runner-up and why it loses.
- Engine: a Dodaios-owned cascade (recommended). HF
speech-to-speech 1.0.0behind a new supervisor loses: untested on Windows, no Windows wheel for its fast TTS path, still one model copy per pipeline. Native speech-to-speech models lose: none is German-capable, small and cross-platform. - Process: one child worker over stdin/stdout (recommended). A loopback WebSocket server with a per-start token loses: a port brings back bind conflicts, firewall prompts and orphaned servers, three failures the old stack actually had, while the pipe ends the worker when Dodaios dies. An in-process engine loses on AP-24, P-41 and crash isolation.
- Real-time loop: our own, about 2,000 lines (recommended). Pipecat 1.12 (pinned) loses: its API changes roughly every two weeks, its frame and interruption model would again put third-party behaviour on our critical path, and it solves none of the hard parts here (install, readiness, memory). It stays a reference for turn and interruption handling.
- Speech on CPU by default, GPU by measurement (recommended). GPU-first loses: ONNX Runtime GPU on Blackwell needs custom builds, CUDA 12 and 13 split by GPU generation, and the GPU is the scarce resource the LLM needs.
- LLM through Ollama (recommended). An in-worker LLM loses:
llama-cpp-pythonships no wheels, and the model would reload on every app restart. - Provider id: new
local-voiceduring the build,local-realtimealiased to it at cutover (recommended). Reusinglocal-realtimefrom day one loses: old and new engines must run side by side for the bake-off.
6. Delivery plan
A phase is done when its gate passes, not when its code is merged. Day counts are rough planning estimates.
Status 2026-10-01: P0 passed on Windows NVIDIA and the CPU container; the Mac
run waits for hardware. P1: code complete; the real-time latency gate (p50
≤ 1.0 s) and the kill drill passed; the 500-turn soak and a boot with the
network unplugged are still open (section 12.4). P2: built — the native.py
fixes (4.4, items 1–6), the local-voice provider with a [voice_engine]
config, one-click setup (dodaios/realtime/local_voice_setup.py) and the Local
voice card; one setup on Windows/NVIDIA ended ready with a passed self-test.
Open P2 gate items: 20 real calls through the app, the GPT-Live ↔ local switch,
a light-mode check of the card body, and item 7 (local classic fallback).
| Phase | Content | Gate |
|---|---|---|
| P0 Measurement bench (2–3 d) | Worker skeleton with a bench CLI that needs no Dodaios: de/en corpus with hesitations, numbers and tool requests; synthetic audio; every measurement in section 8 that needs no UI |
Numbers for 8.1–8.5 and 8.7 on Windows NVIDIA, the maintainer's Mac and a CPU-only python:3.11-slim container; tier defaults chosen from them |
| P1 Engine core (4–6 d) | Protocol v1; VAD, turn and speculative STT; LLM streaming with tools; clause chunker; Piper and Pocket; barge-in; cancellation; self-test; metrics; logs | Standalone p50 ≤ 1.0 s on Windows NVIDIA (core tier); 500-turn soak without memory growth; kill drill leaves zero processes; boot with the network unplugged |
| P2 Dodaios integration (3–4 d) | local-voice adapter; dodaios/live/native.py fixes (4.4); card with setup progress, self-test, tier and expected latency; prepare-then-handover switch; Ollama coupling |
20 real calls, 0 silent failures; barge-in p95 ≤ 250 ms; GPT-Live to local and back without restart; Gemini Live regression tests green |
| P3 Installer and platforms (4–6 d) | uv venv, per-platform locks in CI, model store, uninstall; Mac and Linux runs | Fresh-install drill on Windows, macOS (real Apple Silicon) and the CPU container; Linux NVIDIA stays marked unverified until run on hardware |
| P4 Premium voice (3–5 d) | Qwen3-TTS on CUDA and MLX; free-memory governor; degrade path | First audio p50 ≤ 300 ms on 12–16 GB NVIDIA; ≥ 20 % headroom; an out-of-memory drill degrades instead of failing |
| P5 Cutover and removal (2–3 d) | Alias local-realtime to local-voice; delete the old stack (section 9); update docs/os-parity.md (P-28, P-40); mark old docs superseded |
CI gate green; no reference to speech-to-speech left outside history |
7. Release SLOs
| SLO | Target |
|---|---|
| Speech end to first audio | p50 ≤ 0.8 s, p95 ≤ 1.2 s on NVIDIA ≥ 8 GB and Mac Pro/Max; measured and shown elsewhere |
| Barge-in to silence | p95 ≤ 250 ms |
| Open session when ready | p95 ≤ 150 ms |
| Honest refusal when not ready | ≤ 1 s, spoken and visible |
| Ready after selection, warm disk | core ≤ 15 s, premium ≤ 60 s |
| Boot success, offline included | ≥ 99 % |
| Orphans after kill and crash drills | 0 |
| Worker crash to restarted | ≤ 5 s |
| Tool calls, curated set, de/en | ≥ 90 % right tool with valid arguments on the bake-off corpus |
| Accelerator headroom, premium, steady state | ≥ 20 % |
8. Bake-off protocol
- Latency per tier, split into turn decision, STT final, LLM first token, first clause, TTS first audio and playback; p50/p95, warm, one device per class; de/en corpus with hesitations.
- Tool-call accuracy in German and English with thinking off, on the real Dodaios catalog, at least 200 utterances per language: right tool, valid JSON, no invented results; direct set against discover-then-call; candidates from 4.6.
- Second-turn first-token time with the prefix cache, Ollama against llama-server, 8K profile, hybrid and sliding-window models included.
- German TTS quality: ASR round-trip error rate on numbers, dates, abbreviations and anglicisms; blind A/B with native speakers; first audio, real-time factor and underruns per device, for Qwen3-TTS 0.6B/1.7B, Pocket and Piper.
- Turn-taking: cut-off rate and late-answer rate on German thinking pauses; Smart Turn thresholds; with and without a Settings pause.
- Barge-in through each WebView's echo cancellation (WebView2, WKWebView, WebKitGTK): speech start to silence p95; false interruptions per minute from echo and noise.
- Memory: steady-state and peak VRAM or unified memory with every component resident plus typical desktop load; cold start to ready; provider switch time.
- Soak: 500 turns in German and English with interruptions, tool calls and injected out-of-memory and crash faults; leaks, orphans, recovery.
9. Keep, rewrite, delete
| Area | Lines | Fate |
|---|---|---|
dodaios/realtime/local_server/ (supervisor 2,752, install 1,024, model_catalog 468, brain_link 336, boot_progress 309, preflight 241, patching 191, configure 176, tiers 129, smoke 119, __init__ 25) with patches/ and pins/ |
5,770 | Delete at P5. Ideas kept: transactional model switch (configure), stage and ETA reporting (boot_progress), round-trip probe (smoke) |
LocalRealtimeProvider in dodaios/plugins/realtime/openai_realtime.py |
~920 | Delete at P5; the cloud OpenAIRealtimeProvider and _OpenAIRealtimeSession stay |
Managed-server routes in dodaios/ui/web/provider_routes.py |
~460 | Replace with local-voice setup, status and self-test routes; realtime_switch gets prepare-then-handover |
ManagedServerPanel in ProviderTierSection.tsx and its types in useProviders.ts |
~1,080 | Replace with a smaller card that works in light and dark mode |
Local-realtime writers in dodaios/core/config_writer.py |
~160 | Replace with a structured config block instead of a launch-command string |
Tests: tests/unit/realtime/local_server/, test_local_realtime.py, test_local_output.py, test_brain_link.py |
4,248 + 1,344 | Delete with the code; new tests use tests/fakes/ plus a real-engine smoke job |
dodaios/live/*, dodaios/realtime/{protocol,factory,audio}.py, /ws/audio, browser client |
— | Keep; native.py gets the fixes in 4.4 |
dodaios/brain/ollama_*, dodaios/local_models/autostart.py, dodaios/hardware/detection.py, dodaios/speech/local_models.py, the Piper, Nemotron and faster-whisper plugins, dodaios/core/process_tree.py |
— | Keep and reuse. local_models/health_monitor.py stops refreshing a stale voice block; detection.py gains free unified-memory reads |
Estimated new code: worker about 2,000–2,500 lines, adapter about 300, installer about 600, card about 400, against about 8,400 lines of product code removed.
10. Risks
- German tool calls of small models with thinking off are unmeasured. Reliable tools may need an 8B+ model, which would leave 6–8 GB machines with weaker tools. Mitigation: bake-off first; a small curated tool set.
- Prefill on base Apple Silicon (118–221 tokens/s for a 7B model on M1 to M4 base chips) puts 0.8 s out of reach there; the card shows the measured value instead.
- CUDA split: Blackwell needs CUDA 12.8/13 or newer, and CUDA 13 dropped Maxwell, Pascal and Volta. That means two GPU lock lines, and the Windows CUDA torch wheel weighs about 2 GB.
- Prompt-cache regressions for hybrid and sliding-window models in llama.cpp and Ollama would re-process the whole prompt on every turn; measure per runtime version.
- Echo cancellation for barge-in is proven only in WebView2. WKWebView and WebKitGTK need measuring; the fallback is half duplex with a headphones hint.
- Licences and maintenance: a third-party ONNX export of Pocket TTS is marked non-commercial (we use the torch package instead); Supertonic is archived. Every model is pinned by revision and checksum.
- GPU sharing with background local work; mitigated by the call-time gate in 4.6.
- Parallel work on the old stack: uncommitted changes to the old engine's timeouts and boot ETA exist in the shared tree while this plan is written. That work is superseded at P5.
11. Not verified yet
- macOS: nothing was run there yet (no hardware); every Mac statement still comes from documentation and wheel metadata.
- Linux was run only as a CPU-only
python:3.11-slimcontainer; Linux NVIDIA is unverified. - Turn-taking on real speech (hesitations, false cut-offs) needs recorded voices; the synthetic hesitation set is invalid because TTS prosody gives the pause away.
- The P1 gates "500-turn soak" and "boot with the network unplugged" (beyond
HF_HUB_OFFLINE=1) are still open.
12. Measured results (P0/P1, 2026-10-01)
Machine: Windows 11, 8-core desktop CPU, 34 GB RAM, NVIDIA RTX 5070 Ti
16 GB, with other work running (often under 6 GB RAM free); container:
python:3.11-slim, 4 vCPU, no GPU. Commands are in
python -m dodaios.voice_engine.bench; reports land in the engine home, not in
the repo.
12.1 Speech recognition (Parakeet TDT 0.6B v3 int8, CPU)
On synthetic speech the word error rate is 3.5–4.3 % in German and under 1 % in English. A whole utterance decodes in p50 135–170 ms on the desktop (about 16× real time, p95 under 270 ms) and 225 ms in the 4 vCPU container. Parakeet drops a first word that starts at sample 0, so the engine appends a short noise-floor tail and the bench pads 0.2 s.
12.2 Voices (German, first audio and speed)
| Voice | First audio | Speed | Character error rate after re-transcription |
|---|---|---|---|
| Piper (thorsten medium) | 71–92 ms | ~30× real time | low, robotic sound |
| Pocket TTS | 83 ms (136 ms in the container) | ~4× (2.57× in the container) | 1.9 % |
| Qwen3-TTS 1.7B (CUDA) | 240 ms | 1.9× | 3.1 %, ~4.5 GiB VRAM |
| Qwen3-TTS 0.6B (CUDA) | 226 ms | — | 6.2 %, one sentence destroyed |
| Pocket large | — | 0.87× | too slow for live use |
Pocket is the default voice everywhere it reaches 1.5× real time; Piper is the floor. Qwen3-TTS 0.6B and Pocket large are dropped; Qwen3-TTS 1.7B stays a premium option pending a blind listening test.
12.3 LLM tool calling (Ollama, think: false, num_ctx 8192)
| Model | German score | English score | VRAM | Verdict |
|---|---|---|---|---|
qwen3.5:4b |
0.942 | 1.0 | 3.2 GB | default for every GPU class |
gemma4:12b-it-qat |
second best | — | 7.7 GB | opt-in, slower |
granite4.2:8b |
0.924 | 0.93 | — | best 8–9B, no gain over the 4B |
qwen3.5:9b |
0.11 | — | — | fails German, invents actions |
qwen3.5:2b |
— | — | CPU | CPU-only default, first clause ~1.5 s |
Small models also act on mood: asked "I'm so tired today" or for a sleep tip,
qwen3.5:4b set the volume, started music or a timer in 9 of 30 trials. One
engine rule ("act only on request", dodaios/voice_engine/engine.py) brought
that to 0 of 30 with 0 of 40 real requests missed. On qwen3.5:2b the same
rule only lowers it from 18 to 12 of 30, so the CPU-only tier still needs a
safeguard for changing actions before it ships (P3).
Ollama's prompt_eval_count includes cached tokens. Qwen3.5 does not reuse a
cached prefix across new conversations, so the engine primes the cache when a
session opens. The Mistral chat template defeats the cache.
12.4 End to end and process
| Check | Result |
|---|---|
Bench e2e, qwen3.5:4b + Piper |
dialog p50 749 ms, tool turn p50 990 ms |
Bench e2e, qwen3.5:4b + Pocket |
dialog p50 856 ms |
| Worker boot (Windows, all models) | 11.5 s to ready; self-test de/en character errors 0, LLM 390 ms |
| Worker memory | about 2.1 GB resident |
| Kill drill | worker gone 0.06 s after the app's pipe closes, 0 orphans |
Real-time worker, qwen3.5:4b + Piper, de+en (44 turns) |
dialog p50 685 ms, tool p50 951 ms, 0 unanswered |
Real-time worker, qwen3.5:4b + Pocket, de+en (44 turns) |
dialog p50 775 ms, tool p50 999 ms, 0 unanswered |
| Barge-in cut (from the user's speech onset, 20 trials) | p50 235–258 ms, p95 370–390 ms; 0 ms of reply audio after the cut |
The real-time runs stream synthetic speech at wall-clock pace through the worker's pipes and time speech end to the first audio frame the app receives. The barge-in p95 misses the 250 ms SLO mainly on the English "Stop", whose unvoiced "s" counts as onset here before the VAD hears voice; the cut needs 160 ms of voiced speech. | CPU container | boots and talks; STT 225 ms, Pocket first audio 136 ms |
Three Windows worker bugs found on the way, all fixed: a blocking stdin read
deadlocked a DLL load (the worker now peeks the pipe), library prints on stdout
corrupted the protocol (the protocol now owns a private copy of the pipe), and
Pocket probed a gated Hugging Face repo (HF_HUB_OFFLINE=1).
Sources
- Silero VAD: https://github.com/snakers4/silero-vad
- Smart Turn: https://github.com/pipecat-ai/smart-turn and https://www.daily.co/blog/announcing-smart-turn-v3-with-cpu-inference-in-just-12ms/
- Parakeet TDT 0.6B v3: https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3; sherpa-onnx export: https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-transducer/nemo-transducer-models.html; onnx-asr benchmarks: https://istupakov.github.io/onnx-asr/benchmarks/
- Pocket TTS: https://github.com/kyutai-labs/pocket-tts
- Qwen3-TTS: https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice; faster-qwen3-tts: https://github.com/andimarafioti/faster-qwen3-tts; MLX: https://github.com/Blaizzy/mlx-audio
- HF speech-to-speech 1.0.0: https://pypi.org/project/speech-to-speech/1.0.0/; shared-runtime design: https://github.com/huggingface/speech-to-speech/issues/363
- Pipecat: https://github.com/pipecat-ai/pipecat
- Ollama context length: https://docs.ollama.com/context-length
- llama.cpp throughput on Apple and CUDA: https://github.com/ggml-org/llama.cpp/discussions/4167 and https://github.com/ggml-org/llama.cpp/discussions/15013; prompt-cache issue: https://github.com/ggml-org/llama.cpp/issues/21831
- CUDA 13 architecture support: https://docs.nvidia.com/cuda/archive/13.0.1/cuda-toolkit-release-notes/index.html