openspeechapi 0.3.0__tar.gz → 0.4.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 (174) hide show
  1. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/PKG-INFO +9 -1
  2. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/core/base.py +79 -0
  3. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/core/enums.py +3 -0
  4. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/core/models.py +5 -0
  5. openspeechapi-0.4.0/openspeechapi/core/voice_presets.py +91 -0
  6. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/dispatcher.py +40 -8
  7. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/executors/subprocess_exec.py +65 -25
  8. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/engine_catalog.py +20 -0
  9. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/engine_registry.yaml +51 -0
  10. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/factory.py +20 -0
  11. openspeechapi-0.4.0/openspeechapi/local_engines/indextts_venv.py +271 -0
  12. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/isolated_venv.py +40 -0
  13. openspeechapi-0.4.0/openspeechapi/local_engines/spark_venv.py +276 -0
  14. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/qwen3_omni_stt.py +54 -3
  15. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/coqui.py +19 -33
  16. openspeechapi-0.4.0/openspeechapi/providers/tts/f5_tts.py +329 -0
  17. openspeechapi-0.4.0/openspeechapi/providers/tts/indextts.py +356 -0
  18. openspeechapi-0.4.0/openspeechapi/providers/tts/kokoro.py +294 -0
  19. openspeechapi-0.4.0/openspeechapi/providers/tts/spark.py +306 -0
  20. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/app.py +3 -1
  21. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/extras_installer.py +8 -0
  22. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/model_downloads.py +15 -3
  23. openspeechapi-0.4.0/openspeechapi/server/routes/chat.py +73 -0
  24. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/routes/management.py +80 -6
  25. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/routes/stt.py +20 -1
  26. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/routes/tts.py +125 -0
  27. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/webui/app.js +354 -4
  28. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/webui/index.html +23 -2
  29. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/webui/styles.css +20 -0
  30. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/ws/tts_stream.py +38 -0
  31. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/pyproject.toml +3 -1
  32. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/.gitignore +0 -0
  33. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/README.md +0 -0
  34. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/__init__.py +0 -0
  35. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/__main__.py +0 -0
  36. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/cli.py +0 -0
  37. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/client/__init__.py +0 -0
  38. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/client/client.py +0 -0
  39. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/config.py +0 -0
  40. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/core/__init__.py +0 -0
  41. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/core/model_hub.py +0 -0
  42. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/core/registry.py +0 -0
  43. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/core/settings.py +0 -0
  44. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/demo.py +0 -0
  45. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/__init__.py +0 -0
  46. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/aim_provision.py +0 -0
  47. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/context.py +0 -0
  48. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/executors/__init__.py +0 -0
  49. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/executors/base.py +0 -0
  50. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/executors/in_process.py +0 -0
  51. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/executors/remote.py +0 -0
  52. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/fanout.py +0 -0
  53. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/filters.py +0 -0
  54. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/lifecycle.py +0 -0
  55. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/dispatch/watcher.py +0 -0
  56. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/exceptions.py +0 -0
  57. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/__init__.py +0 -0
  58. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/aim_resolver.py +0 -0
  59. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/backends/__init__.py +0 -0
  60. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/backends/docker_backend.py +0 -0
  61. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/backends/native_backend.py +0 -0
  62. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/base.py +0 -0
  63. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/cosyvoice_venv.py +0 -0
  64. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/engines/__init__.py +0 -0
  65. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/engines/faster_whisper.py +0 -0
  66. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/engines/fish_speech.py +0 -0
  67. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/engines/sherpa_onnx.py +0 -0
  68. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/engines/whisper.py +0 -0
  69. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/engines/whisperlivekit.py +0 -0
  70. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/fish_venv.py +0 -0
  71. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/manager.py +0 -0
  72. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/models.py +0 -0
  73. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/progress.py +0 -0
  74. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/registry.py +0 -0
  75. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/task_store.py +0 -0
  76. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/tasks.py +0 -0
  77. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/vllm_gb10_patch.py +0 -0
  78. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/local_engines/vllm_venv.py +0 -0
  79. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/logging_config.py +0 -0
  80. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/observe/__init__.py +0 -0
  81. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/observe/base.py +0 -0
  82. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/observe/debug.py +0 -0
  83. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/observe/latency.py +0 -0
  84. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/observe/metrics.py +0 -0
  85. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/observe/tracing.py +0 -0
  86. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/observe/usage.py +0 -0
  87. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/__init__.py +0 -0
  88. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/_template.py +0 -0
  89. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/__init__.py +0 -0
  90. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/_local_audio.py +0 -0
  91. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/alibaba.py +0 -0
  92. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/assemblyai.py +0 -0
  93. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/azure_speech.py +0 -0
  94. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/baidu.py +0 -0
  95. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/canary_qwen_stt.py +0 -0
  96. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/deepgram.py +0 -0
  97. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/dolphin_stt.py +0 -0
  98. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/elevenlabs.py +0 -0
  99. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/faster_whisper.py +0 -0
  100. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/fireredasr_stt.py +0 -0
  101. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/funasr_stt.py +0 -0
  102. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/gemma4.py +0 -0
  103. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/google_cloud.py +0 -0
  104. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/iflytek.py +0 -0
  105. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/kimi_audio_stt.py +0 -0
  106. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/macos_speech.py +0 -0
  107. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/mlx_whisper_stt.py +0 -0
  108. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/mms_languages.json +0 -0
  109. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/mms_stt.py +0 -0
  110. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/moonshine_stt.py +0 -0
  111. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/openai.py +0 -0
  112. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/paraformer.py +0 -0
  113. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/parakeet_mlx_stt.py +0 -0
  114. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/phi4_multimodal_stt.py +0 -0
  115. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/qwen3_asr.py +0 -0
  116. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/sensevoice.py +0 -0
  117. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/sherpa_onnx.py +0 -0
  118. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/tencent.py +0 -0
  119. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/volcengine.py +0 -0
  120. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/vosk_stt.py +0 -0
  121. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/voxtral_stt.py +0 -0
  122. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/wenet_stt.py +0 -0
  123. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/whisper.py +0 -0
  124. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/whisperlivekit.py +0 -0
  125. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/stt/windows_speech.py +0 -0
  126. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/__init__.py +0 -0
  127. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/alibaba.py +0 -0
  128. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/azure_speech.py +0 -0
  129. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/baidu.py +0 -0
  130. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/cosyvoice.py +0 -0
  131. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/deepgram.py +0 -0
  132. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/elevenlabs.py +0 -0
  133. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/fish_speech.py +0 -0
  134. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/google_cloud.py +0 -0
  135. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/iflytek.py +0 -0
  136. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/macos_say.py +0 -0
  137. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/minimax.py +0 -0
  138. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/openai.py +0 -0
  139. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/piper.py +0 -0
  140. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/tencent.py +0 -0
  141. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/volcengine.py +0 -0
  142. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/providers/tts/windows_sapi.py +0 -0
  143. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/__init__.py +0 -0
  144. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/auth.py +0 -0
  145. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/middleware.py +0 -0
  146. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/native_installer.py +0 -0
  147. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/routes/__init__.py +0 -0
  148. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/routes/webui.py +0 -0
  149. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/system_metrics.py +0 -0
  150. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/ws/__init__.py +0 -0
  151. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/server/ws/stt_stream.py +0 -0
  152. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/telemetry/__init__.py +0 -0
  153. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/telemetry/perf.py +0 -0
  154. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/utils/__init__.py +0 -0
  155. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/utils/audio_converter.py +0 -0
  156. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/utils/audio_playback.py +0 -0
  157. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/openspeechapi/vendor_registry.yaml +0 -0
  158. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/providers.example.yaml +0 -0
  159. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/aim_adopt.py +0 -0
  160. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/aim_consumers.py +0 -0
  161. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/cloud/install.sh +0 -0
  162. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/faster-whisper/native/install.sh +0 -0
  163. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/fish-speech/native/install.sh +0 -0
  164. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/macos-stt/_bundle.sh +0 -0
  165. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/macos-stt/install.sh +0 -0
  166. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/macos-stt/macos_stt.swift +0 -0
  167. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/macos-stt/request_auth.swift +0 -0
  168. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/sherpa-onnx/native/install.sh +0 -0
  169. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/sherpa-onnx/native/run_streaming_server.py +0 -0
  170. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/whisper/native/install.sh +0 -0
  171. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/engines/whisperlivekit/native/install.sh +0 -0
  172. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/gen_mms_languages.py +0 -0
  173. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/preload_stt_model.py +0 -0
  174. {openspeechapi-0.3.0 → openspeechapi-0.4.0}/scripts/release.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openspeechapi
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Unified speech interface for STT/TTS providers
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: httpx>=0.27
@@ -58,6 +58,10 @@ Provides-Extra: elevenlabs-stt
58
58
  Requires-Dist: websockets; extra == 'elevenlabs-stt'
