openspeechapi 0.4.1__tar.gz → 0.5.0__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 (192) hide show
  1. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/PKG-INFO +6 -1
  2. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/base.py +18 -0
  3. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/subprocess_exec.py +17 -0
  4. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/engine_catalog.py +60 -3
  5. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/engine_registry.yaml +40 -7
  6. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/factory.py +10 -0
  7. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/cosyvoice_venv.py +42 -78
  8. openspeechapi-0.5.0/openspeechapi/local_engines/engines/whisperlivekit.py +76 -0
  9. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/fish_venv.py +18 -38
  10. openspeechapi-0.5.0/openspeechapi/local_engines/gemma4_server.py +302 -0
  11. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/indextts_venv.py +21 -61
  12. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/isolated_venv.py +33 -10
  13. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/spark_venv.py +21 -61
  14. openspeechapi-0.5.0/openspeechapi/local_engines/venv_common.py +169 -0
  15. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/vllm_venv.py +8 -33
  16. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/deepgram.py +2 -1
  17. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/elevenlabs.py +18 -1
  18. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/faster_whisper.py +1 -1
  19. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/fireredasr_stt.py +13 -10
  20. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/funasr_stt.py +1 -1
  21. openspeechapi-0.5.0/openspeechapi/providers/stt/gemma4.py +678 -0
  22. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/mlx_whisper_stt.py +1 -1
  23. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/moonshine_stt.py +1 -1
  24. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/parakeet_mlx_stt.py +1 -1
  25. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/qwen3_asr.py +2 -1
  26. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/qwen3_omni_stt.py +229 -20
  27. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/sherpa_onnx.py +19 -1
  28. openspeechapi-0.5.0/openspeechapi/providers/stt/volcengine.py +172 -0
  29. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/vosk_stt.py +18 -1
  30. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/voxtral_stt.py +1 -1
  31. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/whisperlivekit.py +38 -1
  32. openspeechapi-0.5.0/openspeechapi/providers/tts/chatterbox.py +267 -0
  33. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/cosyvoice.py +7 -2
  34. openspeechapi-0.5.0/openspeechapi/providers/tts/cosyvoice3.py +140 -0
  35. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/deepgram.py +9 -4
  36. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/elevenlabs.py +55 -31
  37. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/fish_speech.py +4 -1
  38. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/minimax.py +10 -2
  39. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/volcengine.py +20 -6
  40. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/app.py +21 -2
  41. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/extras_installer.py +17 -2
  42. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/routes/chat.py +9 -2
  43. openspeechapi-0.5.0/openspeechapi/server/routes/config.py +395 -0
  44. openspeechapi-0.5.0/openspeechapi/server/routes/engine_catalog.py +785 -0
  45. openspeechapi-0.5.0/openspeechapi/server/routes/engine_services.py +221 -0
  46. openspeechapi-0.5.0/openspeechapi/server/routes/engines.py +153 -0
  47. openspeechapi-0.5.0/openspeechapi/server/routes/models.py +113 -0
  48. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/routes/stt.py +12 -2
  49. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/routes/tts.py +6 -1
  50. openspeechapi-0.5.0/openspeechapi/server/services/__init__.py +6 -0
  51. openspeechapi-0.5.0/openspeechapi/server/services/config_io.py +101 -0
  52. openspeechapi-0.5.0/openspeechapi/server/services/model_provision.py +118 -0
  53. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/webui/app.js +57 -3
  54. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/webui/styles.css +9 -1
  55. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/ws/stt_stream.py +21 -5
  56. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/ws/tts_stream.py +1 -1
  57. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/providers.example.yaml +11 -9
  58. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/pyproject.toml +10 -1
  59. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/whisperlivekit/native/install.sh +27 -15
  60. openspeechapi-0.4.1/openspeechapi/local_engines/engines/whisperlivekit.py +0 -54
  61. openspeechapi-0.4.1/openspeechapi/local_engines/venv_common.py +0 -29
  62. openspeechapi-0.4.1/openspeechapi/providers/stt/gemma4.py +0 -462
  63. openspeechapi-0.4.1/openspeechapi/providers/stt/volcengine.py +0 -108
  64. openspeechapi-0.4.1/openspeechapi/server/routes/management.py +0 -1780
  65. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/.gitignore +0 -0
  66. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/README.md +0 -0
  67. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/__init__.py +0 -0
  68. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/__main__.py +0 -0
  69. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/cli.py +0 -0
  70. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/client/__init__.py +0 -0
  71. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/client/client.py +0 -0
  72. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/config.py +0 -0
  73. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/__init__.py +0 -0
  74. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/enums.py +0 -0
  75. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/model_hub.py +0 -0
  76. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/model_presence.py +0 -0
  77. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/model_profile.py +0 -0
  78. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/models.py +0 -0
  79. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/registry.py +0 -0
  80. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/settings.py +0 -0
  81. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/core/voice_presets.py +0 -0
  82. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/demo.py +0 -0
  83. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/__init__.py +0 -0
  84. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/aim_provision.py +0 -0
  85. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/context.py +0 -0
  86. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/dispatcher.py +0 -0
  87. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/__init__.py +0 -0
  88. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/base.py +0 -0
  89. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/in_process.py +0 -0
  90. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/executors/remote.py +0 -0
  91. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/fanout.py +0 -0
  92. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/filters.py +0 -0
  93. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/lifecycle.py +0 -0
  94. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/dispatch/watcher.py +0 -0
  95. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/exceptions.py +0 -0
  96. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/__init__.py +0 -0
  97. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/aim_resolver.py +0 -0
  98. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/backends/__init__.py +0 -0
  99. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/backends/docker_backend.py +0 -0
  100. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/backends/native_backend.py +0 -0
  101. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/base.py +0 -0
  102. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/__init__.py +0 -0
  103. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/faster_whisper.py +0 -0
  104. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/fish_speech.py +0 -0
  105. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/sherpa_onnx.py +0 -0
  106. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/engines/whisper.py +0 -0
  107. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/manager.py +0 -0
  108. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/models.py +0 -0
  109. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/progress.py +0 -0
  110. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/registry.py +0 -0
  111. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/task_store.py +0 -0
  112. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/tasks.py +0 -0
  113. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/local_engines/vllm_gb10_patch.py +0 -0
  114. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/logging_config.py +0 -0
  115. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/observe/__init__.py +0 -0
  116. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/observe/base.py +0 -0
  117. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/observe/debug.py +0 -0
  118. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/observe/latency.py +0 -0
  119. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/observe/metrics.py +0 -0
  120. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/observe/tracing.py +0 -0
  121. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/observe/usage.py +0 -0
  122. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/__init__.py +0 -0
  123. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/_template.py +0 -0
  124. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/__init__.py +0 -0
  125. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/_local_audio.py +0 -0
  126. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/alibaba.py +0 -0
  127. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/assemblyai.py +0 -0
  128. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/azure_speech.py +0 -0
  129. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/baidu.py +0 -0
  130. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/canary_qwen_stt.py +0 -0
  131. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/dolphin_stt.py +0 -0
  132. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/google_cloud.py +0 -0
  133. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/iflytek.py +0 -0
  134. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/kimi_audio_stt.py +0 -0
  135. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/macos_speech.py +0 -0
  136. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/mms_languages.json +0 -0
  137. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/mms_stt.py +0 -0
  138. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/openai.py +0 -0
  139. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/paraformer.py +0 -0
  140. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/phi4_multimodal_stt.py +0 -0
  141. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/sensevoice.py +0 -0
  142. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/tencent.py +0 -0
  143. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/wenet_stt.py +0 -0
  144. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/whisper.py +0 -0
  145. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/stt/windows_speech.py +0 -0
  146. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/__init__.py +0 -0
  147. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/alibaba.py +0 -0
  148. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/azure_speech.py +0 -0
  149. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/baidu.py +0 -0
  150. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/coqui.py +0 -0
  151. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/f5_tts.py +0 -0
  152. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/google_cloud.py +0 -0
  153. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/iflytek.py +0 -0
  154. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/indextts.py +0 -0
  155. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/kokoro.py +0 -0
  156. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/macos_say.py +0 -0
  157. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/openai.py +0 -0
  158. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/piper.py +0 -0
  159. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/spark.py +0 -0
  160. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/tencent.py +0 -0
  161. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/providers/tts/windows_sapi.py +0 -0
  162. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/__init__.py +0 -0
  163. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/auth.py +0 -0
  164. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/middleware.py +0 -0
  165. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/model_downloads.py +0 -0
  166. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/native_installer.py +0 -0
  167. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/routes/__init__.py +0 -0
  168. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/routes/webui.py +0 -0
  169. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/system_metrics.py +0 -0
  170. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/webui/index.html +0 -0
  171. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/server/ws/__init__.py +0 -0
  172. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/telemetry/__init__.py +0 -0
  173. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/telemetry/perf.py +0 -0
  174. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/utils/__init__.py +0 -0
  175. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/utils/audio_converter.py +0 -0
  176. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/utils/audio_playback.py +0 -0
  177. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/openspeechapi/vendor_registry.yaml +0 -0
  178. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/aim_adopt.py +0 -0
  179. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/aim_consumers.py +0 -0
  180. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/cloud/install.sh +0 -0
  181. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/faster-whisper/native/install.sh +0 -0
  182. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/fish-speech/native/install.sh +0 -0
  183. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/macos-stt/_bundle.sh +0 -0
  184. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/macos-stt/install.sh +0 -0
  185. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/macos-stt/macos_stt.swift +0 -0
  186. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/macos-stt/request_auth.swift +0 -0
  187. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/sherpa-onnx/native/install.sh +0 -0
  188. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/sherpa-onnx/native/run_streaming_server.py +0 -0
  189. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/engines/whisper/native/install.sh +0 -0
  190. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/gen_mms_languages.py +0 -0
  191. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/preload_stt_model.py +0 -0
  192. {openspeechapi-0.4.1 → openspeechapi-0.5.0}/scripts/release.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openspeechapi
