645 Commits

Author SHA1 Message Date
Aaron Boxer 3d63e82571 fix: add skip decorator to TestStartMetricsServer for CI without prometheus_client 2026-05-13 10:45:40 -04:00
Aaron Boxer ced4bdb737 feat: add Prometheus metrics instrumentation
- New whisper_live/metrics.py with Counter, Gauge, Histogram metrics
- Track connections (opened/closed/rejected), transcription latency,
  audio processed, segments emitted, REST requests, and errors
- All metric helpers are no-ops when prometheus_client not installed
- --metrics_port CLI flag to expose /metrics endpoint (0 = disabled)
- Metrics integrated into server.py, base.py at key instrumentation points
- 17 new tests in tests/test_metrics.py (178 total passing)
2026-05-13 10:45:40 -04:00
Aaron Boxer 4210697ca6 Add custom vocabulary / hotwords support 2026-05-13 10:32:28 -04:00
Aaron Boxer 445bf26e85 Extract hardcoded buffer constants into class attributes
- MAX_BUFFER_DURATION_S (45): max audio buffer before trimming
- BUFFER_TRIM_DURATION_S (30): duration to discard on trim
- CLIP_THRESHOLD_DURATION_S (25): stale audio clip threshold
- CLIP_TAIL_DURATION_S (5): audio tail to keep after clipping
- All values can now be overridden by subclasses
2026-05-11 20:05:38 -04:00
Aaron Boxer b534f9d249 Clarify --translate vs --enable_translation CLI flags
- --translate: Whisper built-in to-English translation (task=translate)
- --enable_translation: M2M100 any-to-any translation backend
- Added warning when both flags are used simultaneously
- Updated help text to distinguish the two features
2026-05-11 20:05:34 -04:00
Vineet Suryan 9a71a95ca8 Merge pull request #441 from boxerab/fix-clear-screen-shell-injection
Avoid clear screen shell injection by using ANSI escape codes
2026-05-08 17:36:11 +02:00
Vineet Suryan 485b211072 Merge pull request #440 from boxerab/input-validation-server-params
Validate server parameters on startup
2026-05-08 17:35:26 +02:00
Vineet Suryan 19847784ae Merge pull request #439 from boxerab/bounded-transcript-memory
Bound transcript memory and translation queue size
2026-05-08 17:34:41 +02:00
Vineet Suryan 52d94bf1fb Merge pull request #438 from boxerab/thread-safety-client-manager
Add thread safety to client manager with threading lock
2026-04-21 13:29:54 +02:00
Vineet Suryan 1c663d0bba Merge pull request #437 from boxerab/rawpcm
audio: add support for raw pcm input via server flag
2026-04-21 13:17:47 +02:00
Vineet Suryan 298a01f1b0 Merge pull request #436 from boxerab/testing
CI: expand test suite coverage
2026-04-20 17:58:48 +02:00
Aaron Boxer a6147a6745 Replace os.system() in clear_screen() with ANSI escape codes
- Eliminates shell injection risk from os.system('clear'/'cls')
- Uses ANSI escape sequence \033[H\033[2J instead
- Removed unused os import
- Added test verifying ANSI codes are used
2026-04-17 09:31:00 -04:00
Aaron Boxer 18bce1864a Validate server parameters on startup
- max_clients must be >= 1
- max_connection_time must be > 0
- batch_max_size must be >= 1 (when batch enabled)
- batch_window_ms must be >= 0 (when batch enabled)
- Added 5 new tests for parameter validation
2026-04-17 09:30:19 -04:00
Aaron Boxer 9e5e4a9970 Bound transcript memory and translation queue size
- Add MAX_TRANSCRIPT_LENGTH (500) and MAX_TRANSLATION_QUEUE_SIZE (100)
  class constants to ServeClientBase
- Trim transcript and text lists after each update_segments() call
- Create translation queue with maxsize to prevent unbounded growth
- Added tests for _trim_transcript()
2026-04-17 09:29:38 -04:00
Aaron Boxer 81cdbbca95 Add thread safety to ClientManager with threading.Lock
- All ClientManager methods (add_client, get_client, remove_client,
  get_wait_time, is_server_full, is_client_timeout) now protected by
  a threading.Lock
- cleanup() called outside the lock to avoid holding it during I/O
- is_server_full() computes wait time inline under lock instead of
  calling get_wait_time() to avoid nested lock acquisition
- Added concurrent thread safety tests for add/remove and get operations
2026-04-17 09:27:37 -04:00
Aaron Boxer f5340ddf1e audio: add support for raw pcm input via server flag
fixes #
2026-04-17 09:21:06 -04:00
Aaron Boxer b1cd51ac8a CI: expand test suite coverage
these new test cover issues such as thread safety, VAD thresholding,
message routing, error handling etc. that weren't covered by existing
tests. Mocking is used to avoid dependencies on GPU, ONNX etc.
2026-04-17 09:05:34 -04:00
Vineet Suryan e41324bf03 Merge pull request #435 from nightcityblade/fix/issue-327
fix: render transcript text safely in browser extensions
2026-04-16 12:37:33 +02:00
nightcityblade 31efff9330 fix: render transcript text safely in browser extensions 2026-04-15 23:09:39 +08:00
nightcityblade 68a8b57e66 docs: fix setup instructions errors reported in #405
- Clarify that setup.sh installs portaudio system dependency and list
  per-distro package names
- Add missing --gpus all flag to TensorRT Docker run command
- Fix Docker TensorRT example showing multiple --trt_model_path on one
  command (should be separate alternatives)
- Document --trt_py_session flag as workaround for TensorRT C++ session
  crashes (CrossAttentionMask warnings)

Closes #405

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 11:09:40 +08:00
Vineet Suryan 6de5c87d2f Bump version v0.8.0 v0.8.0 2026-03-17 14:48:07 +05:30
Vineet Suryan 8e09d16ee4 Merge pull request #430 from makaveli10/vineet/fix-run-client
Fix crash when no --files provided; use microphone input instead
2026-03-17 14:46:57 +05:30
Xiaoliang Gao 4943c25ff7 Fix crash when no --files provided; use microphone input instead 2026-03-17 14:36:20 +05:30
Vineet Suryan 710bdffb51 Merge pull request #429 from makaveli10/vineet/update-setup-packages
Expose __version__ in package root and update dependencies in setup.py
2026-03-17 14:19:15 +05:30
makaveli10 5f0010d720 Expose __version__ in package root and update dependencies in setup.py
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2026-03-17 13:34:34 +05:30
Vineet Suryan 6fcae6a30c Merge pull request #425 from nightcityblade/fix/issue-377
feat: make display_segments configurable in Client/TranscriptionClient
2026-03-16 10:34:29 +05:30
Vineet Suryan bc441dea23 Merge pull request #427 from ianwh02/fix/batch-single-vad-none
Fix NoneType crash in _process_single when VAD filters all audio
2026-03-13 17:02:43 +05:30
ianwh02 89466f7b77 Fix NoneType crash in _process_single when VAD filters all audio
When VAD removes all speech from an audio chunk, transcriber.transcribe() returns (None, info). Calling list(None) raises TypeError. The _process_multi path already handles this case; this aligns _process_single to match.
2026-03-11 16:48:23 +00:00
nightcityblade 6ae57c81cd feat: add --n_display_segments CLI arg to run_client.py 2026-03-11 00:05:07 +08:00
Vineet Suryan 5d8629ea0c Merge pull request #422 from ianwh02/feature/batch-inference
Add cross-client GPU batch inference for faster_whisper backend
2026-03-09 23:01:28 +05:30
ianwh02 e7e78a7151 Add unit tests for BatchInferenceWorker 2026-03-09 16:18:36 +00:00
ianwh02 3508b39584 Fix missing batch_config init causing CI test hang 2026-03-09 11:42:15 +00:00
nightcityblade 067573a510 feat: make display_segments configurable in Client/TranscriptionClient
Replace hardcoded [-4:] truncation with a configurable display_segments
parameter (default: 4) in both Client and TranscriptionClient classes.

Fixes #377
2026-03-08 12:19:54 +08:00
ianwh02 e8bd4fd532 Add cross-client GPU batch inference for faster_whisper backend 2026-02-26 00:00:51 +00:00
Marcus Edel f8869906b0 Merge pull request #419 from makaveli10/bump-whisper-version
Bump openai-whisper version to 20250625.
2026-02-20 08:04:31 -05:00
makaveli10 9fa7005511 Bump openai-whisper version to 20250625
Resolves pkg_resources missing during wheel build

Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2026-02-11 12:39:38 +00:00
Vineet Suryan e48d16f923 Merge pull request #398 from AlexStansfield/feature/faster-whisper-1.2.0
feat: update to support faster whisper 1.2.0
2026-02-11 17:57:05 +05:30
Vineet Suryan 98fcc5110b Merge pull request #418 from JenySadadia/enable-timestamps
Enable timestamps for transcripted text
2026-02-11 17:51:58 +05:30
Jeny Sadadia 5e33aa2a7e Enable timestamps for transcripted text
Add `--enable-timestamps` option to `run_client.py`
script to print out transcripted text with timestamps.

Sample output with translation enabled:
```
[0.000 -> 7.440]  And so, my fellow Americans, ask not what your country can do for you.
[7.440 -> 10.300]  Ask what you can do for your country.

TRANSLATION to fr:
[0.000 -> 7.440] Et donc, mes camarades américains, ne demandez pas ce que votre pays peut faire pour vous.
[7.440 -> 10.300] Demandez ce que vous pouvez faire pour votre pays.
```

Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
2026-02-10 15:43:20 +05:30
Vineet Suryan 6c8142a9d2 Merge pull request #415 from JenySadadia/run-client-docs
README.md: add instructions for running client
2026-02-06 20:03:19 +05:30
Aaron Boxer 29ee640409 api: add support OpenAI REST transcription api 2026-02-05 22:31:59 -05:00
Aaron Boxer b9ae2af8e6 setup.sh: support Fedora 2026-02-05 22:31:59 -05:00
Jeny Sadadia 9251394047 README.md: add instructions for running client
Specify command to run client script.

Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
2026-02-03 17:11:40 +05:30
Marcus Edel c6ee9a6870 Merge pull request #412 from makaveli10/vineet/fix-faster-whisper-custom-model-loading
Feat: support HuggingFace model IDs for faster_whisper_custom_model_path.
2026-01-13 15:27:43 -05:00
makaveli10 f5256fc62f feat: support HuggingFace model IDs for faster_whisper_custom_model_path
Previously, the server only accepted local file paths for custom Faster Whisper
models. This change allows passing HuggingFace repo IDs which are automatically
downloaded and converted to CTranslate2 format by the backend if not already in
CTranslate2 format.

Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2026-01-13 16:34:04 +05:30
Alex Stansfield c43eb1dd5a update to support faster whisper 1.2.0 2025-10-07 14:20:20 +00:00
Vineet Suryan 3b17bda5f9 Merge pull request #397 from locnnil/patch-1
fix(run_server.py): help text for max_connection_time argument
2025-09-25 21:09:58 +05:30
Lincoln Wallace 95a9b7ef05 fix(run_server.py): help text for max_connection_time argument
The help text for `--max_connection_time` is incorrect. Looks like a copy-paste mistake from `--cache_path`.
2025-09-25 11:14:35 -03:00
Vineet Suryan 5e6be74f6d Merge pull request #391 from makaveli10/integrate_live_translation
Integrate live translation
2025-07-24 12:07:03 +05:30
makaveli10 04db67170b ServeClientTranslation import only when enable_tranlsation is True
Signed-off-by: makaveli10 <vineet.suryan@collabora.com>
2025-07-22 15:47:06 +00:00