- Rust 100%
stt-service
The Scripty STT service is a simple server that handles remote audio transcription.
Building
Run RUSTFLAGS="-Ctarget-cpu=native" cargo build --release if you're fine with running exclusively on CPU.
Scripty runs on CPU only in production on a Ryzen 7 7700X,
modern Ryzen CPUs are incredibly powerful with AVX512 (that's what the RUSTFLAGS option adds).
The STT service also supports some GPU acceleration.
Poke through Cargo.toml here at the root and look under the features section.
To enable them, either add them to the default array,
or run the build command with --features opencl appended,
substituting opencl for whatever you want.
Running
Scripty's STT service is designed to integrate with systemd. Docker is possible but we offer limited support for it, and you have to figure that out yourself. These official steps will use systemd.
Copy target/release/scripty_stt_service to /usr/local/bin.
Grab a STT model from https://github.com/ggml-org/whisper.cpp/blob/master/models/README.md.
Scripty uses base in production, and it runs about 4x faster than real time on a Ryzen 7 7700X.
You can likely get away with only a .en model if you don't need multilingual transcription,
but this is untested (we'll still support it if you run into issues!).
You should place this model in /usr/share/whisper-models
(if you put it somewhere else, modify ReadOnlyPaths in the .service file to point to where the model is).
While you're there, also grab a VAD model: https://huggingface.co/ggml-org/whisper-vad/blob/main/ggml-silero-v5.1.2.bin and put it in the same directory.
Copy config.example.toml to /etc/scripty-stt-service/config.toml,
and edit usage.max_concurrency as desired.
If you've picked a different path for your models, be sure to specify that there too.
Copy util/scripty-stt-service.service and util/scripty-stt-service.socket to /etc/systemd/system.
If port 7269 is already bound on your system, edit scripty-stt-service.socket to change the listen port.
To actually start it listening, run sudo systemctl enable --now scripty-stt-service.socket.
You can use the testing binary in stt_testing/ to test your setup.
Run the following from the same directory as this README:
cd stt_testing/
cargo build --release
./target/release/stt_testing ../2830-3980-0043.wav
If this succeeds without error, and you get a result of "Experience proves this.", your setup is working! Continue onwards to setting up Scripty.