speechcore
Reusable Rust speech-to-text runtime components for desktop and service applications.
speechcore contains reusable local STT building blocks: microphone capture,
Silero VAD segmentation, backend selection, model provisioning, transcript
streaming, and runtime state. It deliberately does not contain UI, clipboard
integration, system tray code, global shortcuts, or transcript enhancement
behavior.
What You Get
- Push-to-talk and real-time transcription orchestration.
- Audio capture via PortAudio.
- Silero VAD for speech segmentation.
- Pluggable transcription backends:
- CTranslate2
- Moonshine ONNX
- NVIDIA Parakeet ONNX
- NVIDIA Nemotron 3.5 ASR ONNX (streaming: cache-aware FastConformer + RNNT, with low-latency partials)
- whisper.cpp via
whisper-rswhen explicitly enabled
- Model cache and download helpers.
- Transcript and backend status streams for app-owned UI or service logic.
Installing
The default crate has no heavy native runtime features enabled. Applications should opt into the runtime and the backend they want:
= { = "0.1", = false, = ["runtime", "backend-whisper-cpp"] }
For a separate application repository, depend on the standalone repository once it has been pushed:
= { = "https://github.com/0xPD33/speechcore", = "v0.1.0", = false, = ["runtime", "backend-whisper-cpp"] }
For local development from this workspace:
= {
path = "../speechcore",
= false,
= ["runtime", "backend-parakeet"]
}
Feature Flags
Available features:
| Feature | Enables |
|---|---|
runtime |
SpeechEngine, RealTimeTranscriber, audio processing, VAD runtime, model downloads, WAV debug output |
all-backends |
CTranslate2, Moonshine, Parakeet, Nemotron, and whisper.cpp backends |
audio-capture |
PortAudio microphone capture |
vad-silero |
Silero VAD via ONNX Runtime |
model-downloads |
model cache and download helpers |
wav-output |
WAV debug output via hound |
backend-ctranslate2 |
CTranslate2 backend via ct2rs |
backend-moonshine |
Moonshine ONNX backend |
backend-parakeet |
Parakeet ONNX backend |
backend-nemotron |
Nemotron 3.5 ASR streaming ONNX backend |
backend-whisper-cpp |
whisper.cpp backend via whisper-rs |
ort-cuda |
ONNX Runtime CUDA execution provider |
ort-tensorrt |
ONNX Runtime TensorRT execution provider |
backend-whisper-cpp is intentionally opt-in at the library level. Apps that
also link another ggml consumer, such as a llama.cpp enhancement layer, should
make an explicit choice about enabling both native stacks.
Minimal Manual Session
use *;
async
Logging
The library uses tracing for diagnostics. Applications decide how logs are
collected and displayed:
init;
Native Dependencies
Some features need native libraries:
audio-capture: PortAudio and system audio headers.backend-ctranslate2: CTranslate2 dependencies required byct2rs.- ONNX backends and Silero VAD: ONNX Runtime as required by
ort. backend-whisper-cpp: whisper.cpp build dependencies and selected acceleration features.
On NixOS or other declarative environments, prefer project-local shells or flakes that pin these dependencies.
ONNX Runtime + CTranslate2 (important)
ort (used by the ONNX backends and Silero VAD) downloads a static ONNX
Runtime by default. That static build bundles protobuf, which collides with
CTranslate2's protobuf at link time (duplicate google::protobuf::* symbols)
whenever both are enabled — and runtime enables Silero VAD (ort), so this hits
any runtime + backend-ctranslate2 build. Link a system ONNX Runtime so it
is loaded dynamically instead:
# Install ONNX Runtime (matching ort's expected version, e.g. 1.22.x) to /usr/local, then:
# link-time resolution of -lonnxruntime
# run-time loading
# OpenBLAS (whisper.cpp `openblas` feature) needs its headers located:
The Nix flake sets this up automatically; .github/workflows/ci.yml is a
known-good Ubuntu reference for the native dependencies and env vars.
Model Cache
Model downloads are stored in ~/.cache/speechcore/models by default, or under
$XDG_CACHE_HOME/speechcore/models when XDG_CACHE_HOME is set. Applications
can override this with SPEECHCORE_MODEL_DIR.
Repository Checks
Recommended checks before publishing or opening a PR:
When validating an uncommitted local extraction, cargo package --allow-dirty
and cargo publish --dry-run --allow-dirty can preview the package contents. Use
plain cargo package and cargo publish --dry-run before publishing or tagging
a release.
License
Licensed under either of:
- Apache License, Version 2.0
- MIT license
at your option.