59
59
  Provides-Extra: elevenlabs-tts
60
60
  Requires-Dist: elevenlabs; extra == 'elevenlabs-tts'
61
+ Provides-Extra: f5-tts
62
+ Requires-Dist: f5-tts; extra == 'f5-tts'
63
+ Requires-Dist: mlx-whisper; (sys_platform == 'darwin') and extra == 'f5-tts'
64
+ Requires-Dist: soundfile; extra == 'f5-tts'
61
65
  Provides-Extra: faster-whisper-stt
62
66
  Requires-Dist: faster-whisper; extra == 'faster-whisper-stt'
63
67
  Provides-Extra: fireredasr-stt
@@ -86,6 +90,10 @@ Provides-Extra: iflytek-tts
86
90
  Requires-Dist: websockets; extra == 'iflytek-tts'
87
91
  Provides-Extra: kimi-audio-stt
88
92
  Requires-Dist: torch; extra == 'kimi-audio-stt'
93
+ Provides-Extra: kokoro
94
+ Requires-Dist: kokoro>=0.9.2; extra == 'kokoro'
95
+ Requires-Dist: misaki[zh]; extra == 'kokoro'
96
+ Requires-Dist: soundfile; extra == 'kokoro'
89
97
  Provides-Extra: macos-native
90
98
  Provides-Extra: minimax-tts
91
99
  Provides-Extra: mlx-whisper-stt
@@ -1,7 +1,10 @@
1
1
  """Provider abstract base classes."""
2
2
  from __future__ import annotations
3
3
 
4
+ import base64
5
+ import contextlib
4
6
  import os
7
+ import tempfile
5
8
  from abc import ABC, abstractmethod
6
9
  from collections.abc import AsyncIterator
7
10
  from dataclasses import dataclass