3
- Version: 0.4.1
3
+ Version: 0.5.0
4
4
  Summary: Unified speech interface for STT/TTS providers
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: httpx>=0.27
@@ -35,6 +35,9 @@ Provides-Extra: baidu
35
35
  Provides-Extra: baidu-stt
36
36
  Provides-Extra: baidu-tts
37
37
  Provides-Extra: canary-qwen-stt
38
+ Provides-Extra: chatterbox-tts
39
+ Requires-Dist: chatterbox-tts; extra == 'chatterbox-tts'
40
+ Requires-Dist: soundfile; extra == 'chatterbox-tts'
38
41
  Provides-Extra: cloud
39
42
  Requires-Dist: websockets; extra == 'cloud'
40
43
  Provides-Extra: coqui-tts
@@ -76,6 +79,7 @@ Requires-Dist: torch; extra == 'funasr-stt'
76
79
  Requires-Dist: torchaudio; extra == 'funasr-stt'
77
80
  Provides-Extra: gemma4-stt
78
81
  Requires-Dist: accelerate; (sys_platform != 'darwin') and extra == 'gemma4-stt'
82
+ Requires-Dist: fastapi; extra == 'gemma4-stt'
79
83
  Requires-Dist: librosa; (sys_platform != 'darwin') and extra == 'gemma4-stt'
80
84
  Requires-Dist: mlx-vlm<0.6.2,>=0.6.1; (sys_platform == 'darwin') and extra == 'gemma4-stt'
81
85
  Requires-Dist: pillow; (sys_platform != 'darwin') and extra == 'gemma4-stt'
@@ -83,6 +87,7 @@ Requires-Dist: torch; (sys_platform != 'darwin') and extra == 'gemma4-stt'
83
87
  Requires-Dist: torchvision; (sys_platform != 'darwin') and extra == 'gemma4-stt'
84
88
  Requires-Dist: transformers; (sys_platform != 'darwin') and extra == 'gemma4-stt'
85
89
  Requires-Dist: transformers<5.13,>=5.5; (sys_platform == 'darwin') and extra == 'gemma4-stt'
90
+ Requires-Dist: uvicorn; extra == 'gemma4-stt'
86
91
  Provides-Extra: google
87
92
  Provides-Extra: google-stt
88
93
  Provides-Extra: google-tts
@@ -208,6 +208,24 @@ class SpeechProvider(ABC):
208
208
  model = (model or "").strip()
209
209
  return model if "/" in model else None
210
210
 
