@qvac/transcription-whispercpp 0.6.1 → 0.6.3

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 (21) hide show
  1. package/README.md +30 -4
  2. package/package.json +2 -1
  3. package/prebuilds/android-arm64/qvac__transcription-whispercpp/libggml-cpu.a +0 -0
  4. package/prebuilds/android-arm64/qvac__transcription-whispercpp.bare +0 -0
  5. package/prebuilds/darwin-arm64/qvac__transcription-whispercpp.bare +0 -0
  6. package/prebuilds/darwin-arm64/qvac__transcription-whispercpp.bare.exports +1 -1
  7. package/prebuilds/darwin-x64/qvac__transcription-whispercpp.bare +0 -0
  8. package/prebuilds/darwin-x64/qvac__transcription-whispercpp.bare.exports +10 -4
  9. package/prebuilds/ios-arm64/qvac__transcription-whispercpp.bare +0 -0
  10. package/prebuilds/ios-arm64/qvac__transcription-whispercpp.bare.exports +1 -1
  11. package/prebuilds/ios-arm64-simulator/qvac__transcription-whispercpp.bare +0 -0
  12. package/prebuilds/ios-arm64-simulator/qvac__transcription-whispercpp.bare.exports +1 -1
  13. package/prebuilds/ios-x64-simulator/qvac__transcription-whispercpp.bare +0 -0
  14. package/prebuilds/ios-x64-simulator/qvac__transcription-whispercpp.bare.exports +10 -4
  15. package/prebuilds/linux-arm64/qvac__transcription-whispercpp/libggml-cpu.a +0 -0
  16. package/prebuilds/linux-arm64/qvac__transcription-whispercpp.bare +0 -0
  17. package/prebuilds/linux-x64/qvac__transcription-whispercpp/libggml-cpu.a +0 -0
  18. package/prebuilds/linux-x64/qvac__transcription-whispercpp.bare +0 -0
  19. package/prebuilds/win32-x64/qvac__transcription-whispercpp.bare +0 -0
  20. package/prebuilds/win32-x64/qvac__transcription-whispercpp.bare.exports +0 -0
  21. package/whisper.js +16 -0
package/README.md CHANGED
@@ -128,16 +128,16 @@ $env:VCPKG_ROOT = "C:\path\to\vcpkg"
128
128
 
129
129
  **Linux:**
130
130
  ```bash
131
- # Ubuntu/Debian
131
+ # Ubuntu/Debian — includes Clang and libc++ required by the native addon
132
132
  sudo apt update
133
- sudo apt install build-essential cmake git pkg-config
133
+ sudo apt install clang libc++-dev libc++abi-dev build-essential cmake git pkg-config
134
134
 
135
135
  # CentOS/RHEL/Fedora
136
136
  sudo yum groupinstall "Development Tools"
137
- sudo yum install cmake git pkgconfig
137
+ sudo yum install cmake git pkgconfig clang
138
138
  # or for newer versions:
139
139
  sudo dnf groupinstall "Development Tools"
140
- sudo dnf install cmake git pkgconfig
140
+ sudo dnf install cmake git pkgconfig clang
141
141
  ```
142
142
 
143
143
  **macOS:**
@@ -206,6 +206,18 @@ This command runs the complete build sequence:
206
206
  2. `bare-make build` - Compiles the native C++ addon
207
207
  3. `bare-make install` - Installs the built addon
208
208
 