@@ -135,6 +138,33 @@ class SpeechProvider(ABC):
135
138
  ``settings`` 可能是 dataclass 实例或 dict。无可下载目标 → ``None``。"""
136
139
  return None
137
140
 
141
+ @staticmethod
142
+ def pending_reference_asr(settings, opts) -> dict | None: # noqa: ANN001
143
+ """该请求是否需要先**追踪下载**一个「二级」模型(参考音频转写用的 ASR),默认 ``None``。
144
+
145
+ 克隆类 TTS(如 F5-TTS)在 ``reference_text`` 为空时要转写参考音频取文本,依赖一个 ASR
146
+ 模型。该模型未缓存时,合成前置 gate 据本钩子返回的 ``{source, repo, label}`` 起追踪下载
147
+ (上 Dashboard 面板)+ 返回 409 ``model_downloading``,而非在 worker 里静默现下 / 直接
148
+ 报错。返回 ``None`` = 无需二级下载(已给 ref_text、无参考音、模型已缓存,或引擎不涉及)。
149
+
150
+ 同 ``download_spec`` 纪律:server 进程内调用,纯字符串/缓存存在性逻辑,绝不加载模型/下载。
151
+ ``settings`` 可能是 dataclass 或 dict;``opts`` 为本次请求的 ``TTSOptions``。"""
152
+ return None
153
+
154
+ @staticmethod
155
+ def pending_aux_models(settings, opts) -> "list[dict] | None": # noqa: ANN001
156
+ """该引擎首次加载时要下的**辅助模型**里,尚未缓存的那些(默认 ``None``)。
157
+
158
+ 某些 SDK(如 IndexTTS2)在加载主模型时,会在 worker 里静默现下若干 GB 的辅助模型
159
+ (w2v-bert / codec / vocoder 等)——违反「前后台状态同步」+「绝不 worker 静默现下」。
160
+ 引擎 override 本钩子返回**缺失** aux 的列表 ``[{repo, allow_patterns, label}, ...]``,合成
161
+ 前置 gate 据此起**追踪下载**(上 Dashboard 面板)+ 返回 409 ``model_downloading`` + 前端
162
+ 自动重试;待全部就绪后 provider 把它们显式喂给 SDK(绕开其静默下载)。返回 ``None`` = 无
163
+ 待下 aux(已全缓存,或引擎无此需求)。
164
+
165
+ 同 ``download_spec`` 纪律:server 进程内调用,纯字符串/缓存存在性逻辑,绝不加载模型/下载。"""
166
+ return None
167
+
138
168
  @classmethod
139
169
  def expected_local_repo(cls, settings) -> str | None: # noqa: ANN001
140
170
  """该引擎在本机会从本地缓存加载的 HF repo id(用于「是否已下载」预检)。
@@ -308,3 +338,52 @@ class TTSProvider(SpeechProvider):
308
338
  Override to return a list. Must stay import-light (no torch): it runs in the server process