211
+ def _config_model_path_for(self, requested_model: str, model_field: str = "model") -> str:
212
+ """The static ``settings.model_path`` belongs to the CONFIGURED model ONLY. For a per-request
213
+ model override (a different variant), passing it downstream silently loads the config model —
214
+ ``aim_local_path_or`` / ``resolve_hub_model`` short-circuit on any present path (the C1 bug:
215
+ 切变体静默加载配置模型). Return ``model_path`` ONLY when the requested model IS the config
216
+ model; else ``""`` so the loader resolves the REQUESTED model's own aim-store path / repo id
217
+ (``resolve_hub_model`` / ``_resolve_model`` then look the requested model up in the aim store;
218
+ a direct ``aim_local_path_or`` caller falls back to the repo id, which aim relinks into the HF
219
+ cache). This is the LOAD-side mirror of the gate-side guard
220
+ ``dispatcher._config_model_path_present`` (rule 11).
221
+
222
+ ``model_field``: the settings attr holding the variant selector — usually ``model``, but a
223
+ few engines use a bespoke name (faster_whisper's ``model_size``; see H6)."""
224
+ from openspeechapi.core.model_profile import sget
225
+ config_model = (sget(self.settings, model_field) or "").strip()
226
+ mp = getattr(self.settings, "model_path", "") or ""
227
+ return mp if (requested_model or "").strip() == config_model else ""
228
+
211
229
  def _resolve_model(
212
230
  self, repo: str, *, hub: str = "", model_path: str = "",
213
231
  ms_repo_map: "dict[str, str] | None" = None, custom_url: str = "",
@@ -891,6 +891,16 @@ class SubprocessExecutor(Executor):
891
891
  f"OSA_WORKER_INVOKE_TIMEOUT_S. Recent worker output:\n"
892
892
  f"{self._recent_stderr()}"
893
893
  ) from None
894
+ except asyncio.CancelledError:
895
+ # H1: a cancelled invoke leaves the worker still computing — it writes a STALE
896
+ # response into the socket that the NEXT invoke would read (IPC desync → silent
897
+ # data corruption: the wrong request's result). The sequential protocol has no
898
+ # request-id to correlate responses, so the only safe recovery is to reset the
899
+ # worker (clears the channel), then propagate the cancellation. (fanout.py cancels
900
+ # losing providers on FirstCompleted, and a disconnected client cancels its handler
901
+ # — both routinely hit this path.)
902
+ await self._abort_for_restart()
903
+ raise
894
904
  if not resp.get("ok"):
895
905
  raise RuntimeError(resp.get("error", "Unknown error"))
896
906
  return _deserialize_arg(resp.get("result"))
@@ -951,6 +961,13 @@ class SubprocessExecutor(Executor):
951
961
  count += 1
952
962
  yield _deserialize_arg(resp["chunk"])
953
963
  t.add(items=count)
964
+ except asyncio.CancelledError:
965
+ # H1 (stream variant): a cancelled stream leaves the worker producing frames into
966
+ # the socket → the next invoke would read them (desync). Reset the worker to clear
967
+ # the channel, then propagate. (Cancel hits at `await _read_resp` or at the `yield`
968
+ # when the consumer stops early / the client disconnects.)
969
+ await self._abort_for_restart()
970
+ raise
954
971
  finally:
955
972
  if pump is not None:
956
973
  pump.cancel()
@@ -6,6 +6,9 @@ Only "installed" engines appear in providers.yaml and are visible on Dashboard/C
6
6
  from __future__ import annotations
7
7
 
8
8
  import dataclasses
9
+ import functools
10
+ import shutil
11
+ import subprocess
9
12
  import sys
10
13
  from dataclasses import dataclass, field
11
14
  from pathlib import Path
@@ -14,6 +17,25 @@ from typing import Any
14
17
  import yaml
15
18
 
16
19
 
20
+ @functools.lru_cache(maxsize=1)
21
+ def _gpu_compute_cap() -> str:
22
+ """Current NVIDIA GPU compute capability per nvidia-smi (e.g. ``"12.1"`` on GB10/Blackwell), or
23
+ ``""`` when there's no NVIDIA GPU (macOS, CPU-only). Cached — nvidia-smi is shelled out at most
24
+ once per process. Gates ``CatalogEntry.gpu_compute_deny`` (GPU-arch-specific incompatibilities)."""
25
+ smi = shutil.which("nvidia-smi")
26
+ if not smi:
27
+ return ""
28
+ try:
29
+ r = subprocess.run([smi, "--query-gpu=compute_cap", "--format=csv,noheader,nounits"],
30
+ capture_output=True, text=True, timeout=5)
31
+ except Exception: # noqa: BLE001 — nvidia-smi absent/hung → treat as no-GPU (don't gate)
32
+ return ""
33
+ if r.returncode != 0:
34
+ return ""
35
+ out = (r.stdout or "").strip().splitlines()
36
+ return out[0].strip() if out else ""
37
+
38
+
17
39
  @dataclass
18
40
  class CatalogEntry:
19
41
  """A single engine entry in the catalog."""
@@ -33,24 +55,45 @@ class CatalogEntry:
33
55
  # a published PyPI extra — PyPI rejects direct refs — so they're declared here in the
34
56
  # shipped registry and pip-installed directly by the Install flow, e.g. kimi-audio/wenet/canary)
35
57
  field_options: dict[str, list] = field(default_factory=dict)
36
- platforms: list[str] = field(default_factory=list) # empty = all platforms
58
+ platforms: list[str] = field(default_factory=list) # empty = all platforms (OS: darwin/linux/win32)
59
+ arch: list[str] = field(default_factory=list) # empty = all archs; else platform.machine() must be in it (e.g. [x86_64, AMD64] for flash-attn engines with no aarch64/Blackwell wheel)
60
+ gpu_compute_deny: list[str] = field(default_factory=list) # empty = all GPUs; else NVIDIA compute-cap PREFIXES to mark incompatible (e.g. ["12."] = Blackwell sm_12x/GB10). FINER than `arch` (machine-level): an engine may install+load on this machine yet crash at RUNTIME only on a specific GPU arch (CosyVoice3 hifigan f0_predictor on Blackwell+cu130 torch). No NVIDIA GPU (macOS) → not gated. See incompat_reason.
37
61
  install_script: str = "" # native: compile fallback script (repo-relative)
38
62
  prebuilt: dict = field(default_factory=dict) # native: {repo, tag, asset, app_relpath, binary_relpath}
39
63
  incompat_reason: str = "" # why incompatible (shown in UI when compatible is False)
40
64
  isolated_venv: bool = False # run this engine's worker from a dedicated per-engine venv
41
65
  pip_constraints: list[str] = field(default_factory=list) # version pins applied when building the isolated venv
42
66
  vllm_venv: bool = False # build a clean vLLM-Omni serving venv (no openspeechapi) for a service-client engine
67
+ companion_venvs: list[dict] = field(default_factory=list) # 额外的 vLLM venv(与主 venv 并存),如 qwen3-omni 的 fp4(vllm-omni 0.24);每项 {suffix, pip_extras} → venv "<provider>-<suffix>"
43
68
  fish_venv: bool = False # build a fish-speech serving venv + git src checkout (service-client engine)
44
69
  cosyvoice_venv: bool = False # dedicated git-clone SDK installer (CosyVoice SDK isn't on PyPI): Install builds ~/AI/venvs/cosyvoice via create_cosyvoice_venv (git clone --recursive + uv venv + wetext, no pynini) + worker runs from it (also set isolated_venv)
