Skip to content

Commit cb11080

Browse files
feat: improve readme and retry publish (#8)
1 parent 15c3d90 commit cb11080

2 files changed

Lines changed: 68 additions & 47 deletions

File tree

README.md

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,64 @@ A provider-agnostic speech-to-text pipeline that plugs into **any OpenAI-compati
66

77
## Features
88

9-
- **Any ASR provider** — Point at any service that implements `POST /v1/audio/transcriptions` (or OpenRouter STT); swap models with flags, not code changes.
10-
- **Resilient ASR discovery** — Auto-detects local workers and hosted APIs, retries failed requests, and starts a bundled Qwen fallback when nothing else is reachable.
11-
- **Audio preprocessing** — ffmpeg normalization to mono 16 kHz WAV with optional enhancement before transcription.
12-
- **Voice activity detection** — Silero, webrtcvad, or RMS fallback to skip silence and focus compute on speech.
13-
- **Smart chunking & stitching** — Fixed or pause-aligned chunks for long files, with global word and segment timestamps stitched back together.
14-
- **Speaker diarization** — pyannote on the full audio, with word-level speaker assignment (IoU + segment fallback).
15-
- **LLM transcript repair** — Optional two-pass repair via any OpenAI-compatible chat endpoint, with validation to preserve timing and mixed-script Hinglish.
16-
- **Rich exports** — JSON, SRT, and VTT with segments, words, speakers, and pipeline metadata.
17-
- **Lightweight orchestrator** — No ASR model weights in the core package; inference stays in the microservice you choose.
18-
- **CLI and Python API**`resilient-stt` from the terminal, or `pipeline.run(JobConfig)` for programmatic use.
19-
20-
> **Experimental:** This project is under active development and is **not production-ready**. Expect breaking changes, incomplete features, and behavior that may shift between releases. Use for evaluation and prototyping only.
9+
- **Universal ASR** — Connect to any OpenAI-compatible endpoint, switching models easily by flag.
10+
- **Automatic Discovery** — Finds local or remote ASR, retries if needed, starts Qwen fallback automatically.
11+
- **Seamless Audio Prep** — Effortless ffmpeg normalization, optional enhancement.
12+
- **Smart Silence Skipping** — Uses Silero, webrtcvad, or RMS to focus only on speech.
13+
- **Chunking & Stitching** — Handles long audio with intelligent segmentation, accurate timestamps.
14+
- **Speaker Diarization** — Word-level speakers with pyannote.
15+
- **LLM Repair** — Optional transcript refinement via your preferred chat endpoint.
16+
- **Versatile Export** — Output to JSON, SRT, and VTT including rich metadata.
17+
- **Lightweight** — Orchestrator only; no model weights required.
18+
- **CLI & Python API** — Use via terminal or integrate in code.
2119

2220
**Architecture & design decisions:** [docs/design.md](docs/design.md)
2321

2422
**CLI reference:** [docs/cli.md](docs/cli.md)
2523

26-
## Repository layout
27-
28-
```text
29-
resilient-stt/
30-
src/resilient_stt/ # installable package (PyPI name: resilient-stt)
31-
orchestrator/ # CLI, pipeline, ASR discovery
32-
core/ # audio, VAD, chunking, schemas, exports
33-
asr/ # OpenAI-compatible ASR client, fallback worker
34-
diarization/ # pyannote + speaker assignment
35-
alignment/ # optional aligner (stubs in v1)
36-
repair/ # LLM transcript repair
37-
workers/ # bundled qwen-asr HTTP service (shipped in wheel)
38-
workers/ # docs for optional ASR workers (vLLM, Whisper, …)
39-
scripts/ # bootstrap helpers (not installed from PyPI)
40-
tests/
41-
docs/
42-
data/ # input / work / output (local runs)
24+
## Quickstart
25+
26+
Prerequisites: **Python 3.11 or 3.12**, **ffmpeg** on PATH.
27+
28+
```bash
29+
pip install "resilient-stt[full]" # minimal: pip install resilient-stt (no pyannote/Silero)
30+
31+
resilient-stt \
32+
--audio /path/to/audio.wav \
33+
--output /path/to/output-dir \
34+
--language hi
35+
36+
# Output (under --output):
37+
# transcript.json — segments, words, speakers, repair metadata
38+
# transcript.srt — subtitles
39+
# transcript.vtt — WebVTT
40+
#
41+
# Example transcript.json (truncated):
42+
# {
43+
# "audio_file": "/path/to/audio.wav",
44+
# "duration": 142.5,
45+
# "language": "hi",
46+
# "asr_provider": "qwen-asr-fallback",
47+
# "asr_model": "Qwen/Qwen3-ASR-0.6B",
48+
# "segments": [{
49+
# "speaker": "SPEAKER_00",
50+
# "start": 0.12,
51+
# "end": 4.85,
52+
# "raw_text": "Namaste, aaj hum meeting shuru karte hain.",
53+
# "clean_text": "Namaste, aaj hum meeting shuru karte hain.",
54+
# "repair_status": "unchanged",
55+
# "words": [{ "word": "Namaste,", "start": 0.12, "end": 0.58, "speaker": "SPEAKER_00" }]
56+
# }]
57+
# }
4358
```
4459

45-
- **PyPI / pip:** `pip install resilient-stt` → CLI command **`resilient-stt`** (hyphen).
46-
- **Python imports:** `resilient_stt` (underscore), e.g. `from resilient_stt.orchestrator.pipeline import run`.
47-
- **From source:** `uv sync` then `uv run resilient-stt …` (or activate `.venv` and run `resilient-stt`).
60+
No ASR setup required — the CLI auto-detects local workers and hosted APIs, or starts a bundled Qwen worker. Quick smoke test without pyannote or repair: add `--skip-diarization --repair false`. For OpenAI or OpenRouter, set `OPENAI_API_KEY` or `OPENROUTER_API_KEY` in `.env` and pass `--no-asr-fallback`. Full flags: [docs/cli.md](docs/cli.md). Repository layout: [docs/design.md](docs/design.md#4-repository-layout).
61+
62+
63+
> **Note**
64+
>
65+
> 🚧 Active development – not production-ready.
66+
> Expect changes, incomplete features, and ongoing improvements.
4867
4968
## Architecture
5069

@@ -168,8 +187,6 @@ timestamps; the default aligner is a no-op pass-through.
168187

169188
## Install (PyPI)
170189

171-
Prerequisites: **Python 3.11 or 3.12**, **ffmpeg** on PATH.
172-
173190
```bash
174191
# Minimal orchestrator (webrtcvad VAD; ASR via API or bundled qwen worker)
175192
pip install resilient-stt

docs/design.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,25 @@ Every stage writes **debuggable artifacts** under `data/work/<job_id>/`.
8484

8585
```text
8686
resilient-stt/
87-
src/resilient_stt/
88-
orchestrator/ # CLI, JobConfig, pipeline.run(), asr_discovery
89-
core/ # schemas, audio, vad, silero_vad, chunking, stitching, privacy
90-
asr/ # ASRProvider, endpoint client, probe, fallback_worker
91-
diarization/ # pyannote provider + speaker assignment
92-
alignment/ # AlignmentProvider ABC + NoOp + stubs
93-
repair/ # LLM repair, prompts, validation
94-
workers/ # bundled qwen-transformers ASR microservice
95-
workers/ # optional worker README stubs (vLLM, Whisper, …)
96-
scripts/ # optional ASR worker bootstrap helpers
97-
data/ # input / work / output directories
98-
tests/ # mocked unit tests (no live ffmpeg/pyannote/LLM)
99-
docs/ # this file
87+
src/resilient_stt/ # installable package (PyPI name: resilient-stt)
88+
orchestrator/ # CLI, JobConfig, pipeline.run(), asr_discovery
89+
core/ # schemas, audio, vad, silero_vad, chunking, stitching, exports
90+
asr/ # ASRProvider, endpoint client, probe, fallback_worker
91+
diarization/ # pyannote provider + speaker assignment
92+
alignment/ # AlignmentProvider ABC + NoOp + stubs
93+
repair/ # LLM repair, prompts, validation
94+
workers/ # bundled qwen-asr HTTP service (shipped in wheel)
95+
workers/ # docs for optional ASR workers (vLLM, Whisper, …)
96+
scripts/ # bootstrap helpers (not installed from PyPI)
97+
tests/ # mocked unit tests (no live ffmpeg/pyannote/LLM)
98+
docs/ # design, CLI reference
99+
data/ # input / work / output (local runs)
100100
```
101101

102+
- **PyPI / pip:** `pip install resilient-stt` → CLI command **`resilient-stt`** (hyphen).
103+
- **Python imports:** `resilient_stt` (underscore), e.g. `from resilient_stt.orchestrator.pipeline import run`.
104+
- **From source:** `uv sync` then `uv run resilient-stt …` (or activate `.venv` and run `resilient-stt`).
105+
102106
**PyPI package:** `resilient-stt`. **Import namespace:** `resilient_stt` (e.g.
103107
`from resilient_stt.core.schema import TranscriptSegment`). CLI entry point:
104108
`resilient-stt``resilient_stt.orchestrator.main:cli`.

0 commit comments

Comments
 (0)