309
339
  off ``provider_cls`` with no instance/model."""
310
340
  return None
341
+
342
+ # ── clone-reference temp-file handling (shared by spark / indextts / f5 / coqui) ──────────────
343
+ @staticmethod
344
+ def _reference_to_wav(value: Any) -> tuple[str | None, bool]:
345
+ """A clone-reference value → ``(local_wav_path, is_temp)``.
346
+
347
+ Accepts an existing file path, a base64 string, or raw ``bytes``. base64/bytes are decoded
348
+ and written to a NEW temp WAV, returned with ``is_temp=True`` (the caller must delete it —
349
+ use :meth:`_reference_wav`). A falsy value, an existing path, or a non-base64 string is
350
+ returned as-is with ``is_temp=False`` — it is the user's own file (or no file), so it must
351
+ NEVER be deleted.
352
+ """
353
+ if not value:
354
+ return None, False
355
+ if isinstance(value, str):
356
+ if os.path.exists(value):
357
+ return value, False
358
+ try:
359
+ raw = base64.b64decode(value, validate=True)
360
+ except Exception: # noqa: BLE001 - not base64 → treat as a path/URL string
361
+ return value, False
362
+ else:
363
+ raw = value
364
+ f = tempfile.NamedTemporaryFile(suffix=".wav", delete=False)
365
+ f.write(raw)
366
+ f.close()
367
+ return f.name, True
368
+
369
+ @contextlib.contextmanager
370
+ def _reference_wav(self, resolved: tuple[str | None, bool]):
371
+ """Context manager over a resolved reference ``(path, is_temp)`` — yields ``path`` and deletes
372
+ the temp file *we* created (``is_temp=True``) when the block exits, whether it completes or
373
+ raises. A user-supplied path (``is_temp=False``) or ``None`` is yielded untouched.
374
+
375
+ Wrap the ``_synth`` call in ``synthesize`` so a base64/bytes reference clip doesn't leak a
376
+ ``.wav`` in the temp dir on every clone request::
377
+
378
+ with self._reference_wav(self._resolve_reference(opts, s)) as ref:
379
+ wav_bytes, sr = await asyncio.to_thread(self._synth, text, ref, ...)
380
+ """
381
+ path, is_temp = resolved
382
+ try:
383
+ yield path
384
+ finally:
385
+ if is_temp and path:
386
+ try:
387
+ os.unlink(path)
388
+ except OSError:
389
+ pass
@@ -40,3 +40,6 @@ class Capability(str, Enum):
40
40
  WORD_TIMESTAMPS = "word_timestamps"
41
41
  # STT: detects audio emotion + acoustic events (e.g. SenseVoice rich tags).
42
42
  AUDIO_EVENTS = "audio_events"
43
+ # Omni-modal engines (e.g. qwen3-omni) that expose an OpenAI-compatible /v1/chat/completions
44
+ # backend for text/image/audio/video understanding. Gates the OSA chat-completions proxy route.
45
+ CHAT = "chat"
@@ -105,3 +105,8 @@ class TTSOptions:
105
105
  # transcript garbles the clone output (the cosyvoice '合成的语音不是输入的文本' bug).
106
106
  reference_text: str | None = None
107
107
  language: str | None = None # cloning engines need an explicit lang code (e.g. "zh", "en")
108
+ # Generic per-request setting overrides (JSON object) from the Lab Advanced Options panel. Keys
109
+ # matching the provider's settings dataclass fields are merged over the static config for THIS
110
+ # call only (via ``SpeechProvider._effective_settings``) — lets the panel expose any engine param
111
+ # (e.g. IndexTTS2 emotion) without per-field plumbing. Mirrors STTOptions.overrides.
112
+ overrides: dict | None = None
@@ -0,0 +1,91 @@
1
+ """Generic per-engine **custom voice presets** — a named bundle of per-request override params.
2
+
3
+ Any TTS engine that supports per-request overrides (the Lab "Advanced Options") can save the current
4
+ param combo (e.g. Spark-TTS ``gender``/``pitch``/``speed``/``seed``, IndexTTS2 emotion) under a name;
5
+ selecting that name later re-applies the saved overrides. The MECHANISM is engine-agnostic; each
6
+ preset's EFFECT is engine-specific (it just stores that engine's override dict).
7
+
8
+ Presets are namespaced by **provider name** (e.g. ``spark-tts``), not by config alias — so every alias
9
+ of the same engine shares them and different engines never collide. Persisted as JSON in the user
10
+ config dir (next to ``providers.yaml``) so they survive restarts AND source-tree redeploys.
11
+
12
+ Store shape::
13
+
14
+ { "<provider-name>": { "<voice-name>": { <override-field>: <value>, ... }, ... }, ... }
15
+ """
16
+ from __future__ import annotations
17
+
18
+ import json
19
+ import os
20
+ import threading
21
+ from pathlib import Path
22
+
23
+ from openspeechapi.config import default_config_dir
24
+
25
+ _LOCK = threading.Lock()
26
+
27
+
28
+ def _store_path() -> Path:
29
+ return default_config_dir() / "voice_presets.json"
30
+
31
+
32
+ def _load_all() -> dict[str, dict[str, dict]]:
33
+ p = _store_path()
34
+ if not p.exists():
35
+ return {}
36
+ try:
37
+ data = json.loads(p.read_text(encoding="utf-8"))
38
+ except Exception: # noqa: BLE001 - corrupt/unreadable JSON → behave as empty (never crash the UI)
39
+ return {}
40
+ return data if isinstance(data, dict) else {}
41
+
42
+
43
+ def _write_all(data: dict) -> None:
44
+ p = _store_path()
45
+ p.parent.mkdir(parents=True, exist_ok=True)
46
+ tmp = p.with_suffix(".json.tmp")
47
+ tmp.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
48
+ os.replace(tmp, p) # atomic swap → never leave a half-written store
49
+
50
+
51
+ def list_presets(provider: str) -> dict[str, dict]:
52
+ """All saved presets for *provider* → ``{name: overrides_dict}`` (a copy). Empty if none."""
53
+ with _LOCK:
54
+ return {k: dict(v) for k, v in (_load_all().get(provider, {}) or {}).items()}
55
+
56
+
57
+ def get_preset(provider: str, name: str) -> dict | None:
58
+ """The overrides dict saved under *name* for *provider*, or ``None`` if absent."""
59
+ with _LOCK:
60
+ v = _load_all().get(provider, {}).get(name)
61
+ return dict(v) if isinstance(v, dict) else None
62
+
63
+
64
+ def save_preset(provider: str, name: str, overrides: dict) -> None:
65
+ """Save (or replace) *name* for *provider* with *overrides* (a param dict)."""
66
+ provider = (provider or "").strip()
67
+ name = (name or "").strip()
68
+ if not provider:
69
+ raise ValueError("provider must not be empty")
70
+ if not name:
71
+ raise ValueError("voice name must not be empty")
72
+ if not isinstance(overrides, dict):
73
+ raise ValueError("overrides must be a dict")
74
+ with _LOCK:
75
+ data = _load_all()
76
+ data.setdefault(provider, {})[name] = dict(overrides)
77
+ _write_all(data)
78
+
79
+
80
+ def delete_preset(provider: str, name: str) -> bool:
81
+ """Remove *name* for *provider*. Returns True if it existed and was removed."""
82
+ with _LOCK:
83
+ data = _load_all()
84
+ bucket = data.get(provider, {})
85
+ if name not in bucket:
86
+ return False
87
+ del bucket[name]
88
+ if not bucket:
89
+ data.pop(provider, None) # drop empty provider buckets
90
+ _write_all(data)
91
+ return True
@@ -499,42 +499,74 @@ class ServiceDispatcher:
499
499
  except Exception: # noqa: BLE001 - 预检取 repo 失败 → 当作无法判断,放行
500
500
  return None
501
501
 
502
- def _settings_for(self, alias: str) -> dict | None:
502
+ def _settings_for(self, alias: str, model_override: str | None = None) -> dict | None:
503
503
  """The configured settings dict for *alias* (the dict the provider class's
504
504
  string-only hooks read), or None if the engine is unknown. Used by the
505
- ``local_model_present`` / ``download_spec`` delegators below."""
505
+ ``local_model_present`` / ``download_spec`` delegators below.
506
+
507
+ ``model_override`` 非空时(Lab 按请求 model 覆盖)叠加覆盖的 model,使这些钩子对照的是
508
+ 该请求**实际会加载**的模型,而非引擎静态配置(同 ``expected_repo_for``)。"""
506
509
  handle = self._handles.get(alias)
507
510
  if handle is None:
508
511
  return None
509
512
  settings = getattr(handle, "settings_dict", None)
510
513
  if settings is None:
511
514
  settings = getattr(handle, "settings", None) or {}
