Watch
0
0
Fork
You've already forked hyperhive
0

swarm-stt: the speech-to-text core (hash cache, shared runs, ffmpeg and whisper-cli engine)

This commit is contained in:
damocles 2026-11-11 21:26:06 +01:00 • committed by mara
commit df4b2f1838

20
swarm-stt/src/lib.rs Normal file
View file

@ -0,0 +1,20 @@
//! The speech-to-text core of the swarm's `swarm-stt` service.
//!
//! [`Service::transcribe`] takes the bytes of a voice memo and answers its
//! text. Three things stand between the bytes and the engine:
//!
//! - a size cap, so one oversized file cannot occupy the engine;
//! - a cache keyed by the SHA-256 of the bytes, so the same memo sent to
//! several agents is transcribed once ([`cache`]); and
//! - an in-flight map, so two requests for one memo that arrive together share
//! one engine run instead of starting two.
//!
//! The engine is behind the [`Engine`] trait. [`engine::Whisper`] decodes with
//! `ffmpeg` and transcribes with `whisper-cli`; the tests use a fake.
pub mod cache;
pub mod engine;
mod service;
pub use engine::Engine;
pub use service::{Config, Error, Reply, Service};