SergeyShk/Speech-to-Text-Russian
Распознавание русской речи: библиотека Python, CLI stt-ru, веб-интерфейс с REST API и Docker-образ на модели GigaAM-v3.
Speech-to-Text-Russian (stt-ru) is a tool for turning Russian speech into text. It works as a Python library, a command-line program, a web service, and a Docker container.
What it does
- Recognizes Russian speech in recordings of conversations, lectures, and dictation.
- Uses the GigaAM-v3 speech model (via the onnx-asr library). The output includes punctuation and numbers.
- Stereo recordings: each audio channel is treated as a separate speaker.
- Runs on CPU without PyTorch; on NVIDIA GPUs it uses ONNX Runtime.
- Results can be saved as subtitles and tables.
Key features
- Transcribe command — process single files or whole folders; get per-file results plus one summary file; monitor a folder for new recordings.
- Speaker diarization — separate different people's speech in a single-track recording.
- Output formats — TXT, JSON, JSONL, SRT, VTT, ASS (for Aegisub), and CSV.
- Python library — recognize files or in-memory recordings and export results programmatically.
- Model flexibility — works with any onnx-asr model: GigaAM, T-one, Vosk, Whisper, and others; configurable devices and voice-activity detection (VAD) parameters.
- Quality evaluation — measure WER (word error rate), CER (character error rate), and speed against your own labeled data.
- Web service — a web interface with a waveform display and clickable segments, plus a REST API, task queue, and access-token authentication.
- Docker — ready-made images for CPU and NVIDIA GPU, with the default model already included (works offline).
Installation
- Requires Python 3.11 to 3.14 (3.15 is not supported because ONNX Runtime has no builds for it yet).
- Install with
pip install stt-ruoruv add stt-ru. - Optional extras:
ffmpeg(for M4A/AAC formats and audio from video),service(web UI and REST API),eval(quality evaluation). Install all withpip install "stt-ru[ffmpeg,service,eval]". - The model (~230 MB) downloads from Hugging Face on first run.
Quick start examples
stt-ru transcribe call.wav # text to console
stt-ru transcribe calls/ -o out/ -f srt,ass,csv --summary out/all.csv
stt-ru transcribe calls/ -o out/ --watch # watch folder
stt-ru transcribe meeting.mp3 --diarize # speaker separation
stt-ru evaluate eval.csv -m gigaam-v3-e2e-rnnt -m t-tech/t-one # compare models
stt-ru serve # http://127.0.0.1:8000
Python usage example (from the README):
from stt_ru import Transcriber
result = Transcriber().transcribe("call.wav")
for segment in result.segments:
print(segment.speaker, segment.start, segment.end, segment.text)
result.save("call.srt")
Docker
- Run a web service:
docker run -d -p 8000:8000 -e STT_RU_TOKEN=my-secret-token ghcr.io/sergeyshk/stt-ru - Transcribe a single file:
docker run --rm -v "$PWD:/data" ghcr.io/sergeyshk/stt-ru transcribe call.wav - GPU version: add
--gpus alland use thelatest-gputag. - The default model is baked into the image, so the container works without internet.
Development
- Uses uv for dependency management and ruff for linting/formatting.
- Common commands:
make deps,make test,make lint,make docker(full list viamake help). - Documentation is bilingual (Russian and English pages).
- Pre-commit hooks run linters on commit and tests on push.
Project structure
docs/— MkDocs documentation (RU + EN)docker/— Docker images and Compose filessrc/stt_ru/— the package: pipeline, result, batch, CLI, exceptions, plus submodules for audio, ASR, VAD, diarization, export, evaluation, and web servicetests/— tests mirroring the package structure
License and contributions
- Code is MIT-licensed. The GigaAM-v3 model is MIT; other onnx-asr models have their own licenses.
- Bug reports, ideas, and pull requests are welcome via GitHub issues; contribution guidelines and a code of conduct are provided.
Author: Sergey Shkarin (kouki.sergey@gmail.com)
Related
- Project
- Project
- Project
- Project
- Project