515
+ if model_override:
516
+ base = settings if isinstance(settings, dict) else (getattr(settings, "__dict__", {}) or {})
517
+ settings = {**base, "model": model_override}
512
518
  return settings
513
519
 
514
- def local_model_present(self, alias: str) -> bool | None:
520
+ def local_model_present(self, alias: str, model_override: str | None = None) -> bool | None:
515
521
  """委托给 provider 类的 ``local_model_present`` —— 仅当引擎走**非标准**部分下载
516
522
  (如 piper)才返回 True/False,否则 None(交标准 repo/aim 判断)。纯字符串/文件
517
- 存在性逻辑、不加载模型;任何异常/找不到 → None(best-effort,绝不阻塞引擎列表)。"""
523
+ 存在性逻辑、不加载模型;任何异常/找不到 → None(best-effort,绝不阻塞引擎列表)。
524
+ ``model_override`` 非空时按被覆盖的 model 判断(对照该请求实际加载的模型)。"""
518
525
  handle = self._handles.get(alias)
519
526
  if handle is None:
520
527
  return None
521
528
  try:
522
- return handle.provider_cls.local_model_present(self._settings_for(alias) or {})
529
+ return handle.provider_cls.local_model_present(self._settings_for(alias, model_override) or {})
523
530
  except Exception: # noqa: BLE001 - best-effort 预检,失败当作「无法判断」
524
531
  return None
525
532
 
526
- def download_spec(self, alias: str) -> dict | None:
533
+ def download_spec(self, alias: str, model_override: str | None = None) -> dict | None:
527
534
  """委托给 provider 类的 ``download_spec`` —— 返回 ``{repo, allow_patterns, label}``
528
535
  的部分 snapshot 下载描述(piper 等无法 aim 纳管、需从大仓只取若干文件的引擎),
529
- 否则 None。纯字符串逻辑、不加载模型;任何异常/找不到 → None(best-effort)。"""
536
+ 否则 None。纯字符串逻辑、不加载模型;任何异常/找不到 → None(best-effort)。
537
+ ``model_override`` 非空时按被覆盖的 model 取(下载目标对准该请求实际加载的模型)。"""
530
538
  handle = self._handles.get(alias)
531
539
  if handle is None:
532
540
  return None
533
541
  try:
534
- return handle.provider_cls.download_spec(self._settings_for(alias) or {})
542
+ return handle.provider_cls.download_spec(self._settings_for(alias, model_override) or {})
535
543
  except Exception: # noqa: BLE001 - best-effort,失败当作「无部分下载」
536
544
  return None
537
545
 
546
+ def pending_reference_asr(self, alias: str, opts) -> dict | None: # noqa: ANN001
547
+ """委托给 provider 类的 ``pending_reference_asr`` —— 该请求(``opts``)是否需要先追踪
548
+ 下载一个参考转写用的 ASR 模型(克隆类 TTS 在 ref_text 为空时);返回 ``{source, repo,
549
+ label}`` 或 None。纯字符串/缓存逻辑、不加载模型;任何异常/找不到 → None(best-effort)。"""
550
+ handle = self._handles.get(alias)
551
+ if handle is None:
552
+ return None
553
+ try:
554
+ return handle.provider_cls.pending_reference_asr(self._settings_for(alias) or {}, opts)
555
+ except Exception: # noqa: BLE001 - best-effort 预检,失败当作「无需二级下载」
556
+ return None
557
+
558
+ def pending_aux_models(self, alias: str, opts) -> "list[dict] | None": # noqa: ANN001
559
+ """委托给 provider 类的 ``pending_aux_models`` —— 该引擎首次加载要下的辅助模型里尚未缓存的
560
+ 那些(``[{repo, allow_patterns, label}]`` 或 None);合成前置 gate 据此追踪下载(上 Dashboard)。
561
+ 纯字符串/缓存逻辑、不加载模型;任何异常/找不到 → None(best-effort)。"""
562
+ handle = self._handles.get(alias)
563
+ if handle is None:
564
+ return None
565
+ try:
566
+ return handle.provider_cls.pending_aux_models(self._settings_for(alias) or {}, opts)
567
+ except Exception: # noqa: BLE001 - best-effort 预检,失败当作「无待下 aux」
568
+ return None
569
+
538
570
  async def _negotiate_audio_format(
539
571
  self, handle: "_ProviderHandle", audio: AudioData
540
572
  ) -> AudioData:
@@ -69,6 +69,13 @@ def _augment_worker_path(env: dict) -> None:
69
69
  # Override via env; <= 0 disables the bound entirely.
70
70
  _DEFAULT_START_TIMEOUT_S = 600.0 # max silence during model load / weight download
71
71
  _DEFAULT_INVOKE_TIMEOUT_S = 300.0 # max silence during a single transcribe/synthesize
72
+ # Max wall-clock to wait for a freshly-spawned worker to BIND its UDS. This is a
73
+ # hard deadline (not inactivity-based) — a fresh interpreter + `import openspeechapi`
74
+ # is ~0.2s idle, but under heavy CPU contention or a large parent process (torch
75
+ # loaded → slow fork/COW) the spawn can take seconds, so keep it generous. A dead
76
+ # worker (import error / unpicklable provider) is detected immediately regardless,
77
+ # so a wide window never means a long hang on a real failure. Override via env.
78
+ _DEFAULT_SOCKET_TIMEOUT_S = 30.0
72
79
 
73
80
 
74
81
  def _env_timeout(name: str, default: float) -> float:
@@ -545,6 +552,7 @@ class SubprocessExecutor(Executor):
545
552
  *,
546
553
  start_timeout_s: float | None = None,
547
554
  invoke_timeout_s: float | None = None,
555
+ socket_timeout_s: float | None = None,
548
556
  worker_python: str | None = None,
549
557
  ) -> None:
550
558
  self._provider_cls: type[SpeechProvider] | None = None
@@ -571,6 +579,12 @@ class SubprocessExecutor(Executor):
571
579
  _env_timeout("OSA_WORKER_INVOKE_TIMEOUT_S", _DEFAULT_INVOKE_TIMEOUT_S)
572
580
  if invoke_timeout_s is None else invoke_timeout_s
573
581
  )
582
+ # Hard deadline for the freshly-spawned worker to bind its UDS (see
583
+ # _DEFAULT_SOCKET_TIMEOUT_S). Env-overridable so a slow/loaded host can widen it.
584
+ self._socket_timeout_s = (
585
+ _env_timeout("OSA_WORKER_SOCKET_TIMEOUT_S", _DEFAULT_SOCKET_TIMEOUT_S)
586
+ if socket_timeout_s is None else socket_timeout_s
587
+ )
574
588
  # Rolling capture of the worker's stderr (download progress, tracebacks,
575
589
  # native crash output) — surfaced in logs live and appended to errors.
576
590
  self._stderr_tail: deque[str] = deque(maxlen=50)
@@ -643,38 +657,64 @@ class SubprocessExecutor(Executor):
643
657
  # native crash output) to the server log instead of discarding it.
644
658
  self._start_stderr_drain()
645
659
 
646
- # Wait for socket to appear (worker needs a moment to bind)
647
- await self._wait_for_socket(self._socket_path, timeout=10.0)
648
-
649
- self._reader, self._writer = await asyncio.open_unix_connection(self._socket_path)
650
-
651
- # Tell the worker to start the provider. Bound the wait: provider.start()
652
- # may download model weights, which can stall indefinitely on a blocked
653
- # network — turn that into a clear error rather than an infinite hang.
654
- await _write_msg(self._writer, {"cmd": "start"})
655
660
  try:
656
- resp = await self._read_resp(self._start_timeout_s)
657
- except asyncio.TimeoutError:
658
- to = self._start_timeout_s
661
+ # Wait for the worker to bind its socket. Fails fast if the worker dies
662
+ # during startup; the window is generous (OSA_WORKER_SOCKET_TIMEOUT_S,
663
+ # default 30s) so a slow spawn on a CPU-bound host / heavy parent (torch
664
+ # loaded → slow fork/COW) isn't killed prematurely.
665
+ await self._wait_for_socket(self._socket_path)
666
+
667
+ self._reader, self._writer = await asyncio.open_unix_connection(self._socket_path)
668
+
669
+ # Tell the worker to start the provider. Bound the wait: provider.start()
670
+ # may download model weights, which can stall indefinitely on a blocked
671
+ # network — turn that into a clear error rather than an infinite hang.
672
+ await _write_msg(self._writer, {"cmd": "start"})
673
+ try:
674
+ resp = await self._read_resp(self._start_timeout_s)
675
+ except asyncio.TimeoutError:
676
+ to = self._start_timeout_s
677
+ raise RuntimeError(
678
+ f"Worker '{self._label}' did not finish startup — no progress for "
679
+ f"{to:.0f}s (model load/download stalled; a progressing download "
680
+ f"would keep emitting output). Pre-download the model, use the "
681
+ f"ModelScope mirror (hub=ms) on China networks, or raise "
682
+ f"OSA_WORKER_START_TIMEOUT_S. Recent worker output:\n{self._recent_stderr()}"
683
+ ) from None
684
+ if not resp.get("ok"):
685
+ raise RuntimeError(f"Worker start failed: {resp.get('error')}")
686
+ except BaseException:
687
+ # Any startup failure (socket never bound, worker died, start error/timeout)
688
+ # → tear down the worker so we never leak a process or a half-open connection.
659
689
  await self._kill_process()
660
- raise RuntimeError(
661
- f"Worker '{self._label}' did not finish startup — no progress for "
662
- f"{to:.0f}s (model load/download stalled; a progressing download "
663
- f"would keep emitting output). Pre-download the model, use the "
664
- f"ModelScope mirror (hub=ms) on China networks, or raise "
665
- f"OSA_WORKER_START_TIMEOUT_S. Recent worker output:\n{self._recent_stderr()}"
666
- ) from None
667
- if not resp.get("ok"):
668
- raise RuntimeError(f"Worker start failed: {resp.get('error')}")
669
-
670
- @staticmethod
671
- async def _wait_for_socket(path: str, timeout: float = 10.0) -> None:
690
+ raise
691
+
692
+ async def _wait_for_socket(self, path: str, timeout: float | None = None) -> None:
693
+ """Wait for the worker to bind ``path``, up to ``timeout`` seconds (default
694
+ ``self._socket_timeout_s``). Fails FAST if the worker process exits first —
695
+ an import error / unpicklable provider / bad interpreter dies before binding,
696
+ and there's no point waiting out the full window (and the generic 'socket did
697
+ not appear' hid the real cause). Surfaces the worker's stderr either way."""
698
+ if timeout is None:
699
+ timeout = self._socket_timeout_s
672
700
  deadline = time.monotonic() + timeout
673
701
  while time.monotonic() < deadline:
674
702
  if os.path.exists(path):
675
703
  return
704
+ proc = self._process
705
+ if proc is not None and proc.returncode is not None:
706
+ raise RuntimeError(
707
+ f"Worker '{self._label}' exited (code {proc.returncode}) during "
708
+ f"startup before binding its socket. Recent worker output:\n"
709
+ f"{self._recent_stderr()}"
710
+ )
676
711
  await asyncio.sleep(0.05)
677
- raise RuntimeError(f"Worker socket did not appear at {path!r} within {timeout}s")
712
+ raise RuntimeError(
713
+ f"Worker '{self._label}' socket did not appear at {path!r} within {timeout:.0f}s "
714
+ f"(worker startup stalled — a heavy import under CPU contention, a slow fork "
715
+ f"of a large parent, or a wedged interpreter; raise OSA_WORKER_SOCKET_TIMEOUT_S "
716
+ f"on a slow/loaded host). Recent worker output:\n{self._recent_stderr()}"
717
+ )
678
718
 
679
719
  async def _read_resp(self, idle_timeout: float) -> Any:
680
720
  """Read one worker response with a progress-aware (inactivity) bound.
@@ -42,7 +42,10 @@ class CatalogEntry:
42
42
  vllm_venv: bool = False # build a clean vLLM-Omni serving venv (no openspeechapi) for a service-client engine
43
43
  fish_venv: bool = False # build a fish-speech serving venv + git src checkout (service-client engine)
44
44
  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
+ 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
+ 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)
45
47
  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)
48
+ 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
46
49
 
47
50
  @property
48
51
  def compatible(self) -> bool:
@@ -203,7 +206,10 @@ def build_catalog(registry_path: Path | None = None) -> list[CatalogEntry]:
203
206
  vllm_venv=bool(raw.get("vllm_venv", False)),
204
207
  fish_venv=bool(raw.get("fish_venv", False)),
205
208
  cosyvoice_venv=bool(raw.get("cosyvoice_venv", False)),
209
+ indextts_venv=bool(raw.get("indextts_venv", False)),
210
+ spark_venv=bool(raw.get("spark_venv", False)),
206
211
  cuda_torch=bool(raw.get("cuda_torch", False)),
212
+ spacy_models=list(raw.get("spacy_models", []) or []),
207
213
  )
208
214
  # Try to enrich with provider code metadata
209
215
  entry = _enrich_from_provider(entry)
@@ -227,6 +233,20 @@ def get_catalog() -> list[CatalogEntry]:
227
233
  return _catalog
228
234
 
229
235
 
236
+ def refresh_catalog() -> list[CatalogEntry]:
237
+ """Invalidate the cached singleton and rebuild from the registry YAML.
238
+
239
+ ``get_catalog()`` caches ``_catalog`` for the process lifetime, so an engine
240
+ added to the registry after the server started stays invisible until a restart
241
+ (the F5-TTS "not on the Engines page" incident). This lets the WebUI Refresh
242
+ button — via ``GET /v1/engine-catalog?refresh=1`` — pick up newly-registered
243
+ engines and on-disk registry edits live, without bouncing the server.
244
+ """
245
+ global _catalog
246
+ _catalog = None
247
+ return get_catalog()
248
+
249
+
230
250
  def get_catalog_entry(name: str) -> CatalogEntry | None:
231
251
  """Look up a catalog entry by name or default_alias.
232
252
 
@@ -520,6 +520,57 @@ engines:
520
520
  pip_extras: [coqui-tts]
521
521
  pip_constraints: ["transformers>=4.57,<5"] # coqui-tts 0.27.5 声明 >=4.57 但其 tortoise 代码用 isin_mps_friendly(transformers 5.x 已删)→ 封顶 <5 取 4.57.x
522
522
 
