Skip to content

refactor(inference): adopt native voice runtime helpers - #604

Merged
senamakel merged 9 commits into
epic/8092-inference-outfrom
leaf-254-native-runtime-voice
Oct 21, 2026
Merged

senamakel merged 9 commits into
epic/8092-inference-outfrom
leaf-254-native-runtime-voice

Conversation

@senamakel

Copy link
Copy Markdown
Owner

Adopt TinyInference's native voice runtime helpers for local-AI readiness/status, file and byte transcription, and Piper synthesis while keeping OpenHuman's STT provider selection, credentials, prompt guard, inference gate, and TTS output-path security checks in the host.

The STT adapter constructs the configured host provider lazily so native audio validation preserves the existing error precedence. It also retains OpenHuman's path-bearing missing/empty-file error messages while leaving provider errors untouched.

Validation on source 6bbc9a73426b25e13ac697e6fe13f06408f5873b:

  • cargo fmt --all -- --check — pass
  • cargo check --manifest-path Cargo.toml — pass
  • cargo check --manifest-path crates/openhuman-app/Cargo.toml — pass
  • strict all-target Clippy for contributor defaults and shipped core product features — pass
  • focused host runtime tests — 26 passed
  • raw-coverage transcription controller regression — pass
  • full product inference workspace lane — 122 test blocks, 582 passed, 0 failed, 0 ignored

pnpm rust:layout still reports six existing over-limit files on the epic base; none are changed by this PR.

senamakel and others added 9 commits October 21, 2026 20:35
…service

Status snapshots now come from the service with the configured provider
applied, and readiness is handled by ensure_ready instead of an inline
state check. Raw audio transcription passes bytes straight to the service
rather than round-tripping through a temporary file.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Speech transcription now accepts raw audio bytes alongside the existing
file-path entry point, sharing a common provider adapter so both routes
dispatch through the configured STT provider. The piper TTS invocation was
also reworked to use the shared process helper.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a capturing STT provider and a test asserting that the native
transcription helpers forward audio bytes, mime type, and file name to the
host provider, including normalization of an uppercase mime type and a
default file name for buffer input.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Shortened the provider-overlay comment in the local AI status snapshot to state the behaviour without the stale-cache history, and dropped the audio byte count from the STT completion log since the metadata read only fed that message.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The configured STT provider now holds a factory closure instead of a
pre-built provider, so the provider is constructed lazily when a
transcription is actually requested. This avoids building the provider
during dispatch setup and keeps construction errors scoped to the call
that needs it.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduced a type alias for the boxed provider factory closure used by
ConfiguredSttProvider, replacing the inline trait object type. This keeps the
struct definition readable and gives the factory signature a single place to
change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the speech service and runtime ops to match rustfmt output,
including import ordering, line wrapping, and function signature layout.
No behaviour change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Transcription failures from the voice layer were surfaced with the
internal `[voice-stt]` prefix and without the audio path, making them
hard to attribute. Errors for unreadable or empty audio files are now
rewritten to include the host path, and a test covers the mapping.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the transcribe_file call chain so the await and error mapping
wrap onto their own lines. No behaviour change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit b6c49a3 into epic/8092-inference-out Oct 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant