RealTimeSTT 1.0.2__tar.gz → 1.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. {realtimestt-1.0.2 → realtimestt-1.0.4}/MANIFEST.in +1 -0
  2. {realtimestt-1.0.2/realtimestt.egg-info → realtimestt-1.0.4}/PKG-INFO +103 -20
  3. {realtimestt-1.0.2 → realtimestt-1.0.4}/README.md +65 -15
  4. realtimestt-1.0.4/RELEASE_NOTES.md +205 -0
  5. realtimestt-1.0.4/RealtimeSTT/__init__.py +84 -0
  6. realtimestt-1.0.4/RealtimeSTT/assets/__init__.py +1 -0
  7. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/audio_recorder.py +64 -8
  8. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/audio_input_worker.py +119 -102
  9. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/initialization.py +19 -1
  10. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/lifecycle.py +32 -13
  11. realtimestt-1.0.4/RealtimeSTT/core/manual_audio_input.py +177 -0
  12. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/realtime.py +506 -20
  13. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/realtime_text_stabilizer.py +76 -0
  14. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/recorder_config.py +6 -0
  15. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/recording.py +58 -17
  16. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/recording_buffers.py +26 -0
  17. realtimestt-1.0.4/RealtimeSTT/core/shutdown.py +222 -0
  18. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/transcription.py +13 -4
  19. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/transcription_api.py +51 -7
  20. realtimestt-1.0.4/RealtimeSTT/engines/__init__.py +28 -0
  21. realtimestt-1.0.2/RealtimeSTT/transcription_engines/__init__.py → realtimestt-1.0.4/RealtimeSTT/engines/base_engine.py +4 -5
  22. realtimestt-1.0.4/RealtimeSTT/install_sherpa_models.py +674 -0
  23. realtimestt-1.0.4/RealtimeSTT/model_manifests.py +273 -0
  24. realtimestt-1.0.4/RealtimeSTT/transcription_engines/__init__.py +48 -0
  25. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/base.py +7 -1
  26. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/factory.py +6 -0
  27. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/faster_whisper_engine.py +36 -1
  28. realtimestt-1.0.4/RealtimeSTT/transcription_engines/funasr_engine.py +347 -0
  29. realtimestt-1.0.4/RealtimeSTT/transcription_engines/nemotron_engine.py +590 -0
  30. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/parakeet_engine.py +41 -4
  31. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/sherpa_onnx_engine.py +95 -9
  32. realtimestt-1.0.4/RealtimeSTT_server/PRODUCTION_SERVER.md +161 -0
  33. realtimestt-1.0.4/RealtimeSTT_server/production_server.py +2734 -0
  34. realtimestt-1.0.4/example_fastapi_server/__init__.py +1 -0
  35. realtimestt-1.0.4/example_fastapi_server/protocol.py +82 -0
  36. realtimestt-1.0.4/example_fastapi_server/server.py +3867 -0
  37. {realtimestt-1.0.2 → realtimestt-1.0.4/realtimestt.egg-info}/PKG-INFO +103 -20
  38. {realtimestt-1.0.2 → realtimestt-1.0.4}/realtimestt.egg-info/SOURCES.txt +12 -0
  39. {realtimestt-1.0.2 → realtimestt-1.0.4}/realtimestt.egg-info/entry_points.txt +2 -0
  40. {realtimestt-1.0.2 → realtimestt-1.0.4}/realtimestt.egg-info/requires.txt +33 -3
  41. {realtimestt-1.0.2 → realtimestt-1.0.4}/realtimestt.egg-info/top_level.txt +1 -0
  42. {realtimestt-1.0.2 → realtimestt-1.0.4}/requirements.txt +1 -0
  43. {realtimestt-1.0.2 → realtimestt-1.0.4}/setup.py +50 -4
  44. realtimestt-1.0.2/RELEASE_NOTES.md +0 -79
  45. realtimestt-1.0.2/RealtimeSTT/__init__.py +0 -44
  46. realtimestt-1.0.2/RealtimeSTT/core/manual_audio_input.py +0 -34
  47. realtimestt-1.0.2/RealtimeSTT/core/shutdown.py +0 -69
  48. {realtimestt-1.0.2 → realtimestt-1.0.4}/LICENSE +0 -0
  49. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/assets/warmup_audio.wav +0 -0
  50. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/audio_input.py +0 -0
  51. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/audio_recorder_client.py +0 -0
  52. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/__init__.py +0 -0
  53. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/preroll.py +0 -0
  54. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/realtime_boundary_detector.py +0 -0
  55. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/realtime_callbacks.py +0 -0
  56. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/runtime.py +0 -0
  57. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/safepipe.py +0 -0
  58. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/silero_vad.py +0 -0
  59. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/state.py +0 -0
  60. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/text_formatting.py +0 -0
  61. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/voice_activity.py +0 -0
  62. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/core/wakeword.py +0 -0
  63. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/install_kroko.py +0 -0
  64. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/_model_utils.py +0 -0
  65. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/cohere_transcribe_engine.py +0 -0
  66. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/granite_speech_engine.py +0 -0
  67. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/hf_transformers_engines.py +0 -0
  68. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/kroko_onnx_engine.py +0 -0
  69. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/moonshine_engine.py +0 -0
  70. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/omnilingual_asr_engine.py +0 -0
  71. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/openai_api_engine.py +0 -0
  72. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/openai_whisper_engine.py +0 -0
  73. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/qwen3_asr_engine.py +0 -0
  74. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT/transcription_engines/whisper_cpp_engine.py +0 -0
  75. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT_server/__init__.py +0 -0
  76. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT_server/install_packages.py +0 -0
  77. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT_server/stt_cli_client.py +0 -0
  78. {realtimestt-1.0.2 → realtimestt-1.0.4}/RealtimeSTT_server/stt_server.py +0 -0
  79. {realtimestt-1.0.2 → realtimestt-1.0.4}/realtimestt.egg-info/dependency_links.txt +0 -0
  80. {realtimestt-1.0.2 → realtimestt-1.0.4}/setup.cfg +0 -0