523
+ - name: kokoro
524
+ provider: kokoro
525
+ type: tts
526
+ category: local
527
+ display_name: "Kokoro-82M"
528
+ description: "Kokoro-82M — 小而快的开源 TTS(Apache-2.0,可商用),49 预设音色 / 8 语言(英美/英/中文/西/法/印/意/葡)。纯预设无克隆;音色首字母即语言(af=美英女、zm=中文男…),选音色即定语言。【中文 + 西/法/印/意/葡 开箱即用】(misaki[zh]=jieba/pypinyin + misaki 自带 espeak[espeakng-loader,无需系统 espeak-ng];20.3 真机 8/8 语言可合成)。英文(a/b)需 spaCy en_core_web_sm(仅 GitHub-release wheel、不入 pip_extras,由安装器经 spacy_models 字段 best-effort 补装[OSA_GITHUB_PROXY 默认 ghfast 镜像],ghfast/GitHub 可达则开箱即用;失败有合成前预检兜底)。日语(pyopenjtalk 源码编译+fugashi+MeCab 词典太脆、装了仍报错)未提供,5 个日语音色已从列表剔除"
529
+ default_alias: kokoro_tts
530
+ default_exec_mode: subprocess # 重(torch)+ isolated venv
531
+ isolated_venv: true
532
+ cuda_torch: true # CUDA 主机(有 nvidia-smi)装 extras 前先从 cu130 index 预装 torch(aarch64 默认 PyPI 是 CPU 版)
533
+ pip_extras: [kokoro] # pyproject optional-dep 组名(= [kokoro>=0.9.2, misaki[zh], soundfile]);拉 torch+misaki[en];misaki[zh] 开中文
534
+ spacy_models: ["en_core_web_sm==3.8.0"] # best-effort 补装:英文(a/b)misaki G2P 需此 spaCy 模型;其唯一 wheel 是 GitHub-release 资产(不能进 pip_extras 否则一处不可达会炸整包),故装完 extra 后经 OSA_GITHUB_PROXY(默认 ghfast)镜像补装;失败不阻塞(合成前预检兜底)
535
+
536
+ - name: f5-tts
537
+ provider: f5-tts
538
+ type: tts
539
+ category: local
540
+ display_name: "F5-TTS"
541
+ description: "F5-TTS(SWivid,DiT+流匹配)— 零样本声音克隆(需 5-15s 参考音频 + 可选参考文本,空则 F5 自动转写),EN/ZH 双语。纯克隆无预设。⚠️ 权重 CC-BY-NC(研究/内部)。torch 包 device 自动 cuda→mps→cpu(macOS/CUDA 通用);模型走 HF(SWivid/F5-TTS 的 <model>/* 部分下载 + Vocos vocoder 自动),镜像感知;需系统 ffmpeg(brew/apt)在服务 PATH 上"
542
+ default_alias: f5_tts
543
+ default_exec_mode: subprocess # 重(torch)+ isolated venv
544
+ isolated_venv: true
545
+ cuda_torch: true # CUDA 主机装 extras 前先从 cu130 index 预装 torch(aarch64 默认 PyPI 是 CPU 版)
546
+ pip_extras: [f5-tts]
547
+
548
+ - name: indextts
549
+ provider: indextts
550
+ type: tts
551
+ category: local
552
+ display_name: "IndexTTS2"
553
+ description: "IndexTTS2(Bilibili IndexTeam)— 工业级自回归零样本 TTS:参考音零样本克隆 + 感情控制(emo_text/emo_vector 8维/emo_audio + emo_alpha)。EN/ZH 多语言。Apache-2.0 商用可。OSA 托管 git-clone SDK venv(uv sync)+ subprocess IPC worker + editable openspeechapi。CUDA 主体(DGX 验证);macOS best-effort(CPU 可跑但慢,MPS 不保证)。⚠️ 首次加载 SDK 另下 ~4-5GB aux 模型(w2v-bert/MaskGCT/campplus/bigvgan)到 model_dir/hf_cache/,镜像感知。需 git 在 PATH。"
554
+ default_alias: indextts
555
+ default_exec_mode: subprocess
556
+ indextts_venv: true # 专用 git-clone SDK 安装器(uv sync + editable openspeechapi + .pth 兜底)
557
+ isolated_venv: true # worker 从 ~/AI/venvs/indextts 跑(resolve_worker_python 据此)
558
+ cuda_torch: true # CUDA 主机装后从 cu130 index 覆盖 torch(uv.lock 钉 torch==2.8.* 在 aarch64 是 CPU 版)
559
+ pip_extras: [] # git-clone SDK 非 PyPI
560
+
561
+ - name: spark-tts
562
+ provider: spark-tts
563
+ type: tts
564
+ category: local
565
+ display_name: "Spark-TTS"
566
+ description: "Spark-TTS(SparkAudio,0.5B)— 基于 Qwen2.5 的自回归 TTS,两种能力:(1) 参考音零样本声音克隆(reference_audio + 可选 reference_text);(2) 可控音色生成(gender=male/female + pitch/speed=very_low..very_high),无需参考音即造一个新声音——首个非纯克隆的本地 TTS。EN/ZH 自动。OSA 托管 git-clone SDK venv(clone + uv venv,SDK 非 PyPI)+ subprocess IPC worker + editable openspeechapi。CUDA 主体(DGX 验证);macOS best-effort(CPU 可跑,MPS 未验证)。需 git 在 PATH。⚠️ 权重 CC BY-NC-SA 4.0 **非商用**(研究/内部);代码 Apache-2.0。"
567
+ default_alias: spark_tts
568
+ default_exec_mode: subprocess
569
+ spark_venv: true # 专用 git-clone SDK 安装器(clone + uv venv + editable openspeechapi + requirements[裁 gradio] + .pth → clone 根;SDK 非 PyPI)
570
+ isolated_venv: true # worker 从 ~/AI/venvs/spark-tts 跑(resolve_worker_python 据此);隔离 transformers==4.46.2
571
+ cuda_torch: true # CUDA 主机装 requirements 前先从 cu13x index 装 torch+torchaudio(requirements 钉 torch==2.5.1 在 aarch64 默认是 CPU 版且与 cu130 冲突)
572
+ pip_extras: [] # git-clone SDK 非 PyPI
573
+
523
574
  # ---- macOS Native ----
524
575
  - name: macos-stt
525
576
  provider: macos-stt
@@ -165,6 +165,16 @@ _PROVIDER_MAP: dict[str, tuple[str, str, str]] = {
165
165
  "CoquiTTS",
166
166
  "CoquiTTSSettings",
167
167
  ),
168
+ "kokoro": (
169
+ "openspeechapi.providers.tts.kokoro",
170
+ "KokoroTTS",
171
+ "KokoroTTSSettings",
172
+ ),
173
+ "f5-tts": (
174
+ "openspeechapi.providers.tts.f5_tts",
175
+ "F5TTS",
176
+ "F5TTSSettings",
177
+ ),
168
178
  "cosyvoice": (
169
179
  "openspeechapi.providers.tts.cosyvoice",
170
180
  "CosyVoiceTTS",
@@ -175,6 +185,16 @@ _PROVIDER_MAP: dict[str, tuple[str, str, str]] = {
175
185
  "FishSpeechTTS",
176
186
  "FishSpeechTTSSettings",
177
187
  ),
188
+ "indextts": (
189
+ "openspeechapi.providers.tts.indextts",
190
+ "IndexTTS2",
191
+ "IndexTTS2Settings",
192
+ ),
193
+ "spark-tts": (
194
+ "openspeechapi.providers.tts.spark",
195
+ "SparkTTSProvider",
196
+ "SparkTTSSettings",
197
+ ),
178
198
  "minimax": (
179
199
  "openspeechapi.providers.tts.minimax",
180
200
  "MinimaxTTS",