Repository navigation
Unsloth Desktop: voice mode speaks a thinking filler, judges turn ends with small local models, and shows what it hears (part C) - #14084
Open
LeoBorcherding wants to merge 385 commits into
Conversation
This reverts commit 94d15b1.
…shed turns" This reverts commit 391d264.
…s decision-log rows" This reverts commit 46223dd.
…e orb Stroke 5 to 6.5, radius 106 to 110; the box is derived from them.
… voice/pr-b-thinking-filler
… sends The interrupt model's hold waited for playback to end on its own, and a barge-in cuts playback without that firing, so held speech sat for minutes and then went as a stale prompt of its own. The next utterance that commits now carries the held ones with it, a repeat of a held line counts as insisting and restarts the request, and the same line is never held twice.
… voice/pr-b-thinking-filler
…read Cancelling a run that had not produced a token left it in "cancelling" for good: the engine dropped the task, the event stream never closed, and the first-token wait kept renewing the lease every 30 s, so the sweeper never settled it and every later turn on the thread was refused with "already has an active generation". The producer now stops draining a few seconds after the cancel and settles the run as cancelled, polling the cancel on a half-second tick instead of the renew interval. The voice loop also asks the server whether the old run is gone before starting the coalesced one, instead of trusting the local running flag.
…rries its confidence The detector was asked after 250 ms of loudness but needed 300 ms of voice in the probe, so the first check failed every time and the reply only stopped on the second or third try. The barge probe now needs 200 ms. The bar over the reply's bleed drops from 3x to 2x; the detector already rejects bleed. The filler route's confidence now reaches the decision readout.
…s slide and the icon cross-fades The spectrum contour was a fresh clip-path on every animation frame. It now writes at most 30 a second on a will-change layer, with the smoothing buffers and the unit circle allocated once and an attack/release on each band so the edge glides instead of jittering. The decision ring moves its fill along the track with a stroke-dashoffset transition instead of jumping, the value label cross-fades, and the filler arc shows the model's confidence now that the decision carries one. State changes cross-fade the glyph in one grid cell and ease the glow and body colour in 250 ms.
Transcribing or thinking can be over in under 100 ms, and the raw derived state flashed the icon and colour for a frame. A small timer-injected scheduler (orb-dwell.ts) now sits between deriveOrbState and the store: a displayed state keeps the screen for ORB_DWELL_MS before the newest raw state replaces it, only the newest is ever pending, and hearing, speaking and the loop stopping still land at once. Unit tests cover the ordering.
The overlay was seen in listening with Voice unticked in the + menu. The orb state now drops to null at the dwell whenever the loop is off, the overlay also checks the store's mode, and every displayed state change is traced.
Three scripted tweens over the pulsing amber body dropped frames in the desktop webview; a compositor-driven translate does not.
… while the answer is written The classifier choosing silence left an eleven-second gap on a slow question with nothing said; after 2.5 s with nothing playing a short bridge now goes out. "Almost there" was a thinking phrase, said while twenty seconds of thinking remained; it now goes out once reply text is arriving and the first sentence has not played, which is the gap where it is true, and lands ahead of that sentence.
Every barge-in trades the two, and the 250 ms glow, the 180 ms scaled icon fade and the 220 ms caption (exit then enter) added up to half a second of swap that read as lag. Glow 100 ms, icon a 90 ms fade with no scale, caption 90 ms each way, and the gradient no longer carries a transition it could not animate anyway.
…s wait for the rest "Can you hear me?" asked three times over its own reply being thought out restarted the run each time and threw the thinking away, so the answer came after the third try. An utterance that shares most words with the pending prompt now keeps the run and says a still-on-it line; a real restart waits 1.8 s instead of 650 ms so what follows stacks into one run; and the quiet bridge is said once per stretch of restarts, not once per restart.
… answer An aside joined the sentence queue and was synthesized in turn, so it came out seconds after the moment it was for, often as "almost there" followed at once by the answer. Asides now play from a cache the moment they are decided, only when nothing is on the timeline and no reply sentence is being synthesized; a first-time phrase that is ready after the reply caught up is dropped. The fixed phrases are synthesized into the cache while the loop is idle, once the voice has loaded.
…, echo flips your/my, bulb inset
…its models; the Voice menu item unloads them
…g; voice off clears the orb state
…llback on a short quiet turn
…ange, trace device and mute state
…nd drop when synthesized too late
# Conflicts: # studio/frontend/src/features/chat/adapters/studio-voice-loop-adapter.ts # studio/frontend/tests/voice-loop-guards.test.ts [skip ci]
…f; attachment-wait anchor [skip ci]
# Conflicts: # studio/frontend/src/features/chat/voice/voice-engine.tsx # studio/frontend/tests/voice-loop-guards.test.ts [skip ci]
# Conflicts: # studio/frontend/tests/voice-loop-guards.test.ts [skip ci]
# Conflicts: # studio/frontend/src/features/chat/adapters/studio-voice-loop-adapter.ts # studio/frontend/tests/voice-loop-guards.test.ts
…en orb leaves Escape to other pages
# Conflicts: # studio/frontend/src/components/assistant-ui/voice-orb.tsx [skip ci]
…tinuation holds the reply; speech waits for the current pick's slot
# Conflicts: # studio/frontend/src/features/chat/adapters/studio-voice-loop-adapter.ts # studio/frontend/src/features/chat/chat-page.tsx # studio/frontend/tests/voice-detector-release.test.ts [skip ci]
…the CPU, one voice load per reply - The dictation mic was wrapped in a div, so the 22rem composer rule that shrinks '.aui-composer-action-wrapper > button' no longer reached it. Render it conditionally instead. - Start PulseVAD on the CPU: nothing frees the detector for training or chat, so on the GPU it held memory until Studio exited. - A failing voice load was retried and toasted once per sentence; once per reply now. - Turning Voice off while the mic was starting showed a false microphone error. [skip ci]
[skip ci]
… a speech request A voice ejected from Loaded models kept voiceSlotLoaded set, so the next reply named an unloaded voice; with switch model by request on and multi-model off, that loaded it as the chat model. [skip ci]
…r reply A voice ejected while queued clips played was still named by the reply's later sentences.
… slot not ready [skip ci]
Etherll
force-pushed
the
voice/pr-b-thinking-filler
branch
from
November 19, 2026 02:30
81cd8eb to
ed1e7fd
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge order
#16955 (read aloud in sentences) copies this PR's
voice/speech-text.tsandvoice/tts-chunk-plan.tsso it can merge on its own, with a few splitter fixes. Whichever of the two lands second drops its duplicate copy and keeps those fixes.Stacked on #12384 (part A): the diff includes that PR's commits until it merges, and everything here needs its voice loop. Nothing in it is required for part A or the latency benchmark in #12385 (part B) to work. This is part C.
Small local models for the loop (trained for this, served from Hugging Face, ONNX int8 on CPU, 1 to 3 ms each):
Orb: the edge is a live spectrum of the mic or the reply, state colours match the app palette, the ring arcs show the judge, filler and interrupt decisions, and a ripple plus caption show every VAD and transcript verdict (kept or dropped, and why).
Voice picker: a built-in speaker dropdown for voices that list several, read from the model's status once loaded. OmniVoice is labelled as picking a new speaker per sentence until a saved voice is chosen (a fixed seed and a voice description were both measured not to hold it).
Fixes found by using it: turns said while the voice loads are parked and sent as one prompt, a held fragment no longer doubles, a barge-in during thinking no longer leaves the reply paused, queued questions collect instead of overwriting each other, the last word is no longer cut by the mic re-arm, the voice is checked to be serving before a turn is sent, a stop button while the reply is still being spoken, and the mic reopens on its own when the device changes or an earbud comes out.
Tracing: with
UNSLOTH_VAD_DEBUG_DIRset the loop writes a JSONL trace of every decision beside the VAD clips, which is how each of the fixes above was found.Tested on this Mac (M-series, Unsloth Desktop build from the branch, gemma-4-12b-it GGUF as the chat model, PocketTTS and OmniVoice as voices, Parakeet STT, PulseVAD). The models' training data and reports are in the Hugging Face repos.