Expand description
Speech-to-text (STT) modality primitive: transcribe(audio) -> text behind a
swappable engine seam.
Three engines, one dispatch (transcribe_wav_detailed):
- parakeet (default where the
voice-parakeetfeature is compiled): the in-process ONNX engine — the genuinely in-process hot path, never IPC (seeparakeet). - whisper: forwarded to a local whisper.cpp voice server’s
/inference(a thin HTTP proxy). - gateway: the swappable cloud STT slot, routed through the Gateway’s
/v1/audio/transcriptionswith the per-attributex-ryu-slot-stt-*headers (a thin HTTP proxy).
Per the Core-vs-Gateway rule the dispatch is a Core concern (it decides
what runs — which local voice engine handles the audio); this crate owns the
reusable transcription logic + result types, while the host couplings it
cannot own — the whisper base-url, the Gateway url/bearer, and the parakeet
model directory — are injected via the narrow SttHost trait. The crate has
ZERO dependency on apps/core (mirrors ryu-search’s SearchEmbedder seam).
Modules§
- parakeet
- Parakeet v3 voice (STT) engine — ONNX-based, runs alongside whisper.cpp.
Structs§
- Transcript
Segment - One timestamped transcript segment. Serialized camelCase
(
startMs/endMs/text) so it matches the cross-surface clip contract. - Transcription
- A transcription result: the full text plus optional timestamped segments.
Segments are populated whenever the engine returns them (Whisper
verbose_jsonvia the Gateway or local whisper.cpp); parakeet returns text only, so itssegmentsis empty.
Traits§
- SttHost
- Narrow host seam for the STT dispatch: the couplings the crate cannot own
because they read Core config/paths (the whisper sidecar base-url, the Gateway
url + bearer, and the extracted parakeet model directory). Core implements
this in
apps/core/src/stt_host.rs.
Functions§
- default_
stt_ engine - The cross-surface default STT engine, resolved as a swappable default (never
a hardcoded literal). Parakeet v3 (in-process ONNX) is the default whenever
this build compiled the
voice-parakeetfeature. Lean builds omit the feature and default to whisper.cpp so transcription still works there.RYU_STT_ENGINEoverrides both, so one env var re-points every surface. - transcribe_
wav - Transcribe raw audio bytes to text. Routes to the in-process parakeet engine
(the default — see
default_stt_engine) or the whisper.cpp voice server (engine == Some("whisper")). - transcribe_
wav_ detailed - Like
transcribe_wavbut also returns timestamped segments when the engine provides them (Whisperverbose_jsonvia the Gateway or local whisper.cpp). Parakeet (the in-process default) returns text only, so its segments are empty.