You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(realtime-transcription): match the other examples, fix three bugs
Review pass over PR #57 before merge.
Consistency with the merged examples:
- port 5005 to 8989, and CMD to ENTRYPOINT so compose stops repeating
`python runner.py`
- flatten pyproject; the `runner` extra was dead config and broke
`uv run runner.py`
- drop --device/--compute-type, whose cpu/int8 defaults contradicted the
GPU-only docs
- cut the compose and Dockerfile headers to the echo template
- client takes its input positionally and inlines the signer, like echo
- hold the session with `async with`, like echo
- shorten the runner docstring and constant comments to the house shape
Fixes:
- eos cancels the worker before its closing transcribe, so a partial can no
longer land after the final
- _rms no longer raises when a frame splits a sample
- the client only builds an SSL context for wss://
New:
- start/end seconds on every message, matching what Deepgram and OpenAI
segments carry
- `-` reads raw PCM from stdin, so a microphone works through ffmpeg
- sample.wav is fetched from a public domain NASA clip instead of committed
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: realtime-transcription/README.md
+26-8Lines changed: 26 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ Realtime speech-to-text on the Livepeer network over a **WebSocket** — the cli
9
9
| Registration | dynamic (self-registers via the SDK) |
10
10
| Model |`large-v3-turbo` (faster-whisper, fixed) |
11
11
| Transport | WebSocket (`/transcribe`) |
12
-
| Port |5005|
12
+
| Port |8989|
13
13
14
-
**Requires an NVIDIA GPU.** The model is fixed at `large-v3-turbo`: it swaps large-v3's 32-layer decoder for 4, so it runs far below realtime on a 3090 while staying near large-v3 quality. On CPU it loads but falls behind a live stream, which is the one thing this example is about. Prerequisites (Docker, `uv`, the not-yet-released SDK) and the shared on-chain/payment setup are in the [repo README](../README.md).
14
+
**Requires an NVIDIA GPU.** The model is fixed at `large-v3-turbo`: it swaps large-v3's 32-layer decoder for 4, so it runs far below realtime on a 3090 while staying near large-v3 quality. The device is pinned with it (`cuda`/`float16`) rather than exposed as a flag: on CPU the model loads but falls behind a live stream, which is the one thing this example is about. Prerequisites (Docker, `uv`, the not-yet-released SDK) and the shared on-chain/payment setup are in the [repo README](../README.md).
15
15
16
16
## How it's wired
17
17
@@ -27,25 +27,43 @@ Wire protocol on `/transcribe`:
Cumulative, not incremental: each partial carries the whole utterance so far and may revise earlier words, so a client replaces rather than appends. That matches Deepgram and Vosk, and it is the honest shape for a decoder that re-runs over the buffer. Delta protocols (OpenAI's `transcript.text.delta`) only become correct once decoding is append-only, which is what the LocalAgreement approach below buys you.
31
33
32
34
## Audio
33
35
34
-
Input must be **16 kHz mono WAV**. Convert any file you have, or record a few seconds of yourself talking:
36
+
Input must be **16 kHz mono WAV**. Fetch 21s of NASA podcast speech, public domain under 17 U.S.C. 105:
Use a clip with a couple of sentences and a pause between them: the app finalizes on trailing silence, so that is what shows partials turning into finals more than once.
50
+
Use a clip with a couple of sentences and a pause between them: the app finalizes on trailing silence, so that is what shows partials turning into finals more than once. The NASA clip is trimmed to three such sentences.
51
+
52
+
Or skip the file and talk into a microphone: pass `-` and pipe raw PCM in, which streams until you Ctrl-C.
0 commit comments