45
70
  indextts_venv: bool = False # dedicated git-clone SDK installer for IndexTTS2 (uv project): Install builds ~/AI/venvs/indextts via create_indextts_venv (git clone + uv sync + editable openspeechapi + .pth fallback) + worker runs from it (also set isolated_venv)
46
71
  spark_venv: bool = False # dedicated git-clone SDK installer for Spark-TTS (no PyPI/pyproject): Install builds ~/AI/venvs/spark-tts via create_spark_venv (git clone + uv venv + editable openspeechapi + requirements[no gradio] + .pth → clone root) + worker runs from it (also set isolated_venv)
47
72
  cuda_torch: bool = False # isolated_venv: on a CUDA host, pre-install torch+torchaudio from the CUDA wheel index (default PyPI ships CPU torch on aarch64)
73
+ cuda_torch_version: str = "" # per-engine 钉 torch/torchaudio 版本(如 chatterbox "2.11.0":死钉 torch==2.6 + GB10 sm_121);空=latest(不回归 spark/coqui/fish/indextts)。全局 env OSA_TORCH_CUDA_VERSION 亦可覆盖
74
+ cosyvoice_git_ref: str = "" # cosyvoice_venv only:per-engine CosyVoice SDK git ref(cosyvoice3→含 CosyVoice3 class+AutoModel 的 v3 ref);空=安装器的 v2.0 默认(cosyvoice)。使 cosyvoice/cosyvoice3 从同仓 clone 不同 ref 到各自 ~/AI/services/<provider>
48
75
  spacy_models: list[str] = field(default_factory=list) # isolated_venv: best-effort-install these spaCy models (name==ver) from the (OSA_GITHUB_PROXY-mirrored) GitHub release AFTER extras — their only wheel is a GitHub asset, can't be a pip extra; e.g. kokoro's en_core_web_sm for misaki English G2P
49
76
 
50
77
  @property
51
78
  def compatible(self) -> bool:
52
- """Whether this engine is compatible with the current platform."""
53
- return not self.platforms or sys.platform in self.platforms
79
+ """Whether this engine is compatible with the current platform (OS) AND architecture.
80
+
81
+ ``platforms`` gates the OS (darwin/linux/win32); ``arch`` gates the machine architecture
82
+ (``platform.machine()`` — x86_64 / aarch64 / arm64 / AMD64). An engine whose prebuilt
83
+ deps exist only for x86_64 (e.g. kimi-audio's flash-attn — no aarch64/Blackwell wheel)
84
+ sets ``arch: [x86_64, AMD64]`` so a GB10 (aarch64 Linux) host correctly shows it as
85
+ not-installable up front, instead of failing mid pip-build with exit 1."""
86
+ import platform as _platform
87
+ os_ok = not self.platforms or sys.platform in self.platforms
88
+ arch_ok = not self.arch or _platform.machine() in self.arch
89
+ # GPU-arch gate (finer than machine `arch`): an engine may install + load on this machine
90
+ # yet crash at runtime only on a specific GPU arch (e.g. CosyVoice3's hifigan f0_predictor on
91
+ # Blackwell sm_12x + cu130 torch). ``gpu_compute_deny`` holds compute-cap PREFIXES; a match
92
+ # against the current GPU → incompatible. No NVIDIA GPU (cap == "") → not gated.
93
+ cap = _gpu_compute_cap()
94
+ gpu_ok = not self.gpu_compute_deny or not (
95
+ cap and any(cap.startswith(p) for p in self.gpu_compute_deny))
96
+ return os_ok and arch_ok and gpu_ok
54
97
 
55
98
 
56
99
  # ---------------------------------------------------------------------------
@@ -73,6 +116,15 @@ def derive_category(provider_name: str, exec_mode: Any) -> str:
73
116
  - remote (cloud API) -> "cloud"
74
117
  - subprocess / local / in_process -> "local"
75
118
 
119
+ ⚠️ M18 limitation: a cloud engine declared IN_PROCESS (deepgram / openai / … — a pure HTTP
120
+ client that runs in-process) is indistinguishable here from a genuinely-local in_process
121
+ engine (piper); both arrive as ``(name, in_process)`` and derive to "local". Such cloud
122
+ engines therefore MUST carry ``category: cloud`` in engine_registry.yaml (2nd precedence
123
+ level, which wins before this derivation). ``test_all_vendor_engines_are_cloud`` conformance
124
+ guards that they do. Making the derivation itself cloud-aware would need a per-provider cloud
125
+ marker + a signature change across both call sites — not worth it for a case the registry
126
+ already covers.
127
+
76
128
  Precedence at call sites should be:
77
129
  explicit class ``category`` attr > catalog entry > this derivation.