209
+ #### Building with Vulkan GPU Acceleration
210
+
211
+ On Linux, Android, and Windows, Vulkan support can be enabled at build time. Ensure the [Vulkan SDK](#gpu-acceleration-optional) is installed, then pass `-D ENABLE_VULKAN=ON` during the generate step:
212
+
213
+ ```bash
214
+ bare-make generate -D ENABLE_VULKAN=ON
215
+ bare-make build
216
+ bare-make install
217
+ ```
218
+
219
+ CI prebuilds for Linux, Android, and Windows include Vulkan by default. macOS and iOS use Metal instead.
220
+
209
221
  #### Running Tests
210
222
 
211
223
  After building, you can run the test suite:
@@ -261,6 +273,20 @@ Most users interact with the addon exclusively through `index.js`. From that ent
261
273
  | `whisperConfig` | *(any `whisper_full_params` key)* | Forwarded untouched. We surface convenience defaults in `index.js`, but every whisper.cpp flag is accepted—see [Advanced configuration](#advanced-configuration). |
262
274
  | `miscConfig` | `caption_enabled` | Formats segments with `<\|start\|>..<\|end\|>` markers |
263
275
 
276
+ #### GPU acceleration is opt-in
277
+
278
+ `use_gpu` defaults to `false`. To enable Vulkan (Linux/Windows/Android) or Metal (macOS/iOS) acceleration, set `use_gpu: true` explicitly in `contextParams`:
279
+
280
+ ```javascript
281
+ const config = {
282
+ contextParams: {
283
+ model: './models/ggml-tiny.bin',
284
+ use_gpu: true, // opt-in to GPU
285
+ gpu_device: 0
286
+ }
287
+ }
288
+ ```
289
+
264
290
  #### Context keys that force a full reload
265
291
 
266
292
  Internally `WhisperModel::configContextIsChanged()` watches `model`, `use_gpu`, `flash_attn` and `gpu_device`. If any of these change we must:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/transcription-whispercpp",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "transcription addon for qvac",
5
5
  "addon": true,
6
6
  "engines": {
@@ -12,6 +12,7 @@
12
12
  "build": "bare-make generate && bare-make build && bare-make install",
13
13
  "test:unit": "brittle-bare test/unit/**/*.test.js",
14
14
  "test:integration": "brittle-bare test/integration/addon.test.js",
15
+ "test:benchmark:rtf": "brittle-bare test/benchmark/rtf-benchmark.test.js",
15
16
  "test:integration:long": "brittle-bare test/integration/**/longES.test.js",
16
17
  "test:cpp:build": "bare-make generate -D BUILD_TESTING=ON && bare-make build --target test-whisper-core && bare-make install",
17
18
  "test:cpp:run": "cd build/addon/tests/ && LLVM_PROFILE_FILE=default.profraw ./test-whisper-core --gtest_output=xml:cpp-test-results.xml",
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.6.1"
10
+ "version": "0.6.3"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.6.1"
10
+ "version": "0.6.3"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -58,6 +58,7 @@
58
58
  "__ZTSNSt3__120__shared_ptr_emplaceIN32qvac_lib_inference_addon_whisper25JsTranscriptOutputHandlerENS_9allocatorIS2_EEEE",
59
59
  "__ZTSN28qvac_lib_inference_addon_cpp16OutputCallBackJsE",
60
60
  "__ZTINSt3__111__end_stateIcEE",
61
+ "__ZTSNSt3__110__function6__funcIZN32qvac_lib_inference_addon_whisper6runJobEP8js_env_sP18js_callback_info_sEUlRKNS2_10TranscriptEE_NS_9allocatorISA_EEFvS9_EEE",
61
62
  "__ZTIN28qvac_lib_inference_addon_cpp6Output5ErrorE",
62
63
  "__ZTSNSt3__120__shared_ptr_emplaceIN28qvac_lib_inference_addon_cpp6logger8JsLogger5StateENS_9allocatorIS4_EEEE",
63
64
  "__ZTIN32qvac_lib_inference_addon_whisper10TranscriptE",
@@ -142,6 +143,7 @@
142
143
  "__ZTSNSt3__111__end_stateIcEE",
143
144
  "__ZTSN8js_blobs15FinalizedStreamIcEE",
144
145
  "__ZTSNSt3__120__shared_ptr_emplaceIN28qvac_lib_inference_addon_cpp9out_handl21JsLogMsgOutputHandlerENS_9allocatorIS3_EEEE",
146
+ "__ZTSZN32qvac_lib_inference_addon_whisper6runJobEP8js_env_sP18js_callback_info_sEUlRKNS_10TranscriptEE_",
145
147
  "__ZTINSt3__110__function6__funcIZN32qvac_lib_inference_addon_whisper30JsTranscriptArrayOutputHandlerC1EvEUlRKNS_6vectorINS2_10TranscriptENS_9allocatorIS5_EEEEE_NS6_ISB_EEFP10js_value_sSA_EEE",
146
148
  "__ZTIN28qvac_lib_inference_addon_cpp5model12IModelCancelE",
147
149
  "__ZTSN28qvac_lib_inference_addon_cpp9out_handl17BaseOutputHandlerIP10js_value_sN32qvac_lib_inference_addon_whisper10TranscriptEEE",
@@ -155,6 +157,8 @@
155
157
  "__ZTIN28qvac_lib_inference_addon_cpp9out_handl17BaseOutputHandlerIP10js_value_sNS_6Output6LogMsgEEE",
156
158
  "__ZTSNSt3__111__match_anyIcEE",
157
159
  "__ZTINSt3__121__empty_non_own_stateIcEE",
160
+ "__ZTSNSt3__110__function6__baseIFvRKN32qvac_lib_inference_addon_whisper10TranscriptEEEE",
161
+ "__ZTIZN32qvac_lib_inference_addon_whisper6runJobEP8js_env_sP18js_callback_info_sEUlRKNS_10TranscriptEE_",
158
162
  "__ZTSNSt3__120__shared_ptr_pointerIPNS_13__empty_stateIcEENS_10shared_ptrIS2_E27__shared_ptr_default_deleteIS2_S2_EENS_9allocatorIS2_EEEE",
159
163
  "__ZN32qvac_lib_inference_addon_whisper19g_streamingSessionsE",
160
164
  "__ZTSN4ggml3cpu6repack13tensor_traitsI10block_q8_0Lx8ELx4EL9ggml_type8EEE",
@@ -268,11 +272,13 @@
268
272
  "__ZTSNSt3__110__function6__baseIFP10js_value_sRKNS_6vectorINS_4pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_7variantIJdxEEEEENS9_ISE_EEEEEEE",
269
273
  "__ZTSN28qvac_lib_inference_addon_cpp9out_handl19JsBaseOutputHandlerINSt3__16vectorIN32qvac_lib_inference_addon_whisper10TranscriptENS2_9allocatorIS5_EEEEEE",
270
274
  "__ZTSNSt3__16vectorINS_4pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_7variantIJdxEEEEENS5_ISA_EEEE",
275
+ "__ZTINSt3__110__function6__funcIZN32qvac_lib_inference_addon_whisper6runJobEP8js_env_sP18js_callback_info_sEUlRKNS2_10TranscriptEE_NS_9allocatorISA_EEFvS9_EEE",
271
276
  "__ZTIN28qvac_lib_inference_addon_cpp9out_handl27JsRuntimeStatsOutputHandlerE",
272
277
  "__ZTSN4ggml3cpu6repack18tensor_traits_baseE",
273
278
  "__ZTIN28qvac_lib_inference_addon_cpp9out_handl22OutputHandlerInterfaceIP10js_value_sEE",
274
279
  "__ZTINSt3__120__match_char_collateIcNS_12regex_traitsIcEEEE",
275
280
  "__ZTSN28qvac_lib_inference_addon_cpp2js16UniqueRefDeleterE",
281
+ "__ZTINSt3__110__function6__baseIFvRKN32qvac_lib_inference_addon_whisper10TranscriptEEEE",
276
282
  "__ZTIN28qvac_lib_inference_addon_cpp16OutputCallBackJsE",
277
283
  "__ZTIN4ggml3cpu6repack13tensor_traitsI10block_q8_0Lx4ELx4EL9ggml_type8EEE",
278
284
  "__ZTINSt3__110__function6__baseIFP11ggml_cgraphvEEE",
@@ -912,16 +918,16 @@
912
918
  "_ggml_metal_pipeline_init",
913
919
  "__ZN4ggml3cpu6repack4gemvI10block_q6_KLx4ELx8EL9ggml_type15EEEviPfmPKvS7_ii",
914
920
  "__ZN4ggml3cpu6repack4gemvI12block_iq4_nlLx4ELx4EL9ggml_type8EEEviPfmPKvS7_ii",
915
- "_ggml_new_tensor_1d",
916
921
  "_ggml_op_name",
922
+ "_ggml_vec_dot_iq2_s_q8_K",
917
923
  "_dequantize_row_iq3_s",
918
924
  "__ZN4ggml3cpu6repack4gemmI10block_q2_KLx8ELx8EL9ggml_type15EEEviPfmPKvS7_ii",
919
925
  "_ggml_add_cast",
920
926
  "_ggml_metal_graph_compute",
921
927
  "_ggml_backend_buffer_get_alignment",
922
- "_whisper_vad_free_segments",
928
+ "_ggml_new_tensor_1d",
923
929
  "_ggml_sqr",
924
- "_ggml_vec_dot_iq2_s_q8_K",
930
+ "_whisper_vad_free_segments",
925
931
  "_ggml_compute_forward_timestep_embedding",
926
932
  "_ggml_metal_cv_set_int16",
927
933
  "_ggml_set_i32_nd",
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.6.1"
10
+ "version": "0.6.3"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.6.1"
10
+ "version": "0.6.3"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.6.1"
10
+ "version": "0.6.3"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -59,6 +59,7 @@
59
59
  "__ZTSNSt3__120__shared_ptr_emplaceIN32qvac_lib_inference_addon_whisper25JsTranscriptOutputHandlerENS_9allocatorIS2_EEEE",
60
60
  "__ZTSN28qvac_lib_inference_addon_cpp16OutputCallBackJsE",
61
61
  "__ZTINSt3__111__end_stateIcEE",
62
+ "__ZTSNSt3__110__function6__funcIZN32qvac_lib_inference_addon_whisper6runJobEP8js_env_sP18js_callback_info_sEUlRKNS2_10TranscriptEE_NS_9allocatorISA_EEFvS9_EEE",
62
63
  "__ZTIN28qvac_lib_inference_addon_cpp6Output5ErrorE",
63
64
  "__ZTSNSt3__120__shared_ptr_emplaceIN28qvac_lib_inference_addon_cpp6logger8JsLogger5StateENS_9allocatorIS4_EEEE",
64
65
  "__ZTIN32qvac_lib_inference_addon_whisper10TranscriptE",
@@ -145,6 +146,7 @@
145
146
  "__ZTSNSt3__111__end_stateIcEE",
146
147
  "__ZTSN8js_blobs15FinalizedStreamIcEE",
147
148
  "__ZTSNSt3__120__shared_ptr_emplaceIN28qvac_lib_inference_addon_cpp9out_handl21JsLogMsgOutputHandlerENS_9allocatorIS3_EEEE",
149
+ "__ZTSZN32qvac_lib_inference_addon_whisper6runJobEP8js_env_sP18js_callback_info_sEUlRKNS_10TranscriptEE_",
148
150
  "__ZTINSt3__110__function6__funcIZN32qvac_lib_inference_addon_whisper30JsTranscriptArrayOutputHandlerC1EvEUlRKNS_6vectorINS2_10TranscriptENS_9allocatorIS5_EEEEE_NS6_ISB_EEFP10js_value_sSA_EEE",
149
151
  "__ZTIN28qvac_lib_inference_addon_cpp5model12IModelCancelE",
150
152
  "__ZTSN28qvac_lib_inference_addon_cpp9out_handl17BaseOutputHandlerIP10js_value_sN32qvac_lib_inference_addon_whisper10TranscriptEEE",
@@ -158,6 +160,8 @@
158
160
  "__ZTIN28qvac_lib_inference_addon_cpp9out_handl17BaseOutputHandlerIP10js_value_sNS_6Output6LogMsgEEE",
159
161
  "__ZTSNSt3__111__match_anyIcEE",
160
162
  "__ZTINSt3__121__empty_non_own_stateIcEE",
163
+ "__ZTSNSt3__110__function6__baseIFvRKN32qvac_lib_inference_addon_whisper10TranscriptEEEE",
164
+ "__ZTIZN32qvac_lib_inference_addon_whisper6runJobEP8js_env_sP18js_callback_info_sEUlRKNS_10TranscriptEE_",
161
165
  "__ZTSNSt3__120__shared_ptr_pointerIPNS_13__empty_stateIcEENS_10shared_ptrIS2_E27__shared_ptr_default_deleteIS2_S2_EENS_9allocatorIS2_EEEE",
162
166
  "__ZN32qvac_lib_inference_addon_whisper19g_streamingSessionsE",
163
167
  "__ZTSN4ggml3cpu6repack13tensor_traitsI10block_q8_0Lx8ELx4EL9ggml_type8EEE",
@@ -272,11 +276,13 @@
272
276
  "__ZTSNSt3__110__function6__baseIFP10js_value_sRKNS_6vectorINS_4pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_7variantIJdxEEEEENS9_ISE_EEEEEEE",
273
277
  "__ZTSN28qvac_lib_inference_addon_cpp9out_handl19JsBaseOutputHandlerINSt3__16vectorIN32qvac_lib_inference_addon_whisper10TranscriptENS2_9allocatorIS5_EEEEEE",
274
278
  "__ZTSNSt3__16vectorINS_4pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_7variantIJdxEEEEENS5_ISA_EEEE",
279
+ "__ZTINSt3__110__function6__funcIZN32qvac_lib_inference_addon_whisper6runJobEP8js_env_sP18js_callback_info_sEUlRKNS2_10TranscriptEE_NS_9allocatorISA_EEFvS9_EEE",
275
280
  "__ZTIN28qvac_lib_inference_addon_cpp9out_handl27JsRuntimeStatsOutputHandlerE",
276
281
  "__ZTSN4ggml3cpu6repack18tensor_traits_baseE",
277
282
  "__ZTIN28qvac_lib_inference_addon_cpp9out_handl22OutputHandlerInterfaceIP10js_value_sEE",
278
283
  "__ZTINSt3__120__match_char_collateIcNS_12regex_traitsIcEEEE",
279
284
  "__ZTSN28qvac_lib_inference_addon_cpp2js16UniqueRefDeleterE",
285
+ "__ZTINSt3__110__function6__baseIFvRKN32qvac_lib_inference_addon_whisper10TranscriptEEEE",
280
286
  "__ZTIN28qvac_lib_inference_addon_cpp16OutputCallBackJsE",
281
287
  "__ZTIN4ggml3cpu6repack13tensor_traitsI10block_q8_0Lx4ELx4EL9ggml_type8EEE",
282
288
  "__ZTINSt3__110__function6__baseIFP11ggml_cgraphvEEE",
@@ -916,16 +922,16 @@
916
922
  "_ggml_metal_pipeline_init",
917
923
  "__ZN4ggml3cpu6repack4gemvI10block_q6_KLx4ELx8EL9ggml_type15EEEviPfmPKvS7_ii",
918
924
  "__ZN4ggml3cpu6repack4gemvI12block_iq4_nlLx4ELx4EL9ggml_type8EEEviPfmPKvS7_ii",
919
- "_ggml_new_tensor_1d",
920
925
  "_ggml_op_name",
926
+ "_ggml_vec_dot_iq2_s_q8_K",
921
927
  "_dequantize_row_iq3_s",
922
928
  "__ZN4ggml3cpu6repack4gemmI10block_q2_KLx8ELx8EL9ggml_type15EEEviPfmPKvS7_ii",
923
929
  "_ggml_add_cast",
924
930
  "_ggml_metal_graph_compute",
925
931
  "_ggml_backend_buffer_get_alignment",
926
- "_whisper_vad_free_segments",
932
+ "_ggml_new_tensor_1d",
927
933
  "_ggml_sqr",
928
- "_ggml_vec_dot_iq2_s_q8_K",
934
+ "_whisper_vad_free_segments",
929
935
  "_ggml_compute_forward_timestep_embedding",
930
936
  "_ggml_metal_cv_set_int16",
931
937
  "_ggml_set_i32_nd",
package/whisper.js CHANGED
@@ -90,6 +90,22 @@ class WhisperInterface {
90
90
 
91
91
  if (mappedEvent === 'Output') {
92
92
  this._setState(state.PROCESSING)
93
+ if (this._outputCb != null) {
94
+ const isTranscriptArray = Array.isArray(data) && data.length > 0 &&
95
+ typeof data[0]?.text === 'string'
96
+ const isSingleTranscript = !Array.isArray(data) &&
97
+ data && typeof data === 'object' && typeof data.text === 'string'
98
+ if (isTranscriptArray) {
99
+ for (const segment of data) {
100
+ this._outputCb(addon, 'Output', jobId, [segment], null)
101
+ }
102
+ } else if (isSingleTranscript) {
103
+ this._outputCb(addon, 'Output', jobId, [data], null)
104
+ } else {
105
+ this._outputCb(addon, 'Output', jobId, data, null)
106
+ }
107
+ }
108
+ return
93
109
  }
94
110
 
95
111
  if (this._outputCb != null) {