@@ -4,6 +4,7 @@ include RELEASE_NOTES.md
4
4
  include LICENSE
5
5
  prune docs/development
6
6
  prune dev-log
7
+ prune dev-logs
7
8
  prune roadmap
8
9
  prune test-model-cache
9
10
  prune test-results
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: realtimestt
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: A fast Voice Activity Detection and Transcription System
5
5
  Home-page: https://github.com/KoljaB/RealTimeSTT
6
6
  Author: Kolja Beigel
@@ -13,6 +13,7 @@ License-File: LICENSE
13
13
  Requires-Dist: PyAudio==0.2.14
14
14
  Requires-Dist: webrtcvad-wheels==2.0.14
15
15
  Requires-Dist: halo==0.0.31
16
+ Requires-Dist: colorama==0.4.6
16
17
  Requires-Dist: torch
17
18
  Requires-Dist: torchaudio
18
19
  Requires-Dist: scipy==1.17.1
@@ -29,9 +30,17 @@ Requires-Dist: pywhispercpp; extra == "whispercpp"
29
30
  Provides-Extra: openai-whisper
30
31
  Requires-Dist: openai-whisper; extra == "openai-whisper"
31
32
  Provides-Extra: sherpa-onnx
32
- Requires-Dist: sherpa-onnx; extra == "sherpa-onnx"
33
+ Requires-Dist: sherpa-onnx==1.13.4; extra == "sherpa-onnx"
33
34
  Provides-Extra: sherpa
34
- Requires-Dist: sherpa-onnx; extra == "sherpa"
35
+ Requires-Dist: sherpa-onnx==1.13.4; extra == "sherpa"
36
+ Provides-Extra: server
37
+ Requires-Dist: fastapi<1,>=0.115; extra == "server"
38
+ Requires-Dist: uvicorn[standard]<1,>=0.30; extra == "server"
39
+ Requires-Dist: silero-vad[onnx-cpu]>=6.2.1; python_version >= "3.8" and extra == "server"
40
+ Provides-Extra: production-server
41
+ Requires-Dist: fastapi<1,>=0.115; extra == "production-server"
42
+ Requires-Dist: uvicorn[standard]<1,>=0.30; extra == "production-server"
43
+ Requires-Dist: silero-vad[onnx-cpu]>=6.2.1; python_version >= "3.8" and extra == "production-server"
35
44
  Provides-Extra: silero-vad
36
45
  Requires-Dist: silero-vad>=6.2.1; python_version >= "3.8" and extra == "silero-vad"
37
46
  Provides-Extra: silero
@@ -76,6 +85,14 @@ Provides-Extra: qwen3-asr
76
85
  Requires-Dist: qwen-asr; extra == "qwen3-asr"
77
86
  Provides-Extra: qwen-vllm
78
87
  Requires-Dist: qwen-asr[vllm]; extra == "qwen-vllm"
88
+ Provides-Extra: funasr
89
+ Requires-Dist: funasr; extra == "funasr"
90
+ Provides-Extra: fun-asr
91
+ Requires-Dist: funasr; extra == "fun-asr"
92
+ Provides-Extra: fun-asr
93
+ Requires-Dist: funasr; extra == "fun-asr"
94
+ Provides-Extra: sensevoice
95
+ Requires-Dist: funasr; extra == "sensevoice"
79
96
  Provides-Extra: kroko-builder
80
97
  Requires-Dist: huggingface_hub; extra == "kroko-builder"
81
98
  Provides-Extra: porcupine
@@ -104,7 +121,9 @@ Provides-Extra: all
104
121
  Requires-Dist: faster-whisper==1.2.1; extra == "all"
105
122
  Requires-Dist: pywhispercpp; extra == "all"
106
123
  Requires-Dist: openai-whisper; extra == "all"
107
- Requires-Dist: sherpa-onnx; extra == "all"
124
+ Requires-Dist: sherpa-onnx==1.13.4; extra == "all"
125
+ Requires-Dist: fastapi<1,>=0.115; extra == "all"
126
+ Requires-Dist: uvicorn[standard]<1,>=0.30; extra == "all"
108
127
  Requires-Dist: silero-vad[onnx-cpu]>=6.2.1; python_version >= "3.8" and extra == "all"
109
128
  Requires-Dist: transformers; extra == "all"
110
129
  Requires-Dist: nemo_toolkit[asr]; extra == "all"