78
130
  """
@@ -198,17 +250,22 @@ def build_catalog(registry_path: Path | None = None) -> list[CatalogEntry]:
198
250
  pip_extras=raw.get("pip_extras", []),
199
251
  pip_git=list(raw.get("pip_git", []) or []),
200
252
  platforms=raw.get("platforms", []),
253
+ arch=raw.get("arch", []),
254
+ gpu_compute_deny=list(raw.get("gpu_compute_deny", []) or []),
201
255
  install_script=raw.get("install_script", ""),
202
256
  prebuilt=raw.get("prebuilt", {}) or {},
203
257
  incompat_reason=raw.get("incompat_reason", ""),
204
258
  isolated_venv=bool(raw.get("isolated_venv", False)),
205
259
  pip_constraints=list(raw.get("pip_constraints", []) or []),
206
260
  vllm_venv=bool(raw.get("vllm_venv", False)),
261
+ companion_venvs=list(raw.get("companion_venvs", []) or []),
207
262
  fish_venv=bool(raw.get("fish_venv", False)),
208
263
  cosyvoice_venv=bool(raw.get("cosyvoice_venv", False)),
209
264
  indextts_venv=bool(raw.get("indextts_venv", False)),
210
265
  spark_venv=bool(raw.get("spark_venv", False)),
211
266
  cuda_torch=bool(raw.get("cuda_torch", False)),
267
+ cuda_torch_version=str(raw.get("cuda_torch_version", "") or ""),
268
+ cosyvoice_git_ref=str(raw.get("cosyvoice_git_ref", "") or ""),
212
269
  spacy_models=list(raw.get("spacy_models", []) or []),
213
270
  )
214
271
  # Try to enrich with provider code metadata
@@ -278,10 +278,10 @@ engines:
278
278
  provider: gemma4
279
279
  type: stt
280
280
  category: local
281
- display_name: "Gemma 4 STT"
282
- description: "Google Gemma 4 — local multimodal ASR (MLX on Apple Silicon · CUDA/transformers on Linux/Windows)"
283
- default_alias: gemma4_stt
284
- default_exec_mode: subprocess
281
+ display_name: "Gemma 4 全模态"
282
+ description: "Google Gemma 4 — 本地多模态(图/音/视频/文)ASR + chat,MLX(mac)/transformers(CUDA);经 /v1/chat/completions 暴露"
283
+ default_alias: gemma4_omni
284
+ default_exec_mode: local
285
285
  pip_extras: [gemma4-stt]
286
286
  platforms: [darwin, linux, win32] # dual backend: MLX on Apple Silicon, CUDA/transformers elsewhere (validated on GB10)
287
287
 
@@ -403,6 +403,9 @@ engines:
403
403
  default_exec_mode: local # service client → OSA-managed vLLM-Omni OpenAI server (was in-process transformers, which OOMs the 30B on big unified-memory GPUs)
404
404
  vllm_venv: true # build a clean vLLM-Omni serving venv (no openspeechapi → no torch clash); see local_engines/vllm_venv.py
405
405
  pip_extras: [vllm==0.22.0, vllm-omni==0.22.0, ninja] # installed into the vLLM serving venv (vllm pulls flashinfer); NOT pyproject extras
406
+ companion_venvs: # fp4(NVFP4)变体用独立 0.24 venv(qwen3-omni-fp4);见 provider _FP4_VENV + memory fp4-qwen3-omni-vllm-omni-blocked
407
+ - suffix: fp4
408
+ pip_extras: [vllm==0.24.0, vllm-omni==0.24.0, ninja]
406
409
  platforms: [linux, win32] # vLLM-Omni serving is CUDA-only; the 30B MoE needs a large GPU.
407
410
  # Not runnable on Apple Silicon (no CUDA vLLM; the MLX build is text-only).
408
411
  incompat_reason: "qwen3-omni serving needs CUDA vLLM-Omni + a large GPU; not available on Apple Silicon"
@@ -439,9 +442,10 @@ engines:
439
442
  default_exec_mode: subprocess
440
443
  pip_extras: [kimi-audio-stt]
441
444
  pip_git: ["kimi-audio @ git+https://github.com/MoonshotAI/Kimi-Audio.git"]
442
- platforms: [linux, win32] # kimia-infer hard-depends on flash-attn (CUDA-only); pip
443
- # install fails on macOS with "CUDA_HOME not set"
444
- incompat_reason: "Requires flash-attn (CUDA-only); not installable on macOS — use a Linux+CUDA host"
445
+ platforms: [linux, win32] # kimia-infer hard-depends on flash-attn (CUDA-only)
446
+ arch: [x86_64, AMD64] # flash-attn has NO aarch64/Blackwell(sm_100) prebuilt wheel → pip
447
+ # source-builds it and fails (exit 1); installable only on x86_64+CUDA
448
+ incompat_reason: "Requires flash-attn (CUDA-only, x86_64-wheel-only); not installable on macOS or aarch64/Blackwell hosts (e.g. DGX Spark GB10) — needs an x86_64 + NVIDIA CUDA machine"
445
449
 
446
450
  - name: moonshine
447
451
  provider: moonshine
@@ -509,6 +513,22 @@ engines:
509
513
  cuda_torch: true # CUDA 主机(有 nvidia-smi)装 requirements 前先从 cu130 index 装 torch+torchaudio(requirements 钉的 torch==2.3.1 在 aarch64 默认是 CPU 版)
510
514
  pip_extras: []
511
515
 
516
+ - name: cosyvoice3
517
+ provider: cosyvoice3
518
+ type: tts
519
+ category: local
520
+ display_name: "CosyVoice3"
521
+ description: "CosyVoice3(FunAudioLLM/Fun-CosyVoice3-0.5B-2512)— CosyVoice 家族最新一代本地 TTS(零样本克隆 + 多语)。独立引擎(不碰 cosyvoice v1/v2):OSA 托管 git-clone venv,从 FunAudioLLM/CosyVoice 的 v3-capable ref(含 class CosyVoice3 + AutoModel 工厂)clone --recursive + Matcha-TTS 子模块 + uv venv(依赖同 v2:wetext,无 pynini)。macOS/CUDA 均可一键 Install。⚠️ 权重商用条款同 CosyVoice 系有争议(研究/内部使用 OK)"
522
+ default_alias: cosyvoice3_tts
523
+ default_exec_mode: subprocess
524
+ cosyvoice_venv: true # 复用 CosyVoice SDK 安装器(create_cosyvoice_venv);按 provider=cosyvoice3 建独立 venv(~/AI/venvs/cosyvoice3)+ 独立 v3 源码(~/AI/services/cosyvoice3),零影响现有 cosyvoice
525
+ cosyvoice_git_ref: "0e624898a192b465fa492dd7aad3fe1120909024" # v3-capable SDK ref(含 class CosyVoice3 + def AutoModel;区别于 cosyvoice 的 v2.0 release tag)
526
+ isolated_venv: true # worker 从 ~/AI/venvs/cosyvoice3 跑
527
+ cuda_torch: true # CUDA 主机装 requirements 前从 cu130 index 装 torch+torchaudio(latest,同 cosyvoice v2 成功路径)
528
+ gpu_compute_deny: ["12."] # Blackwell sm_12x(GB10/DGX Spark)灰显:v3 hifigan f0_predictor 的 CausalConv1d 在 sm_12x + cu130 torch 上崩(input size 恒 3 < kernel 4);cosyvoice v2 无 f0_predictor 故 GB10 OK。DGX 真机:install/下载/AutoModel 加载全成功,仅 vocoder 崩
529
+ incompat_reason: "CosyVoice3 的 hifigan vocoder(f0_predictor)在 Blackwell GPU(sm_12x,如 GB10/DGX Spark)+ cu130 torch 上不兼容(CausalConv1d 崩)。需标准 CUDA(sm_80/86)或等上游 SDK/torch 修复;cosyvoice(v2)不受影响。"
530
+ pip_extras: []
531
+
512
532
  - name: coqui
513
533
  provider: coqui
514
534
  type: tts
@@ -573,6 +593,19 @@ engines:
573
593
  cuda_torch: true # CUDA 主机装 requirements 前先从 cu13x index 装 torch+torchaudio(requirements 钉 torch==2.5.1 在 aarch64 默认是 CPU 版且与 cu130 冲突)
574
594
  pip_extras: [] # git-clone SDK 非 PyPI
575
595
 
596
+ - name: chatterbox
597
+ provider: chatterbox
598
+ type: tts
599
+ category: local
600
+ display_name: "Chatterbox"
601
+ description: "Chatterbox(Resemble AI)— MIT 开源 TTS,声音克隆 + 情感/节奏可控(exaggeration 表现力 / cfg_weight 节奏)。三变体(model 字段选):english / multilingual(23 语言含中文,generate 需 language_id)/ turbo(英文低延迟)。english/multilingual 用 HF 仓 ResembleAI/chatterbox(t3_model 区分),turbo 用 ResembleAI/chatterbox-turbo;三者均 from_local 从本地目录加载(resolve-only,不在 worker 现下)。标准 pip 包 chatterbox-tts,MIT 许可。⚠️ 所有输出含 Resemble Perth 不可听水印(AI 音频溯源,不可关)。⚠️ 死钉 transformers==5.2.0 + torch==2.6.0,故 isolated_venv 隔离(主 venv 5.12+ 冲突);GB10(sm_121 Blackwell)需 cuda_torch 覆盖 cu13 torch——但 chatterbox 死钉 torch==2.6.0 会与 cu13 冲突,GB10 部署待实机验证/处理。macOS CPU best-effort。"
602
+ default_alias: chatterbox_tts
603
+ default_exec_mode: subprocess
604
+ isolated_venv: true # worker 从 ~/AI/venvs/chatterbox 跑;隔离 transformers==5.2.0(主 venv 5.12+ 冲突)+ torch==2.6.0
605
+ cuda_torch: true # GB10(sm_121)需 cu13 torch。chatterbox 死钉 torch==2.6.0(不支持 sm_121)→ 装完 extras 后 post-override 覆盖成 cu13(isolated_venv.py 3.6);DGX 真机已验证 torch 2.11+cu130 + 三变体 import OK + cuda True
606
+ cuda_torch_version: "2.11.0" # per-engine 钉 torch/torchaudio 同版本 2.11.0(GB10 验证版);不全局钉,不回归其他 cuda_torch 引擎(spark/coqui/fish/indextts 保持 latest)
607
+ pip_extras: ["chatterbox-tts"]
608
+
576
609
  # ---- macOS Native ----
577
610
  - name: macos-stt
578
611
  provider: macos-stt
@@ -180,6 +180,11 @@ _PROVIDER_MAP: dict[str, tuple[str, str, str]] = {
180
180
  "CosyVoiceTTS",
181
181
  "CosyVoiceTTSSettings",
182
182
  ),
183
+ "cosyvoice3": (
184
+ "openspeechapi.providers.tts.cosyvoice3",
185
+ "CosyVoice3TTS",
186
+ "CosyVoice3TTSSettings",
187
+ ),
183
188
  "fish-speech": (
184
189
  "openspeechapi.providers.tts.fish_speech",
185
190
  "FishSpeechTTS",
@@ -195,6 +200,11 @@ _PROVIDER_MAP: dict[str, tuple[str, str, str]] = {
195
200
  "SparkTTSProvider",
196
201
  "SparkTTSSettings",
197
202
  ),
203
+ "chatterbox": (
204
+ "openspeechapi.providers.tts.chatterbox",
205
+ "ChatterboxTTSProvider",
206
+ "ChatterboxTTSSettings",
207
+ ),
198
208
  "minimax": (
199
209
  "openspeechapi.providers.tts.minimax",
200
210
  "MinimaxTTS",
@@ -40,14 +40,18 @@ from collections.abc import Callable
40
40
  from pathlib import Path
41
41
 
42
42
  from openspeechapi.local_engines.isolated_venv import venv_dir, venv_python
43
- from openspeechapi.local_engines.venv_common import VenvResult, run as _run
44
-
45
- # Defaults are China-fast; override per-machine with the OSA_* env vars (same knobs as fish_venv).
46
- _UV_PYTHON_MIRROR_DEFAULT = (
47
- "https://ghfast.top/https://github.com/astral-sh/"
48
- "python-build-standalone/releases/download"
43
+ from openspeechapi.local_engines.venv_common import (
44
+ VenvResult,
45
+ git_clone_pinned,
46
+ new_log_sink,
47
+ openspeechapi_install_target,
48
+ site_packages_dir,
49
+ uv_install_env,
49
50
  )
50
- _PIP_INDEX_DEFAULT = "https://pypi.tuna.tsinghua.edu.cn/simple"
51
+ from openspeechapi.local_engines.venv_common import run as _run
52
+
53
+ # Git source/ref defaults (China-fast uv-mirror/pip-index defaults live in venv_common). Override
54
+ # per-machine with the OSA_* env vars (same knobs as fish_venv).
51
55
  _GIT_REPO_DEFAULT = "https://github.com/FunAudioLLM/CosyVoice.git"
52
56
  # Pinned to the v2.0 release tag (SHA 8555549…). Verified: its requirements.txt uses `wetext`
53
57
  # (pure-python, NO pynini/conda/OpenFst) and cosyvoice/cli/cosyvoice.py exposes BOTH `class
@@ -95,26 +99,20 @@ _NO_ISOLATION_PACKAGES = ("openai-whisper", "wget")
95
99
  _POST_REQ_PINS = ("ruamel.yaml<0.18",)
96
100
 
97
101
 
98
- def cosyvoice_service_dir() -> Path:
99
- """Where OSA installs the CosyVoice source (env ``OSA_COSYVOICE_SERVICE_DIR``)."""
100
- raw = os.environ.get("OSA_COSYVOICE_SERVICE_DIR", "").strip()
101
- return Path(raw).expanduser() if raw else Path("~/AI/services/cosyvoice").expanduser()
102
+ def cosyvoice_service_dir(provider_key: str = "cosyvoice") -> Path:
103
+ """Where OSA installs the CosyVoice source, KEYED BY PROVIDER so cosyvoice(v2) and cosyvoice3
104
+ (different pinned SDK refs — v2.0 tag vs. a v3-capable ref) get SEPARATE checkouts
105
+ (``~/AI/services/<provider_key>``) instead of clobbering one another. Per-engine env override:
106
+ ``OSA_<PROVIDER_KEY>_SERVICE_DIR`` (e.g. ``OSA_COSYVOICE_SERVICE_DIR`` for cosyvoice —
107
+ backward-compatible — and ``OSA_COSYVOICE3_SERVICE_DIR`` for cosyvoice3)."""
108
+ env_key = f"OSA_{provider_key.upper()}_SERVICE_DIR"
109
+ raw = os.environ.get(env_key, "").strip()
110
+ return Path(raw).expanduser() if raw else Path(f"~/AI/services/{provider_key}").expanduser()
102
111
 
103
112
 
104
113
  CosyVoiceVenvResult = VenvResult # 兼容旧名(共享 venv_common.VenvResult)
105
114
 
106
115
 
107
- def _site_packages_dir(vpy: Path, timeout: int = 60) -> Path | None:
108
- """venv 自己的 python 解析 site-packages(留在本模块:调 per-module 的 _run,便于测试 mock)。"""
109
- r = _run([str(vpy), "-c", "import sysconfig; print(sysconfig.get_path('purelib'))"], timeout=timeout)
110
- if r.returncode != 0:
111
- return None
112
- out = (r.stdout or "").strip().splitlines()
113
- if not out or not out[-1].strip():
114
- return None
115
- return Path(out[-1].strip())
116
-
117
-
118
116
  def create_cosyvoice_venv(
119
117
  repo_root: Path | str, entry, *, timeout: int = 3600,
120
118
  progress: Callable[[str], None] | None = None,
@@ -124,21 +122,14 @@ def create_cosyvoice_venv(
124
122
  → ``.pth`` for cosyvoice + matcha. ``entry`` is a CatalogEntry (needs ``provider`` /
125
123
  ``cuda_torch``). Idempotent: the clone is skipped when the source markers already exist, and the
126
124
  venv/pip steps re-run cheaply (uv no-ops satisfied deps)."""
127
- logs: list[str] = []
128
-
129
- def emit(line: str) -> None:
130
- line = (line or "").rstrip()
131
- if not line:
132
- return
133
- logs.append(line)
134
- if progress:
135
- progress(line)
125
+ emit, logs = new_log_sink(progress)
136
126
 
137
- base = cosyvoice_service_dir()
138
- src = base / "src"
139
- # Key the venv by the PROVIDER KEY so resolve_worker_python(provider) finds it (same scheme as
140
- # isolated_venv) — the executor spawns the worker from this venv's python.
127
+ # Key the venv AND the source checkout by the PROVIDER KEY: resolve_worker_python(provider) finds
128
+ # the venv (same scheme as isolated_venv), and cosyvoice/cosyvoice3 get SEPARATE v2/v3 source
129
+ # trees (their pinned SDK refs differ) — the executor spawns the worker from this venv's python.
141
130
  provider_key = getattr(entry, "provider", "cosyvoice") or "cosyvoice"
131
+ base = cosyvoice_service_dir(provider_key)
132
+ src = base / "src"
142
133
  vdir = venv_dir(provider_key)
143
134
  vpy = venv_python(provider_key)
144
135
 
@@ -149,44 +140,25 @@ def create_cosyvoice_venv(
149
140
  if not git:
150
141
  return CosyVoiceVenvResult(ok=False, log="git not found — install git to clone CosyVoice.")
151
142
 
152
- env = dict(os.environ)
153
- env.setdefault(
154
- "UV_PYTHON_INSTALL_MIRROR",
155
- os.environ.get("OSA_UV_PYTHON_MIRROR", _UV_PYTHON_MIRROR_DEFAULT),
156
- )
157
- pip_index = os.environ.get("OSA_PIP_INDEX_URL", _PIP_INDEX_DEFAULT)
143
+ env, pip_index = uv_install_env()
158
144
  git_repo = os.environ.get("OSA_COSYVOICE_GIT_REPO", _GIT_REPO_DEFAULT)
159
- git_ref = os.environ.get("OSA_COSYVOICE_GIT_REF", _GIT_REF_DEFAULT)
145
+ # Per-engine SDK ref: the registry's ``cosyvoice_git_ref`` (e.g. cosyvoice3 → a v3-capable ref)
146
+ # WINS over the global env / v2.0 default, so cosyvoice(v2) and cosyvoice3 pin DIFFERENT refs
147
+ # from the SAME repo. cosyvoice leaves it unset → the global env or the v2.0 default (unchanged).
148
+ git_ref = ((getattr(entry, "cosyvoice_git_ref", "") or "").strip()
149
+ or os.environ.get("OSA_COSYVOICE_GIT_REF", "").strip() or _GIT_REF_DEFAULT)
160
150
 
161
151
  # 1. Clone the CosyVoice source (pinned ref) + the Matcha-TTS submodule → base/src. Idempotent:
162
152
  # skip entirely when BOTH the cosyvoice loader and the matcha submodule are already present.
153
+ # --recursive clone + submodule update materialise Matcha-TTS; verify_after checks matcha_marker.
163
154
  cosyvoice_marker = src / "cosyvoice" / "cli" / "cosyvoice.py"
164
155
  matcha_marker = src / "third_party" / "Matcha-TTS" / "matcha"
165
- if not (cosyvoice_marker.exists() and matcha_marker.exists()):
166
- base.mkdir(parents=True, exist_ok=True)
167
- if not (src / ".git").exists():
168
- emit(f"git clone --recursive {git_repo} → {src} …")
169
- r = _run([git, "clone", "--recursive", git_repo, str(src)], timeout=timeout)
170
- emit((r.stdout or "") + (r.stderr or ""))
171
- if r.returncode != 0:
172
- return CosyVoiceVenvResult(ok=False, method="git", log="\n".join(logs)[-4000:])
173
- emit(f"git checkout {git_ref} …")
174
- r = _run([git, "-C", str(src), "checkout", git_ref], timeout=timeout)
175
- if r.returncode != 0: # ref may need fetching first (shallow clone / new ref)
176
- _run([git, "-C", str(src), "fetch", "origin", git_ref], timeout=timeout)
177
- r = _run([git, "-C", str(src), "checkout", git_ref], timeout=timeout)
178
- emit((r.stdout or "") + (r.stderr or ""))
179
- if r.returncode != 0:
180
- return CosyVoiceVenvResult(ok=False, method="git", log="\n".join(logs)[-4000:])
181
- # Materialise / update submodules (Matcha-TTS) for the checked-out ref.
182
- emit("git submodule update --init --recursive …")
183
- r = _run([git, "-C", str(src), "submodule", "update", "--init", "--recursive"],
184
- timeout=timeout)
185
- emit((r.stdout or "") + (r.stderr or ""))
186
- if r.returncode != 0 or not matcha_marker.exists():
187
- return CosyVoiceVenvResult(ok=False, method="git", log="\n".join(logs)[-4000:])
188
- else:
189
- emit(f"CosyVoice source present (clone skipped): {src}")
156
+ if not git_clone_pinned(
157
+ run=_run, emit=emit, git=git, repo=git_repo, ref=git_ref, src=src,
158
+ markers=[cosyvoice_marker, matcha_marker], recursive=True, submodules=True, verify_after=True,
159
+ present_msg=f"CosyVoice source present (clone skipped): {src}", timeout=timeout,
160
+ ):
161
+ return CosyVoiceVenvResult(ok=False, method="git", log="\n".join(logs)[-4000:])
190
162
 
191
163
  # 2. Create the venv with the SAME python as the main interpreter (pickle/ABI safe — same as
192
164
  # create_isolated_venv). Skip if its python already exists.
@@ -208,15 +180,7 @@ def create_cosyvoice_venv(
208
180
  if argv is None:
209
181
  return CosyVoiceVenvResult(ok=False, method="uv",
210
182
  log="no pip/uv available to install into the venv")
211
- if (Path(repo_root) / "pyproject.toml").exists():
212
- osa_target = ["-e", str(repo_root)]
213
- else:
214
- from importlib.metadata import PackageNotFoundError
215
- from importlib.metadata import version as _pkg_version
216
- try:
217
- osa_target = [f"openspeechapi=={_pkg_version('openspeechapi')}"]
218
- except PackageNotFoundError: # pragma: no cover - openspeechapi is always importable at runtime
219
- osa_target = ["openspeechapi"]
183
+ osa_target = openspeechapi_install_target(repo_root)
220
184
  emit(f"install openspeechapi into venv: {' '.join(osa_target)} …")
221
185
  r = _run(argv + osa_target, env=env, timeout=timeout)
222
186
  emit((r.stdout or "") + (r.stderr or ""))
@@ -363,7 +327,7 @@ def create_cosyvoice_venv(
363
327
  # the worker. A `.pth` is processed at interpreter start (before any user code), so it's
364
328
  # robust to the pickled-provider worker (which only runs _worker_main and never imports this
365
329
  # module). Two absolute paths: the repo root (cosyvoice package) + the Matcha-TTS submodule.
366
- site = _site_packages_dir(vpy)
330
+ site = site_packages_dir(_run, vpy)
367
331
  if site is None:
368
332
  return CosyVoiceVenvResult(ok=False, method="uv",
369
333
  log="\n".join(logs + ["could not resolve venv site-packages"])[-4000:])
@@ -388,7 +352,7 @@ def remove_cosyvoice_venv(provider_key: str = "cosyvoice") -> bool:
388
352
  if vdir.exists():
389
353
  shutil.rmtree(vdir, ignore_errors=True)
390
354
  removed = True
391
- src = cosyvoice_service_dir() / "src"
355
+ src = cosyvoice_service_dir(provider_key) / "src"
392
356
  if src.exists():
393
357
  shutil.rmtree(src, ignore_errors=True)
394
358
  removed = True
@@ -0,0 +1,76 @@
1
+ """WhisperLiveKit local STT engine spec."""
2
+ from __future__ import annotations
3
+
4
+ from openspeechapi.local_engines.models import EngineSpec
5
+
6
+ # openai large-v3-turbo PyTorch decoder .pt(与 providers/stt/whisper.py 的 _MODELS 同源)。
7
+ _TURBO_PT_URL = (
8
+ "https://openaipublic.azureedge.net/main/whisper/models/"
9
+ "aff26ae408abcba5fbf8813c21e62b0941638c5f6eebfb145be0c9839262a19a/large-v3-turbo.pt"
10
+ )
11
+
12
+ WHISPERLIVEKIT_SPEC = EngineSpec(
13
+ name="whisperlivekit",
14
+ default_runtime="native",
15
+ description="WhisperLiveKit local streaming STT engine (mlx-whisper backend)",
16
+ options={
17
+ "native_install_script": "scripts/engines/whisperlivekit/native/install.sh",
18
+ "native_repo_url": "https://github.com/QuentinFuxa/WhisperLiveKit.git",
19
+ "native_repo_ref": "main",
20
+ "native_model_dir": "models/whisperlivekit",
21
+ # `wlk serve --backend mlx-whisper` 的 SimulStreaming hybrid 模式加载两个产物:
22
+ # - MLX encoder(mlx-community/whisper-large-v3-turbo)—— 经 load_mlx_encoder,给本地
23
+ # 目录则零 snapshot_download;
24
+ # - PyTorch decoder(openai large-v3-turbo.pt)—— 经 whisper.load_model,给本地 .pt 则
25
+ # 零 openai CDN 下载。
26
+ # 二者都经 aim 纳管(见 native_aim_downloads)、install.sh 软链到 {model_dir}/encoder|decoder.pt,
27
+ # start_cmd 用 --encoder-model-path/--decoder-model-path 显式喂 → 运行时零下载、上 Dashboard。
28
+ # 详见 docs/superpowers/specs/2026-07-07-whisperlivekit-aim-mlx-design.md。
29
+ "native_use_aim": True,
30
+ "native_aim_model_ids": [
31
+ "hf-mlx-community-whisper-large-v3-turbo",
32
+ "whisper-large-v3-turbo-pt",
33
+ ],
34
+ "native_aim_downloads": [
35
+ {
36
+ "model_id": "hf-mlx-community-whisper-large-v3-turbo",
37
+ "source": "hf:mlx-community/whisper-large-v3-turbo",
38
+ "category": "asr/model",
39
+ },
40
+ {
41
+ "model_id": "whisper-large-v3-turbo-pt",
42
+ "source": f"url:{_TURBO_PT_URL}",
43
+ "category": "asr/model",
44
+ },
45
+ ],
46
+ "native_aim_provision_engine": "whisper",
47
+ # encoder 是 native-CAS 目录、decoder 是 .pt 文件,两类都要 → any。
48
+ "native_aim_model_kind": "any",
49
+ # 配置态 fallback:即便 resolve_aim_model_paths 的 --engine 过滤漏掉某模型,
50
+ # install.sh 仍能从这里拿到两条路径(路径可预测:encoder=native-CAS 根、
51
+ # decoder=aim url: store 落点 ~/AI/store/asr/model/<name>/<url basename>)。
52
+ "native_existing_model_paths": [
53
+ "~/AI/huggingface/hub/models--mlx-community--whisper-large-v3-turbo", # encoder 根(install.sh 取 snapshots/<hash>/)
54
+ "~/AI/store/asr/model/whisper-large-v3-turbo-pt/large-v3-turbo.pt", # decoder .pt
55
+ ],
56
+ # 缺模型硬失败,不静默占位(与 sherpa 一致)。
57
+ "native_simulate_download": False,
58
+ "native_start_cmd": [
59
+ "{service_dir}/.venv/bin/wlk",
60
+ "serve",
61
+ "--host", "{api_host}",
62
+ "--port", "{api_port}",
63
+ "--backend", "mlx-whisper",
64
+ "--model", "large-v3-turbo",
65
+ "--encoder-model-path", "{model_dir}/encoder",
66
+ "--decoder-model-path", "{model_dir}/decoder.pt",
67
+ "--pcm-input",
68
+ "--no-vac",
69
+ "--no-vad",
70
+ "--min-chunk-size", "0.2",
71
+ "--never-fire",
72
+ "--protocol-log",
73
+ "--protocol-log-max-chars", "300",
74
+ ],
75
+ },
76
+ )