@@ -112,6 +131,7 @@ Requires-Dist: torch==2.8.0; (python_version >= "3.10" and python_version < "3.1
112
131
  Requires-Dist: torchaudio==2.8.0; (python_version >= "3.10" and python_version < "3.12" and platform_system != "Windows") and extra == "all"
113
132
  Requires-Dist: omnilingual-asr>=0.2.0; (python_version >= "3.10" and python_version < "3.12" and platform_system != "Windows") and extra == "all"
114
133
  Requires-Dist: qwen-asr; extra == "all"
134
+ Requires-Dist: funasr; extra == "all"
115
135
  Requires-Dist: huggingface_hub; extra == "all"
116
136
  Requires-Dist: pvporcupine==1.9.5; extra == "all"
117
137
  Requires-Dist: openwakeword>=0.6.0; extra == "all"
@@ -140,10 +160,16 @@ Main ASR backend only, without the faster packaged Silero ONNX Runtime VAD:
140
160
 
141
161
  pip install "realtimestt[faster-whisper]"
142
162
 
143
- Core package only, without a transcription engine or wake-word backend:
163
+ Base recorder/audio runtime, without a transcription engine or wake-word
164
+ backend:
144
165
 
145
166
  pip install realtimestt
146
167
 
168
+ The base install still includes microphone/audio support, WebRTC VAD, recorder
169
+ VAD logic, websocket client/server dependencies, and shared audio utilities. It
170
+ does not install `faster-whisper`, Porcupine, OpenWakeWord, or another optional
171
+ ASR/wake-word backend unless you request the matching extra.
172
+
147
173
  Install multiple extras by separating them with commas:
148
174
 
149
175
  pip install "realtimestt[faster-whisper,porcupine]"
@@ -155,6 +181,7 @@ Available extras include:
155
181
  - whisper-cpp: whisper.cpp backend through pywhispercpp
156
182
  - openai-whisper: original OpenAI Whisper Python backend
157
183
  - sherpa-onnx: sherpa-onnx CPU backends
184
+ - server/production-server: versioned FastAPI HTTP and WebSocket ASR server
158
185
  - silero-vad: packaged Silero model assets and PyTorch wrapper
159
186
  - silero-onnx/silero-onnx-cpu: fastest Silero VAD CPU ONNX Runtime backend
160
187
  - silero-onnx-gpu: installs Silero's ONNX GPU runtime extra for experiments
@@ -164,6 +191,7 @@ Available extras include:
164
191
  - moonshine, granite, cohere: aliases for the Transformers dependency set
165
192
  - qwen: Qwen ASR backend
166
193
  - qwen-vllm: Qwen ASR with vLLM extras
194
+ - funasr: experimental FunASR/SenseVoice backend
167
195
  - kroko-builder: helper command for building/installing Kroko-ONNX plus Hugging Face model downloads
168
196
  - porcupine: Porcupine wake-word backend
169
197
  - openwakeword: OpenWakeWord wake-word backend
@@ -171,6 +199,11 @@ Available extras include:
171
199
  - recommended/default: faster-whisper backend plus fast Silero CPU ONNX VAD
172
200
  - all: all PyPI-installable optional backends
173
201
 
202
+ Install the pinned Nemotron live and Parakeet final model bundles into a
203
+ persistent verified cache:
204
+
205
+ stt-install-sherpa-models --root ./models/sherpa-onnx --model all
206
+
174
207
  WebRTC VAD is installed with the core package. AudioToTextRecorder also
175
208
  initializes a Silero VAD path. Install the recommended/default or
176
209
  silero-onnx-cpu extra for a self-contained local Silero ONNX Runtime backend.
@@ -220,8 +253,34 @@ wake words, and direct access to audio streams. It is designed for assistants,
220
253
  dictation tools, browser streaming servers, and prototypes that need to turn
221
254
  speech into text with only a few lines of code.
222
255
 
223
- The recommended default path uses `faster_whisper`. Other engines are available
224
- through install extras when their optional dependencies and models are present.
256
+ The general-purpose default path uses `faster_whisper`. Other engines are
257
+ available through install extras when their optional dependencies and models
258
+ are present.
259
+
260
+ ## Recommended Engine Profiles
261
+
262
+ - **CUDA / GPU:** Keep using the established `faster_whisper` CUDA setup. It
263
+ remains the recommended general-purpose GPU path.
264
+ - **CPU:** For production streaming on Linux x86-64, the strongly recommended
265
+ profile is
266
+ `sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8` for fast,
267
+ replaceable realtime text together with
268
+ `sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8` for the single authoritative
269
+ final transcript. Nemotron processes only new audio frames during the turn;
270
+ Parakeet then refines the complete turn once at finalization. This pairing
271
+ provides substantially better CPU streaming behavior than repeatedly
272
+ retranscribing a growing audio buffer while preserving a high-quality final.
273
+
274
+ Install the CPU server stack and both pinned model bundles with:
275
+
276
+ ```bash
277
+ python -m pip install "RealtimeSTT[server,sherpa-onnx]"
278
+ stt-install-sherpa-models --root ./models/sherpa-onnx --model all
279
+ ```
280
+
281
+ See the [production server guide](RealtimeSTT_server/PRODUCTION_SERVER.md) for
282
+ the authenticated HTTP/WebSocket deployment recipe and exact pinned model
283
+ directories.
225
284
 
226
285
  ### Support RealtimeSTT
227
286
 
@@ -356,8 +415,10 @@ audio, logging, and executor injection.
356
415
  - Direct microphone input or application-fed audio chunks.
357
416
  - Event callbacks for recording, VAD, realtime text, transcription, and wake
358
417
  word state.
359
- - A FastAPI browser streaming server example with multi-user session isolation,
360
- shared inference resources, metrics, and health endpoints.
418
+ - A packaged production FastAPI server with versioned HTTP/WebSocket contracts,
419
+ session isolation, bounded shared inference resources, authentication, and
420
+ readiness/capabilities endpoints.
421
+ - A browser streaming reference app for source checkouts.
361
422
 
362
423
  ## Documentation
363
424
 
@@ -369,6 +430,8 @@ audio, logging, and executor injection.
369
430
  parameter reference.
370
431
  - [Transcription engines](docs/transcription-engines.md): engine selection and
371
432
  setup links.
433
+ - [Custom transcription engines](docs/custom-transcription-engines.md): public
434
+ base class, executor integration, streaming sessions, and contribution guide.
372
435
  - [Wake words](docs/wake-words.md): Porcupine and OpenWakeWord setup.
373
436
  - [External audio](docs/external-audio.md): feeding audio without a microphone.
374
437
  - [Testing](docs/testing.md): maintained unit and opt-in golden test workflow.
@@ -376,6 +439,8 @@ audio, logging, and executor injection.
376
439
  legacy experiments under `tests/`.
377
440
  - [FastAPI server](docs/fastapi-server.md): browser server configuration,
378
441
  protocol, metrics, and deployment notes.
442
+ - [Production server](RealtimeSTT_server/PRODUCTION_SERVER.md): packaged remote
443
+ HTTP/WebSocket API, authentication, limits, and deployment recipe.
379
444
  - [Troubleshooting](docs/troubleshooting.md): common install, audio, CUDA,
380
445
  model, dependency, and runtime errors.
381
446
  - [Engine licenses](docs/licenses.md): license notes for optional engine
@@ -393,24 +458,42 @@ Engine-specific references:
393
458
  - [Meta Omnilingual ASR](docs/engines/omnilingual-asr.md)
394
459
  - [Granite/Qwen Transformers engines](docs/engines/hf-transformers.md)
395
460
  - [Cohere Transcribe](docs/engines/cohere.md)
461
+ - [FunASR](docs/engines/funasr.md)
462
+
463
+ ## Production Server
396
464
 
397
- ## Server Example
465
+ The supported remote server is packaged as an optional install. It binds to
466
+ loopback by default and exposes versioned health, readiness, capabilities,
467
+ raw-PCM final transcription, and ordered streaming WebSocket endpoints.
468
+ Direct non-loopback binds require both a bearer token and Uvicorn TLS
469
+ certificate/key files; for a reverse-proxy deployment, keep the server on
470
+ loopback and terminate TLS at the proxy.
471
+
472
+ ```bash
473
+ python -m pip install "RealtimeSTT[server,faster-whisper]"
474
+ stt-server-production --host 127.0.0.1 --port 8010
475
+ ```
398
476
 
399
- The browser FastAPI reference server lives in `example_fastapi_server` and is
400
- intended for source checkouts. It is not installed by the PyPI wheel; keeping it
401
- source-only keeps the wheel lean and avoids adding web-server dependencies for
402
- users who only need the recorder/API library.
477
+ For CPU INT8 deployment, the recommended pairing is
478
+ `sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8` for live hypotheses
479
+ and `sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8` for authoritative final
480
+ transcription. Install `RealtimeSTT[server,sherpa-onnx]` and both pinned model
481
+ bundles into persistent storage before following the server recipe. The
482
+ `server` extra includes the local Silero ONNX VAD runtime used by legacy
483
+ recorder-backed server paths. The versioned production WebSocket path owns its
484
+ turn state and does not derive finalization from recorder VAD, so production
485
+ startup does not need an interactive Torch Hub download:
403
486
 
404
487
  ```bash
405
- python -m pip install -r example_fastapi_server/requirements.txt
406
- python example_fastapi_server/server.py --host 0.0.0.0 --port 8010
488
+ stt-install-sherpa-models --root ./models/sherpa-onnx --model all
407
489
  ```
408
490
 
409
- For pip-only installs, use the Python recorder/API examples instead. If you
410
- want the FastAPI reference server, clone the repository or install from Git.
491
+ See
492
+ [PRODUCTION_SERVER.md](RealtimeSTT_server/PRODUCTION_SERVER.md).
411
493
 
412
- Open `http://localhost:8010`. See [docs/fastapi-server.md](docs/fastapi-server.md)
413
- for engine recipes, websocket protocol details, health checks, and metrics.
494
+ The interactive browser reference app remains in `example_fastapi_server` for
495
+ source checkouts. See [docs/fastapi-server.md](docs/fastapi-server.md) for its
496
+ UI, engine recipes, protocol details, and metrics.
414
497
 
415
498
  ## Contributing
416
499
 
@@ -6,8 +6,34 @@ wake words, and direct access to audio streams. It is designed for assistants,
6
6
  dictation tools, browser streaming servers, and prototypes that need to turn
7
7
  speech into text with only a few lines of code.
8
8
 
9
- The recommended default path uses `faster_whisper`. Other engines are available
10
- through install extras when their optional dependencies and models are present.
9
+ The general-purpose default path uses `faster_whisper`. Other engines are
10
+ available through install extras when their optional dependencies and models
11
+ are present.
12
+
13
+ ## Recommended Engine Profiles
14
+
15
+ - **CUDA / GPU:** Keep using the established `faster_whisper` CUDA setup. It
16
+ remains the recommended general-purpose GPU path.
17
+ - **CPU:** For production streaming on Linux x86-64, the strongly recommended
18
+ profile is
19
+ `sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8` for fast,
20
+ replaceable realtime text together with
21
+ `sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8` for the single authoritative
22
+ final transcript. Nemotron processes only new audio frames during the turn;
23
+ Parakeet then refines the complete turn once at finalization. This pairing
24
+ provides substantially better CPU streaming behavior than repeatedly
25
+ retranscribing a growing audio buffer while preserving a high-quality final.
26
+
27
+ Install the CPU server stack and both pinned model bundles with:
28
+
29
+ ```bash
30
+ python -m pip install "RealtimeSTT[server,sherpa-onnx]"
31
+ stt-install-sherpa-models --root ./models/sherpa-onnx --model all
32
+ ```
33
+
34
+ See the [production server guide](RealtimeSTT_server/PRODUCTION_SERVER.md) for
35
+ the authenticated HTTP/WebSocket deployment recipe and exact pinned model
36
+ directories.
11
37
 
12
38
  ### Support RealtimeSTT
13
39
 
@@ -142,8 +168,10 @@ audio, logging, and executor injection.
142
168
  - Direct microphone input or application-fed audio chunks.
143
169
  - Event callbacks for recording, VAD, realtime text, transcription, and wake
144
170
  word state.
145
- - A FastAPI browser streaming server example with multi-user session isolation,
146
- shared inference resources, metrics, and health endpoints.
171
+ - A packaged production FastAPI server with versioned HTTP/WebSocket contracts,
172
+ session isolation, bounded shared inference resources, authentication, and
173
+ readiness/capabilities endpoints.
174
+ - A browser streaming reference app for source checkouts.
147
175
 
148
176
  ## Documentation
149
177
 
@@ -155,6 +183,8 @@ audio, logging, and executor injection.
155
183
  parameter reference.
156
184
  - [Transcription engines](docs/transcription-engines.md): engine selection and
157
185
  setup links.
186
+ - [Custom transcription engines](docs/custom-transcription-engines.md): public
187
+ base class, executor integration, streaming sessions, and contribution guide.
158
188
  - [Wake words](docs/wake-words.md): Porcupine and OpenWakeWord setup.
159
189
  - [External audio](docs/external-audio.md): feeding audio without a microphone.
160
190
  - [Testing](docs/testing.md): maintained unit and opt-in golden test workflow.
@@ -162,6 +192,8 @@ audio, logging, and executor injection.
162
192
  legacy experiments under `tests/`.
163
193
  - [FastAPI server](docs/fastapi-server.md): browser server configuration,
164
194
  protocol, metrics, and deployment notes.
195
+ - [Production server](RealtimeSTT_server/PRODUCTION_SERVER.md): packaged remote
196
+ HTTP/WebSocket API, authentication, limits, and deployment recipe.
165
197
  - [Troubleshooting](docs/troubleshooting.md): common install, audio, CUDA,
166
198
  model, dependency, and runtime errors.
167
199
  - [Engine licenses](docs/licenses.md): license notes for optional engine
@@ -179,24 +211,42 @@ Engine-specific references:
179
211
  - [Meta Omnilingual ASR](docs/engines/omnilingual-asr.md)
180
212
  - [Granite/Qwen Transformers engines](docs/engines/hf-transformers.md)
181
213
  - [Cohere Transcribe](docs/engines/cohere.md)
214
+ - [FunASR](docs/engines/funasr.md)
182
215
 
183
- ## Server Example
216
+ ## Production Server
217
+
218
+ The supported remote server is packaged as an optional install. It binds to
219
+ loopback by default and exposes versioned health, readiness, capabilities,
220
+ raw-PCM final transcription, and ordered streaming WebSocket endpoints.
221
+ Direct non-loopback binds require both a bearer token and Uvicorn TLS
222
+ certificate/key files; for a reverse-proxy deployment, keep the server on
223
+ loopback and terminate TLS at the proxy.
224
+
225
+ ```bash
226
+ python -m pip install "RealtimeSTT[server,faster-whisper]"
227
+ stt-server-production --host 127.0.0.1 --port 8010
228
+ ```
184
229
 
185
- The browser FastAPI reference server lives in `example_fastapi_server` and is
186
- intended for source checkouts. It is not installed by the PyPI wheel; keeping it
187
- source-only keeps the wheel lean and avoids adding web-server dependencies for
188
- users who only need the recorder/API library.
230
+ For CPU INT8 deployment, the recommended pairing is
231
+ `sherpa-onnx-nemotron-3.5-asr-streaming-0.6b-560ms-int8` for live hypotheses
232
+ and `sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8` for authoritative final
233
+ transcription. Install `RealtimeSTT[server,sherpa-onnx]` and both pinned model
234
+ bundles into persistent storage before following the server recipe. The
235
+ `server` extra includes the local Silero ONNX VAD runtime used by legacy
236
+ recorder-backed server paths. The versioned production WebSocket path owns its
237
+ turn state and does not derive finalization from recorder VAD, so production
238
+ startup does not need an interactive Torch Hub download:
189
239
 
190
240
  ```bash
191
- python -m pip install -r example_fastapi_server/requirements.txt
192
- python example_fastapi_server/server.py --host 0.0.0.0 --port 8010
241
+ stt-install-sherpa-models --root ./models/sherpa-onnx --model all
193
242
  ```
194
243
 
195
- For pip-only installs, use the Python recorder/API examples instead. If you
196
- want the FastAPI reference server, clone the repository or install from Git.
244
+ See
245
+ [PRODUCTION_SERVER.md](RealtimeSTT_server/PRODUCTION_SERVER.md).
197
246
 
198
- Open `http://localhost:8010`. See [docs/fastapi-server.md](docs/fastapi-server.md)
199
- for engine recipes, websocket protocol details, health checks, and metrics.
247
+ The interactive browser reference app remains in `example_fastapi_server` for
248
+ source checkouts. See [docs/fastapi-server.md](docs/fastapi-server.md) for its
249
+ UI, engine recipes, protocol details, and metrics.
200
250
 
201
251
  ## Contributing
202
252
 
@@ -0,0 +1,205 @@
1
+ # Release Notes
2
+
3
+ ## 1.0.4 - 2026-08-21
4
+
5
+ ### Fixed
6
+
7
+ - Replaced the production WebSocket recorder/VAD-derived final path with a
8
+ turn-owned state machine and authoritative canonical PCM buffer. Every
9
+ finalized turn now produces exactly one Parakeet final result followed by
10
+ exactly one completion.
11
+ - Made accepted 16 kHz PCM invariant to 10/20/40/64/100 ms packet boundaries;
12
+ the WebSocket final uses the same final scheduler lane, audio normalization,
13
+ language, and prompt policy as raw-PCM HTTP transcription.
14
+ - Fenced late live/final/transport callbacks across cancel, reset, disconnect,
15
+ and reconnect, including reconnects that reuse a session or turn id.
16
+ - Fixed live Nemotron input scaling, removed growing full-buffer snapshots,
17
+ fed only new frames to one stream per logical turn, and deduplicated and
18
+ rate-limited changed partials.
19
+ - Closed long-session lifecycle leaks by retiring completed final threads,
20
+ draining cancelled live queues, cancelling timed-out live streams, pruning
21
+ connection epochs, and resolving queued scheduler jobs during shutdown.
22
+ - Moved native live-stream creation and cancellation off the ASGI event loop,
23
+ fenced streams returned after a turn was retired, and bounded concurrent
24
+ native cancellation work process-wide.
25
+ - Made final/completion admission atomic across reset and cancel, scoped final
26
+ timeout cancellation to the exact scheduler request, and bounded live
27
+ backpressure by queued audio duration instead of client packet count.
28
+ - Bounded terminal-event reserve for slow WebSocket readers and close the
29
+ connection with code 1013 instead of allowing finalized turns to grow an
30
+ unbounded outbound queue.
31
+ - Removed bearer-token command-line flags; production tokens now come only
32
+ from `REALTIMESTT_SERVER_BEARER_TOKEN` so they cannot appear in process
33
+ listings or shell history.
34
+
35
+ ### Changed
36
+
37
+ - Production WebSocket audio is explicitly canonical mono 16 kHz
38
+ `pcm_s16le`. HTTP final transcription retains its documented supported input
39
+ sample rates and performs one whole-request resample.
40
+ - Streaming benchmark pacing now uses the absolute audio clock and validates
41
+ exact terminal counts, terminal/completion ordering, quiet completion tails,
42
+ long-run repetitions, and bounded parallel concurrency.
43
+ - HTTP A/B and WebSocket benchmark reports redact endpoints, corpus paths,
44
+ clip identifiers, references, partials, and finals by default. Sensitive
45
+ per-record output requires an explicit protected-local opt-in.
46
+ - The production CPU profile keeps Nemotron live hypotheses display-only;
47
+ Parakeet remains the sole authoritative turn final.
48
+
49
+ ### Notes
50
+
51
+ - This release supersedes the old TestPyPI `1.0.3` artifact. PyPI
52
+ files are immutable, so the corrected production release uses version `1.0.4`.
53
+ - The supported Nemotron/Parakeet production profile remains Linux x86-64.
54
+ Keep the server on loopback behind an authenticated TLS/WSS endpoint and
55
+ retain a local-live/final-server rollback path during client rollout.
56
+ - No production-PyPI publication is implied by this release candidate.
57
+
58
+ ## 1.0.3 - 2026-08-20
59
+
60
+ ### Added
61
+
62
+ - Added the experimental optional FunASR/SenseVoice transcription backend and
63
+ install extra.
64
+ - Added `AudioToTextRecorder.feed_audio_file()` for feeding audio files through
65
+ the manual audio input path.
66
+ - Added `TranscriptionResult.metadata` support and word timestamp plumbing for
67
+ backends that can return word-level timing.
68
+ - Added public custom transcription engine interfaces through
69
+ `RealtimeSTT.engines`, including `BaseEngine`, `TranscriptionEngineConfig`,
70
+ `TranscriptionResult`, and `StreamingTranscriptionSession`.
71
+ - Added custom engine documentation showing `transcription_executor`,
72
+ `realtime_transcription_executor`, and streaming-session integration.
73
+ - Added opt-in realtime punctuation splitting through
74
+ `realtime_punctuation_split_marks`. The default remains `"off"`; `"sentence"`
75
+ is the supported production mode for `.`, `?`, and `!`.
76
+ - Added the multilingual sherpa-onnx Nemotron 3.5 0.6B INT8 engine as a true
77
+ streaming engine with per-stream language selection, incremental frame
78
+ ingestion, final draining, reset, cancellation, and deterministic release.
79
+ - Added pinned manifests for the exact Nemotron streaming and Parakeet v3 final
80
+ model archives, including source, license, archive integrity, and extracted
81
+ file integrity metadata.
82
+ - Added `stt-install-sherpa-models` for resumable, verified, atomic installation
83
+ and offline reuse of those pinned model archives in persistent storage.
84
+ - Added a packaged production FastAPI server with versioned liveness,
85
+ readiness, capabilities, raw PCM16 final transcription, and ordered remote
86
+ streaming WebSocket APIs. Non-loopback binds require bearer authentication
87
+ and TLS. The server includes bounded queues and sessions, backpressure,
88
+ limits, structured errors, warmup, and graceful resource cleanup.
89
+ - Added a reproducible same-host A/B benchmark harness for the AgentTalk/raw
90
+ PCM16 contract and release CI for unit, distribution, and isolated wheel
91
+ installation checks.
92
+
93
+ ### Changed
94
+
95
+ - Hardened realtime punctuation splitting with repeated-observation checks,
96
+ timestamp validation, guarded dash handling, and synchronized split-state
97
+ bookkeeping.
98
+ - Expanded install-extra validation to include the FunASR extra and the `all`
99
+ extra.
100
+ - Exposed the same engine authoring interfaces through lazy top-level package
101
+ imports while keeping existing `BaseTranscriptionEngine` imports compatible.
102
+ - Pinned the sherpa-onnx optional dependency to the release-tested version and
103
+ hardened empty-output/language handling for Parakeet final transcription.
104
+ - Made the production `server` extra install a local Silero ONNX VAD runtime,
105
+ avoiding interactive Torch Hub model retrieval when WebSocket sessions start.
106
+ - Promoted the remote production server to the `stt-server-production` packaged
107
+ entry point while preserving the legacy `stt-server` command.
108
+
109
+ ### Notes
110
+
111
+ - Comma, dash, ellipsis, and `all` punctuation split modes remain available for
112
+ experiments but are not promoted as production-supported in this release.
113
+ - Realtime punctuation splitting requires word timestamps. Built-in support is
114
+ currently wired through `faster_whisper`; other built-in engines skip the
115
+ split path.
116
+ - The production CPU pair uses Nemotron only for replaceable live hypotheses;
117
+ Parakeet transcribes the authoritative final audio once and replaces the live
118
+ hypothesis at turn completion.
119
+ - The exact model weights remain external artifacts governed by their own
120
+ licenses. The package ships manifests and installation tooling, not weights.
121
+ - The pinned two-model production profile targets Linux x86-64. Native Windows
122
+ remains suitable for development, but Parakeet can return empty output for
123
+ some voiced cumulative-turn audio; use the Linux server or another final
124
+ engine until that runtime combination is proven reliable.
125
+ - On the same Linux CPU host and final model, the 1.0.3 server matched the
126
+ reference WER/CER/exact result, was at single-client latency parity, and at
127
+ four concurrent clients improved throughput by 7.5% and p95 latency by 33.2%.
128
+
129
+ ## 1.0.2 - 2026-05-31
130
+
131
+ ### Changed
132
+
133
+ - Split the `AudioToTextRecorder` implementation behind the existing public
134
+ facade into focused core modules for lifecycle, recording, realtime
135
+ transcription, voice activity, wake-word handling, initialization, shutdown,
136
+ and formatting.
137
+ - Refreshed recorder architecture and compatibility documentation so the public
138
+ facade, threading boundaries, and regression checks are easier to audit.
139
+ - Normalized package docstrings and comments to use block-style summaries and
140
+ focused runtime explanations.
141
+
142
+ ### Removed
143
+
144
+ - Removed an unused internal console color helper from `audio_recorder.py`.
145
+
146
+ ## 1.0.1 - 2026-05-20
147
+
148
+ ### Added
149
+
150
+ - Added a generic streaming transcription session interface so engines can
151
+ opt in to incremental realtime decoding while existing engines keep the
152
+ full-buffer fallback behavior.
153
+ - Added `kroko_onnx` transcription engine for Kroko/Banafo `.data` streaming
154
+ models.
155
+ - Added Kroko realtime preview support that feeds streaming engines only newly
156
+ recorded audio frames through a persistent session.
157
+ - Added `stt-install-kroko`, exposed through the `kroko-builder` extra, to help
158
+ build and install Kroko-ONNX for the active Python environment.
159
+ - Added focused Kroko and realtime streaming unit coverage plus a public manual
160
+ `tests/realtimestt_kroko_test.py` smoke script.
161
+ - Added `omnilingual_asr` transcription engine for Meta
162
+ Omnilingual ASR on Linux/WSL2 with Python 3.11.x, with support for the
163
+ published CTC and LLM model cards. Native Windows is not supported because
164
+ `fairseq2n` has no Windows wheel; Python 3.12.x is blocked by upstream
165
+ `omnilingual-asr` package metadata.
166
+ - Added `docs/licenses.md` with engine and model-family license notes.
167
+
168
+ ### Changed
169
+
170
+ - Kroko Community models with known public filenames can be auto-downloaded
171
+ into the RealtimeSTT cache when `auto_download_model` is enabled.
172
+ - Kroko final transcription remains one-shot. The new streaming path is used
173
+ for realtime previews only when the realtime engine advertises streaming
174
+ support.
175
+ - Kroko model cadence is used to choose automatic finalization tail padding.
176
+ - Omnilingual ASR uses `omniASR_CTC_1B_v2` as the default when the
177
+ recorder is still configured with a Whisper default model name.
178
+ - Omnilingual in-memory audio is passed to the backend as predecoded waveform
179
+ dictionaries to avoid the upstream package treating raw float arrays as
180
+ encoded audio bytes.
181
+
182
+ ### Notes
183
+
184
+ - Install/build Kroko-ONNX separately with
185
+ `pip install "RealtimeSTT[kroko-builder,silero-onnx-cpu]"` followed by
186
+ `stt-install-kroko --build`, or install a compatible Kroko-ONNX wheel in the
187
+ same Python environment. The `silero-onnx-cpu` extra provides the local VAD
188
+ backend used by recorder-based Kroko smoke tests and live microphone use.
189
+ - Licensed Pro models require a Pro-capable Kroko wheel and a key supplied at
190
+ runtime through configuration, CLI, or environment variables. Do not commit
191
+ keys, Pro models, generated logs, local wheels, or local cache contents.
192
+ - `Pro-16-L` is the recommended realtime model for the fastest partials. Local
193
+ private validation observed the expected low-latency partial behavior, but
194
+ exact cadence depends on runtime, provider, hardware, and scheduling.
195
+ - `suppress_native_output=True` redirects Kroko native stdout/stderr during
196
+ recognizer calls and sets `KROKO_ONNX_SUPPRESS_LICENSE_OUTPUT=1`. Reliable
197
+ suppression of asynchronous Pro license refresh messages requires a Kroko
198
+ wheel rebuilt with RealtimeSTT's native quiet-output patch; older Kroko wheels
199
+ may still print background license status text.
200
+ - Omnilingual ASR support is optional and Linux/WSL2 Python 3.11.x-oriented.
201
+ Native Windows installs are not supported by the upstream dependency stack at
202
+ this time, and Python 3.12.x cannot resolve the current upstream package.
203
+ - `omniASR_CTC_1B_v2` is the recommended Omnilingual starting point for local
204
+ realtime tests in this release. Smaller/larger CTC and LLM models are exposed
205
+ through model-card plumbing but require their own quality and memory checks.
@@ -0,0 +1,84 @@
1
+ """
2
+ Exposes the public RealtimeSTT package objects through lazy imports.
3
+ """
4
+
5
+ __all__ = [
6
+ "AudioToTextRecorder",
7
+ "AudioToTextRecorderClient",
8
+ "AudioInput",
9
+ "BaseEngine",
10
+ "BaseTranscriptionEngine",
11
+ "RealtimeSpeechBoundaryDetector",
12
+ "SpeechBoundaryEvent",
13
+ "SpeechBoundaryResult",
14
+ "StreamingTranscriptionSession",
15
+ "TranscriptionEngineConfig",
16
+ "TranscriptionEngineError",
17
+ "TranscriptionInfo",
18
+ "TranscriptionResult",
19
+ "UnsupportedTranscriptionEngineError",
20
+ ]
21
+
22
+
23
+ def __getattr__(name):
24
+ """
25
+ Loads exported package attributes lazily.
26
+ """
27
+
28
+ if name == "AudioToTextRecorder":
29
+ from .audio_recorder import AudioToTextRecorder
30
+
31
+ return AudioToTextRecorder
32
+ if name == "AudioToTextRecorderClient":
33
+ from .audio_recorder_client import AudioToTextRecorderClient
34
+
35
+ return AudioToTextRecorderClient
36
+ if name == "AudioInput":
37
+ from .audio_input import AudioInput
38
+
39
+ return AudioInput
40
+ if name == "BaseEngine":
41
+ from .engines import BaseEngine
42
+
43
+ return BaseEngine
44
+ if name == "BaseTranscriptionEngine":
45
+ from .engines import BaseTranscriptionEngine
46
+
47
+ return BaseTranscriptionEngine
48
+ if name == "StreamingTranscriptionSession":
49
+ from .engines import StreamingTranscriptionSession
50
+
51
+ return StreamingTranscriptionSession
52
+ if name == "TranscriptionEngineConfig":
53
+ from .engines import TranscriptionEngineConfig
54
+
55
+ return TranscriptionEngineConfig
56
+ if name == "TranscriptionEngineError":
57
+ from .engines import TranscriptionEngineError
58
+
59
+ return TranscriptionEngineError
60
+ if name == "TranscriptionInfo":
61
+ from .engines import TranscriptionInfo
62
+
63
+ return TranscriptionInfo
64
+ if name == "TranscriptionResult":
65
+ from .engines import TranscriptionResult
66
+
67
+ return TranscriptionResult
68
+ if name == "UnsupportedTranscriptionEngineError":
69
+ from .engines import UnsupportedTranscriptionEngineError
70
+
71
+ return UnsupportedTranscriptionEngineError
72
+ if name == "RealtimeSpeechBoundaryDetector":
73
+ from .core.realtime_boundary_detector import RealtimeSpeechBoundaryDetector
74
+
75
+ return RealtimeSpeechBoundaryDetector
76
+ if name == "SpeechBoundaryEvent":
77
+ from .core.realtime_boundary_detector import SpeechBoundaryEvent
78
+
79
+ return SpeechBoundaryEvent
80
+ if name == "SpeechBoundaryResult":
81
+ from .core.realtime_boundary_detector import SpeechBoundaryResult
82
+
83
+ return SpeechBoundaryResult
84
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -0,0 +1 @@
1
+ """Package data assets used by RealtimeSTT."""