openspeechapi 0.2.24__tar.gz → 0.2.25__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 (164) hide show
  1. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/PKG-INFO +1 -1
  2. openspeechapi-0.2.25/openspeechapi/local_engines/vllm_gb10_patch.py +100 -0
  3. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/vllm_venv.py +44 -0
  4. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/qwen3_omni_stt.py +144 -22
  5. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/extras_installer.py +2 -1
  6. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/management.py +57 -16
  7. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/pyproject.toml +1 -1
  8. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/.gitignore +0 -0
  9. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/README.md +0 -0
  10. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/__init__.py +0 -0
  11. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/__main__.py +0 -0
  12. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/cli.py +0 -0
  13. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/client/__init__.py +0 -0
  14. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/client/client.py +0 -0
  15. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/config.py +0 -0
  16. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/__init__.py +0 -0
  17. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/base.py +0 -0
  18. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/enums.py +0 -0
  19. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/model_hub.py +0 -0
  20. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/models.py +0 -0
  21. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/registry.py +0 -0
  22. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/settings.py +0 -0
  23. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/demo.py +0 -0
  24. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/__init__.py +0 -0
  25. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/aim_provision.py +0 -0
  26. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/context.py +0 -0
  27. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/dispatcher.py +0 -0
  28. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/__init__.py +0 -0
  29. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/base.py +0 -0
  30. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/in_process.py +0 -0
  31. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/remote.py +0 -0
  32. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/subprocess_exec.py +0 -0
  33. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/fanout.py +0 -0
  34. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/filters.py +0 -0
  35. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/lifecycle.py +0 -0
  36. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/watcher.py +0 -0
  37. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/engine_catalog.py +0 -0
  38. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/engine_registry.yaml +0 -0
  39. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/exceptions.py +0 -0
  40. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/factory.py +0 -0
  41. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/__init__.py +0 -0
  42. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/aim_resolver.py +0 -0
  43. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/__init__.py +0 -0
  44. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/docker_backend.py +0 -0
  45. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/native_backend.py +0 -0
  46. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/base.py +0 -0
  47. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/__init__.py +0 -0
  48. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/faster_whisper.py +0 -0
  49. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/fish_speech.py +0 -0
  50. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/sherpa_onnx.py +0 -0
  51. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/whisper.py +0 -0
  52. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/whisperlivekit.py +0 -0
  53. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/isolated_venv.py +0 -0
  54. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/manager.py +0 -0
  55. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/models.py +0 -0
  56. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/progress.py +0 -0
  57. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/registry.py +0 -0
  58. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/task_store.py +0 -0
  59. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/tasks.py +0 -0
  60. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/logging_config.py +0 -0
  61. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/__init__.py +0 -0
  62. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/base.py +0 -0
  63. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/debug.py +0 -0
  64. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/latency.py +0 -0
  65. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/metrics.py +0 -0
  66. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/tracing.py +0 -0
  67. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/usage.py +0 -0
  68. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/__init__.py +0 -0
  69. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/_template.py +0 -0
  70. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/__init__.py +0 -0
  71. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/_local_audio.py +0 -0
  72. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/alibaba.py +0 -0
  73. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/assemblyai.py +0 -0
  74. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/azure_speech.py +0 -0
  75. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/baidu.py +0 -0
  76. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/canary_qwen_stt.py +0 -0
  77. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/deepgram.py +0 -0
  78. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/dolphin_stt.py +0 -0
  79. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/elevenlabs.py +0 -0
  80. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/faster_whisper.py +0 -0
  81. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/fireredasr_stt.py +0 -0
  82. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/funasr_stt.py +0 -0
  83. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/gemma4.py +0 -0
  84. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/google_cloud.py +0 -0
  85. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/iflytek.py +0 -0
  86. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/kimi_audio_stt.py +0 -0
  87. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/macos_speech.py +0 -0
  88. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/mlx_whisper_stt.py +0 -0
  89. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/mms_languages.json +0 -0
  90. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/mms_stt.py +0 -0
  91. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/moonshine_stt.py +0 -0
  92. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/openai.py +0 -0
  93. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/paraformer.py +0 -0
  94. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/parakeet_mlx_stt.py +0 -0
  95. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/phi4_multimodal_stt.py +0 -0
  96. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/qwen3_asr.py +0 -0
  97. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/sensevoice.py +0 -0
  98. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/sherpa_onnx.py +0 -0
  99. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/tencent.py +0 -0
  100. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/volcengine.py +0 -0
  101. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/vosk_stt.py +0 -0
  102. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/voxtral_stt.py +0 -0
  103. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/wenet_stt.py +0 -0
  104. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/whisper.py +0 -0
  105. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/whisperlivekit.py +0 -0
  106. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/windows_speech.py +0 -0
  107. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/__init__.py +0 -0
  108. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/alibaba.py +0 -0
  109. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/azure_speech.py +0 -0
  110. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/baidu.py +0 -0
  111. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/coqui.py +0 -0
  112. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/cosyvoice.py +0 -0
  113. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/deepgram.py +0 -0
  114. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/elevenlabs.py +0 -0
  115. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/fish_speech.py +0 -0
  116. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/google_cloud.py +0 -0
  117. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/iflytek.py +0 -0
  118. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/macos_say.py +0 -0
  119. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/minimax.py +0 -0
  120. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/openai.py +0 -0
  121. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/piper.py +0 -0
  122. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/tencent.py +0 -0
  123. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/volcengine.py +0 -0
  124. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/windows_sapi.py +0 -0
  125. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/__init__.py +0 -0
  126. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/app.py +0 -0
  127. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/auth.py +0 -0
  128. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/middleware.py +0 -0
  129. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/model_downloads.py +0 -0
  130. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/native_installer.py +0 -0
  131. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/__init__.py +0 -0
  132. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/stt.py +0 -0
  133. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/tts.py +0 -0
  134. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/webui.py +0 -0
  135. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/system_metrics.py +0 -0
  136. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/webui/app.js +0 -0
  137. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/webui/index.html +0 -0
  138. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/webui/styles.css +0 -0
  139. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/ws/__init__.py +0 -0
  140. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/ws/stt_stream.py +0 -0
  141. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/ws/tts_stream.py +0 -0
  142. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/telemetry/__init__.py +0 -0
  143. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/telemetry/perf.py +0 -0
  144. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/utils/__init__.py +0 -0
  145. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/utils/audio_converter.py +0 -0
  146. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/utils/audio_playback.py +0 -0
  147. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/vendor_registry.yaml +0 -0
  148. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/providers.example.yaml +0 -0
  149. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/aim_adopt.py +0 -0
  150. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/aim_consumers.py +0 -0
  151. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/cloud/install.sh +0 -0
  152. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/faster-whisper/native/install.sh +0 -0
  153. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/fish-speech/native/install.sh +0 -0
  154. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/macos-stt/_bundle.sh +0 -0
  155. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/macos-stt/install.sh +0 -0
  156. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/macos-stt/macos_stt.swift +0 -0
  157. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/macos-stt/request_auth.swift +0 -0
  158. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/sherpa-onnx/native/install.sh +0 -0
  159. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/sherpa-onnx/native/run_streaming_server.py +0 -0
  160. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/whisper/native/install.sh +0 -0
  161. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/whisperlivekit/native/install.sh +0 -0
  162. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/gen_mms_languages.py +0 -0
  163. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/preload_stt_model.py +0 -0
  164. {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/release.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openspeechapi
3
- Version: 0.2.24
3
+ Version: 0.2.25
4
4
  Summary: Unified speech interface for STT/TTS providers
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: httpx>=0.27
@@ -0,0 +1,100 @@
1
+ """Canonical GB10/Blackwell vLLM source patches — shared by the venv + docker serving paths.
2
+
3
+ Two idempotent source edits vLLM 0.22 needs on the GB10 (sm_120) for qwen3-omni:
4
+ #1 NVML `get_device_capability` raises NVMLError_InvalidArgument on the unified-memory iGPU
5
+ → broaden the catch + fall back to `torch.cuda.get_device_capability`.
6
+ #6 qwen3-omni's ViT passes `cu_seqlens` on CPU; flash_attn_varlen_func needs it on CUDA
7
+ → `cu_seqlens = cu_seqlens.to(q.device)` before the call.
8
+
9
+ Both are **safe no-ops off the GB10**: on a normal CUDA host NVML works (the fallback never runs)
10
+ and cu_seqlens is already on CUDA (`.to` is a no-op); on a vLLM version whose source differs the
11
+ target string isn't found and the file is left untouched. So this can be applied unconditionally —
12
+ including inside a freshly-pulled official `vllm/vllm-omni` container (x86 or arm64).
13
+
14
+ Used by:
15
+ - `vllm_venv.py` (venv install) — patches the venv's site-packages after `uv pip install`.
16
+ - the qwen3-omni docker provider — this file is mounted into the container and run with the
17
+ container's python before `vllm-omni serve` (`python3 <mounted> ` patches /usr/.../vllm).
18
+
19
+ Run standalone (e.g. inside a container): ``python3 vllm_gb10_patch.py`` → patches the running
20
+ interpreter's vllm and prints one status line per file.
21
+ """
22
+ from __future__ import annotations
23
+
24
+ import subprocess
25
+ import sys
26
+ from pathlib import Path
27
+
28
+ NVML_OLD = """ major, minor = pynvml.nvmlDeviceGetCudaComputeCapability(handle)
29
+ return DeviceCapability(major=major, minor=minor)
30
+ except RuntimeError:
31
+ return None"""
32
+ NVML_NEW = """ major, minor = pynvml.nvmlDeviceGetCudaComputeCapability(handle)
33
+ return DeviceCapability(major=major, minor=minor)
34
+ except Exception:
35
+ # GB10/DGX Spark: NVML capability query raises NVMLError_InvalidArgument on the
36
+ # unified-memory iGPU. torch reports the capability fine -> fall back to it.
37
+ try:
38
+ import torch
39
+ major, minor = torch.cuda.get_device_capability(device_id)
40
+ return DeviceCapability(major=major, minor=minor)
41
+ except Exception:
42
+ return None"""
43
+ NVML_MARK = "GB10/DGX Spark: NVML capability query"
44
+
45
+ VIT_OLD = """ 0, (batch_size + 1) * q_len, step=q_len, dtype=torch.int32, device=q.device
46
+ )
47
+ max_seqlen = q_len if max_seqlen is None else max_seqlen.item()"""
48
+ VIT_NEW = """ 0, (batch_size + 1) * q_len, step=q_len, dtype=torch.int32, device=q.device
49
+ )
50
+ cu_seqlens = cu_seqlens.to(q.device) # GB10 fix: cu_seqlens may be on CPU; flash-attn needs CUDA
51
+ max_seqlen = q_len if max_seqlen is None else max_seqlen.item()"""
52
+ VIT_MARK = "GB10 fix: cu_seqlens may be on CPU"
53
+
54
+
55
+ def patch_file(path: Path, old: str, new: str, mark: str) -> str:
56
+ if not path.exists():
57
+ return f"{path.name}: missing(skip)"
58
+ s = path.read_text(encoding="utf-8")
59
+ if mark in s:
60
+ return f"{path.name}: already"
61
+ if old not in s:
62
+ return f"{path.name}: target-not-found(skip)"
63
+ path.write_text(s.replace(old, new, 1), encoding="utf-8")
64
+ return f"{path.name}: patched"
65
+
66
+
67
+ def apply_to_site_packages(site_packages: Path) -> list[str]:
68
+ """Apply both patches to a vllm install under ``site_packages``. Idempotent."""
69
+ return [
70
+ patch_file(site_packages / "vllm/platforms/cuda.py", NVML_OLD, NVML_NEW, NVML_MARK),
71
+ patch_file(
72
+ site_packages / "vllm/v1/attention/ops/vit_attn_wrappers.py",
73
+ VIT_OLD, VIT_NEW, VIT_MARK),
74
+ ]
75
+
76
+
77
+ def site_packages_of(python_exe: str) -> Path | None:
78
+ """site-packages dir of an arbitrary python interpreter (venv / container)."""
79
+ try:
80
+ r = subprocess.run(
81
+ [python_exe, "-c", "import sysconfig;print(sysconfig.get_path('purelib'))"],
82
+ capture_output=True, text=True, timeout=30)
83
+ sp = (r.stdout or "").strip()
84
+ return Path(sp) if sp else None
85
+ except Exception: # noqa: BLE001
86
+ return None
87
+
88
+
89
+ def main() -> None:
90
+ sp = site_packages_of(sys.executable)
91
+ if sp is None:
92
+ print("site-packages not found")
93
+ return
94
+ print("site-packages:", sp)
95
+ for line in apply_to_site_packages(sp):
96
+ print(line)
97
+
98
+
99
+ if __name__ == "__main__":
100
+ main()
@@ -175,3 +175,47 @@ def create_vllm_venv(
175
175
  emit(f"GB10 patches: {apply_gb10_patches(vpy)}")
176
176
 
177
177
  return VllmVenvResult(ok=True, venv_python=str(vpy), method="uv", log="\n".join(logs)[-4000:])
178
+
179
+
180
+ # ── docker serving path (preferred; cross-arch official image) ─────────────────────────────
181
+ def resolve_serve_mode(configured: str) -> str:
182
+ """``auto`` → 'docker' if docker is on PATH, else 'venv'. Concrete values pass through.
183
+ (At install we then verify the docker image is actually obtainable, else fall back to venv.)"""
184
+ m = (configured or "auto").strip().lower()
185
+ if m in ("docker", "venv"):
186
+ return m
187
+ return "docker" if shutil.which("docker") else "venv"
188
+
189
+
190
+ def ensure_docker_image(
191
+ image: str, *, timeout: int = 3600, progress: Callable[[str], None] | None = None,
192
+ ) -> tuple[bool, str]:
193
+ """Ensure the vllm-omni docker image is available: present locally → ok; else ``docker pull``.
194
+
195
+ The GB10 source patches are applied at container RUN (entrypoint wrapper, see the provider),
196
+ NOT baked here — so a freshly-pulled official ``vllm/vllm-omni`` image works on the GB10 too,
197
+ and the multi-arch tag pulls the host's arch (amd64 or arm64). Returns (ok, log)."""
198
+ logs: list[str] = []
199
+
200
+ def emit(line: str) -> None:
201
+ line = (line or "").rstrip()
202
+ if not line:
203
+ return
204
+ logs.append(line)
205
+ if progress:
206
+ progress(line)
207
+
208
+ docker = shutil.which("docker")
209
+ if not docker:
210
+ return False, "docker not found on PATH"
211
+ r = _run([docker, "images", "-q", image], timeout=120)
212
+ if (r.stdout or "").strip():
213
+ emit(f"image present locally: {image}")
214
+ return True, "\n".join(logs)
215
+ emit(f"docker pull {image} … (国内需配 docker 镜像加速,否则 DockerHub 超时)")
216
+ r = _run([docker, "pull", image], timeout=timeout)
217
+ emit((r.stdout or "") + (r.stderr or ""))
218
+ if r.returncode != 0:
219
+ emit(f"pull failed — image neither local nor pullable here: {image}")
220
+ return False, "\n".join(logs)[-4000:]
221
+ return True, "\n".join(logs)[-4000:]
@@ -99,6 +99,17 @@ class Qwen3OmniSTTSettings(BaseSettings):
99
99
  timeout_s: float = 30.0 # httpx client connect/pool timeout
100
100
  request_timeout_s: float = 300.0 # per-request read timeout (heavy model)
101
101
 
102
+ # ── serve mode: docker (default) or venv (fallback) ────────────────────────
103
+ # "auto" resolves at install to docker if usable, else venv; install persists the concrete
104
+ # value here. docker mode runs the official cross-arch vllm-omni image; venv mode runs the
105
+ # per-engine uv venv (vllm_venv.py). Both speak the same :8901 OpenAI API + use the aim model.
106
+ serve_mode: str = "auto"
107
+ docker_image: str = "vllm/vllm-omni:v0.22.0" # multi-arch (amd64+arm64): docker pulls the host's arch
108
+ docker_container_name: str = "osa-qwen3-omni"
109
+ # host flashinfer cache mounted into the container → reuse compiled MoE kernels (no recompile)
110
+ docker_flashinfer_cache: str = "~/.cache/flashinfer"
111
+ docker_extra_run_args: str = "" # extra `docker run` args, e.g. "--shm-size 16g"
112
+
102
113
 
103
114
  class Qwen3OmniSTT(STTProvider):
104
115
  name = "qwen3-omni"
@@ -116,6 +127,7 @@ class Qwen3OmniSTT(STTProvider):
116
127
  "hub": ["auto", "hf", "ms"],
117
128
  "language": ["auto", "en", "zh", "yue", "ja", "ko", "de", "fr", "es"],
118
129
  "moe_backend": ["flashinfer_cutlass", "triton"],
130
+ "serve_mode": ["auto", "docker", "venv"],
119
131
  }
120
132
 
121
133
  # Declared at class level too, so an instance reconstructed WITHOUT __init__ — e.g. a
@@ -127,14 +139,18 @@ class Qwen3OmniSTT(STTProvider):
127
139
  _service_proc = None
128
140
  _owns_service = False
129
141
  _service_log_fh = None
142
+ _docker_container = None # name of the container WE started (docker mode), else None
143
+ _served_model_id = None # cached id from GET /v1/models (the request `model` param)
130
144
 
131
145
  def __init__(self, settings: Qwen3OmniSTTSettings | None = None) -> None:
132
146
  self.settings = settings or Qwen3OmniSTTSettings()
133
147
  self._client: Any = None
134
148
  self._owns_client: bool = True
135
- self._service_proc: subprocess.Popen | None = None # OSA-managed vllm-omni serve
149
+ self._service_proc: subprocess.Popen | None = None # OSA-managed vllm-omni serve (venv mode)
136
150
  self._owns_service: bool = False # True only if WE spawned it
137
151
  self._service_log_fh: Any = None
152
+ self._docker_container: str | None = None # container WE started (docker mode)
153
+ self._served_model_id: str | None = None # cached /v1/models id
138
154
 
139
155
  def set_http_client(self, client) -> None:
140
156
  self._client = client
@@ -296,19 +312,50 @@ class Qwen3OmniSTT(STTProvider):
296
312
  return ""
297
313
  return f"{cap}a" if major >= 12 else ""
298
314
 
315
+ def _resolve_serve_mode(self) -> str:
316
+ """Concrete serve mode. 'auto' → docker if docker is on PATH, else venv. Install normally
317
+ pins a concrete value in config; this is the runtime safety net."""
318
+ m = (self.settings.serve_mode or "auto").strip().lower()
319
+ if m in ("docker", "venv"):
320
+ return m
321
+ return "docker" if shutil.which("docker") else "venv"
322
+
299
323
  async def _ensure_service(self) -> None:
300
- """Launch ``vllm-omni serve`` on api_url if nothing healthy is there, then poll until
301
- ready. A server already up is reused (never duplicated) and left running on stop()."""
324
+ """Launch the vllm-omni server on api_url if nothing healthy is there, then poll until
325
+ ready. An already-healthy server is reused (never duplicated). docker mode runs the official
326
+ cross-arch image; venv mode runs the per-engine venv binary."""
302
327
  if not self.settings.manage_service:
303
328
  return
304
329
  if await self.health_check():
305
330
  logger.info("{}: reusing existing service at {}", self.name, self.settings.api_url)
306
331
  return
332
+ if self._resolve_serve_mode() == "docker":
333
+ await self._start_docker()
334
+ else:
335
+ await self._start_venv()
336
+
337
+ async def _poll_until_healthy(self, alive, on_dead: str) -> None:
338
+ """Shared readiness poll: wait for /v1/models healthy, or fail fast if ``alive()`` is False."""
339
+ timeout = float(self.settings.service_startup_timeout_s)
340
+ deadline = time.monotonic() + timeout
341
+ while time.monotonic() < deadline:
342
+ if not alive():
343
+ self._stop_service()
344
+ raise RuntimeError(on_dead)
345
+ if await self.health_check():
346
+ logger.info("{}: vllm-omni server ready at {}", self.name, self.settings.api_url)
347
+ return
348
+ await asyncio.sleep(2.0)
349
+ self._stop_service()
350
+ raise RuntimeError(
351
+ f"vllm-omni server did not become healthy within {timeout:.0f}s")
352
+
353
+ async def _start_venv(self) -> None:
307
354
  try:
308
355
  cmd = self._build_service_command()
309
356
  except RuntimeError as exc:
310
357
  logger.warning(
311
- "{}: cannot auto-start the service ({}). The engine started, but transcription "
358
+ "{}: cannot auto-start the venv service ({}). Engine started, but transcription "
312
359
  "will fail until a vllm-omni server is reachable at {}.",
313
360
  self.name, exc, self.settings.api_url)
314
361
  return
@@ -316,27 +363,93 @@ class Qwen3OmniSTT(STTProvider):
316
363
  log_path = Path(self.settings.service_log_path).expanduser()
317
364
  log_path.parent.mkdir(parents=True, exist_ok=True)
318
365
  self._service_log_fh = log_path.open("ab")
319
- logger.info("{}: launching vllm-omni server → {}", self.name, " ".join(cmd))
366
+ logger.info("{}: launching vllm-omni (venv) → {}", self.name, " ".join(cmd))
320
367
  self._service_proc = subprocess.Popen(
321
368
  cmd, stdout=self._service_log_fh, stderr=subprocess.STDOUT, env=env)
322
369
  self._owns_service = True
323
- timeout = float(self.settings.service_startup_timeout_s)
324
- deadline = time.monotonic() + timeout
325
- while time.monotonic() < deadline:
326
- rc = self._service_proc.poll()
327
- if rc is not None:
328
- self._stop_service()
329
- raise RuntimeError(
330
- f"vllm-omni server exited early (code {rc}); see {log_path}")
331
- if await self.health_check():
332
- logger.info("{}: vllm-omni server ready at {}", self.name, self.settings.api_url)
333
- return
334
- await asyncio.sleep(2.0)
335
- self._stop_service()
336
- raise RuntimeError(
337
- f"vllm-omni server did not become healthy within {timeout:.0f}s; see {log_path}")
370
+ await self._poll_until_healthy(
371
+ alive=lambda: self._service_proc.poll() is None,
372
+ on_dead=f"vllm-omni (venv) exited early; see {log_path}")
373
+
374
+ async def _start_docker(self) -> None:
375
+ if not shutil.which("docker"):
376
+ logger.warning("{}: docker not found; cannot start docker-mode service.", self.name)
377
+ return
378
+ cmd = self._build_docker_command()
379
+ logger.info("{}: launching vllm-omni (docker) → {}", self.name, " ".join(cmd))
380
+ r = await asyncio.to_thread(subprocess.run, cmd, capture_output=True, text=True)
381
+ if r.returncode != 0:
382
+ raise RuntimeError(f"docker run failed: {(r.stderr or r.stdout or '').strip()[-400:]}")
383
+ self._docker_container = self.settings.docker_container_name
384
+ self._owns_service = True
385
+ await self._poll_until_healthy(
386
+ alive=self._docker_alive,
387
+ on_dead=f"vllm-omni container died on startup; see `docker logs {self._docker_container}`")
388
+
389
+ def _docker_alive(self) -> bool:
390
+ name = self._docker_container
391
+ if not name:
392
+ return False
393
+ try:
394
+ r = subprocess.run(["docker", "ps", "-q", "-f", f"name=^{name}$"],
395
+ capture_output=True, text=True, timeout=10)
396
+ return bool((r.stdout or "").strip())
397
+ except Exception: # noqa: BLE001
398
+ return True # don't false-kill on a transient docker hiccup
399
+
400
+ def _build_docker_command(self) -> list[str]:
401
+ """`docker run -d` for the official cross-arch vllm-omni image: mount the aim model +
402
+ flashinfer cache + the GB10 patch script, then (patch → serve) via a bash entrypoint."""
403
+ s = self.settings
404
+ host, port = self._service_host_port()
405
+ model_dir = aim_local_path_or(s.model_path, s.model)
406
+ if not Path(model_dir).is_dir():
407
+ raise RuntimeError(
408
+ f"docker mode needs the model on the host first (got '{model_dir}'); "
409
+ "download it (Engine Catalog「下载模型」or aim) then retry.")
410
+ from openspeechapi.local_engines import vllm_gb10_patch
411
+ patch_host = str(Path(vllm_gb10_patch.__file__).resolve())
412
+ cache = str(Path(s.docker_flashinfer_cache).expanduser())
413
+ Path(cache).mkdir(parents=True, exist_ok=True)
414
+ run = ["docker", "run", "-d", "--rm", "--name", s.docker_container_name, "--gpus", "all",
415
+ "-v", f"{model_dir}:/model:ro",
416
+ "-v", f"{cache}:/root/.cache/flashinfer",
417
+ "-v", f"{patch_host}:/tmp/vllm_gb10_patch.py:ro",
418
+ "-e", f"MAX_JOBS={int(s.max_jobs)}"]
419
+ if s.torch_cuda_arch_list.strip():
420
+ run += ["-e", f"TORCH_CUDA_ARCH_LIST={s.torch_cuda_arch_list.strip()}"]
421
+ run += ["-p", f"{port}:{port}"]
422
+ if s.docker_extra_run_args.strip():
423
+ run += shlex.split(s.docker_extra_run_args)
424
+ serve = [f"vllm-omni serve /model --host 0.0.0.0 --port {port}",
425
+ f"--gpu-memory-utilization {s.gpu_memory_utilization}",
426
+ f"--max-num-seqs {int(s.max_num_seqs)} --max-model-len {int(s.max_model_len)}"]
427
+ if s.moe_backend.strip():
428
+ serve.append(f"--moe-backend {s.moe_backend.strip()}")
429
+ if s.extra_serve_args.strip():
430
+ serve.append(s.extra_serve_args.strip())
431
+ # patch is idempotent + a safe no-op off-GB10; `|| true` so a patch hiccup never blocks serve
432
+ entry = f"python3 /tmp/vllm_gb10_patch.py || true; exec {' '.join(serve)}"
433
+ run += ["--entrypoint", "bash", s.docker_image, "-c", entry]
434
+ return run
435
+
436
+ async def _served_model(self, fallback: str) -> str:
437
+ """The model id the running server actually serves (GET /v1/models; cached). docker mode →
438
+ '/model' (the mount); venv mode → the host path. Always use this as the request `model`."""
439
+ if self._served_model_id:
440
+ return self._served_model_id
441
+ try:
442
+ url = urljoin(self.settings.api_url.rstrip("/") + "/", "v1/models")
443
+ data = (await self._client.get(url)).json().get("data") or []
444
+ if data:
445
+ self._served_model_id = str(data[0].get("id") or fallback)
446
+ return self._served_model_id
447
+ except Exception: # noqa: BLE001
448
+ pass
449
+ return fallback
338
450
 
339
451
  def _stop_service(self) -> None:
452
+ # venv-spawned process
340
453
  proc, self._service_proc = self._service_proc, None
341
454
  if proc is not None and self._owns_service and proc.poll() is None:
342
455
  proc.terminate()
@@ -344,8 +457,17 @@ class Qwen3OmniSTT(STTProvider):
344
457
  proc.wait(timeout=15)
345
458
  except subprocess.TimeoutExpired:
346
459
  proc.kill()
347
- logger.info("{}: stopped managed vllm-omni server", self.name)
460
+ logger.info("{}: stopped managed vllm-omni (venv)", self.name)
461
+ # docker container WE started (--rm → removed on stop)
462
+ name, self._docker_container = self._docker_container, None
463
+ if name and self._owns_service:
464
+ try:
465
+ subprocess.run(["docker", "stop", name], capture_output=True, timeout=30)
466
+ logger.info("{}: stopped managed vllm-omni container '{}'", self.name, name)
467
+ except Exception: # noqa: BLE001
468
+ pass
348
469
  self._owns_service = False
470
+ self._served_model_id = None
349
471
  if self._service_log_fh is not None:
350
472
  try:
351
473
  self._service_log_fh.close()
@@ -365,7 +487,7 @@ class Qwen3OmniSTT(STTProvider):
365
487
  s = self._effective_settings(
366
488
  opts, typed_map={"model": "model", "prompt": "prompt", "language": "language"}
367
489
  )
368
- model = aim_local_path_or(s.model_path, s.model)
490
+ model = await self._served_model(aim_local_path_or(s.model_path, s.model))
369
491
  language = (s.language or "").strip()
370
492
  prompt = (s.prompt or "").strip()
371
493
 
@@ -31,8 +31,9 @@ except Exception: # pragma: no cover
31
31
  class ExtrasInstallResult:
32
32
  ok: bool
33
33
  packages: list[str] = field(default_factory=list)
34
- method: str = "" # "pip" | "uv" | "none" | "noop"
34
+ method: str = "" # "pip" | "uv" | "none" | "noop" | "docker" | "vllm-venv"
35
35
  log: str = ""
36
+ serve_mode: str = "" # vLLM-serve engines: resolved "docker" | "venv" → persisted to config
36
37
 
37
38
 
38
39
  def _eval_marker(dep: str) -> str | None:
@@ -614,19 +614,34 @@ async def _ensure_engine_extras(entry):
614
614
  repo_root = Path(__file__).resolve().parents[3]
615
615
 
616
616
  if entry.vllm_venv:
617
- from openspeechapi.local_engines.vllm_venv import create_vllm_venv
617
+ from openspeechapi.local_engines.vllm_venv import (
618
+ create_vllm_venv, ensure_docker_image, resolve_serve_mode)
619
+ defaults = entry.default_settings or {}
620
+ # docker-first: try the (cross-arch) official image; fall back to a venv build if docker
621
+ # isn't usable or the image can't be obtained. The resolved mode is persisted to config.
622
+ mode = resolve_serve_mode(defaults.get("serve_mode", "auto"))
623
+ docker_log = ""
624
+ if mode == "docker":
625
+ image = defaults.get("docker_image", "vllm/vllm-omni:v0.22.0")
626
+ ok, docker_log = await asyncio.to_thread(ensure_docker_image, image)
627
+ if ok:
628
+ return ExtrasInstallResult(
629
+ ok=True, packages=[image], method="docker",
630
+ log=docker_log, serve_mode="docker")
631
+ docker_log += "\n[docker image unavailable → falling back to venv build]\n"
618
632
  res = await asyncio.to_thread(create_vllm_venv, repo_root, entry)
619
633
  if not res.ok:
620
634
  raise HTTPException(
621
635
  status_code=400,
622
636
  detail=(
623
- f"Failed to build the vLLM-Omni serving venv for '{entry.name}'. "
624
- f"Build it manually, then retry.\n\n{res.log[-800:]}"
637
+ f"Failed to build the vLLM serving env for '{entry.name}'. "
638
+ f"Build it manually, then retry.\n\n{docker_log}{res.log[-800:]}"
625
639
  ),
626
640
  )
627
641
  return ExtrasInstallResult(
628
642
  ok=True, packages=list(entry.pip_extras or []),
629
- method=res.method or "vllm-venv", log=res.log,
643
+ method=res.method or "vllm-venv",
644
+ log=docker_log + (res.log or ""), serve_mode="venv",
630
645
  )
631
646
 
632
647
  if entry.isolated_venv:
@@ -784,6 +799,11 @@ async def install_engine(request: Request, name: str):
784
799
  provider_defaults[field_name] = ""
785
800
  existing["providers"][entry.vendor] = provider_defaults
786
801
 
802
+ # Persist the resolved serve_mode (docker|venv) for vLLM-serve engines so the provider
803
+ # launches the matching backend at first interaction.
804
+ if extras_result and getattr(extras_result, "serve_mode", ""):
805
+ engine_entry["settings"]["serve_mode"] = extras_result.serve_mode
806
+
787
807
  existing["engines"][entry.default_alias] = engine_entry
788
808
 
789
809
  with open(config_path, "w", encoding="utf-8") as f:
@@ -879,19 +899,37 @@ async def install_engine_stream(request: Request, name: str):
879
899
 
880
900
  async def gen():
881
901
  from openspeechapi.server.extras_installer import _installer_argv, resolve_install_targets
902
+ serve_mode_resolved = ""
882
903
  try:
883
904
  if entry.vllm_venv:
884
- from openspeechapi.local_engines.vllm_venv import create_vllm_venv
885
- yield _sse({"type": "phase", "phase": "install",
886
- "message": f"构建 vLLM-Omni 服务环境: {entry.provider}(首次较慢)"})
887
- res = await asyncio.to_thread(create_vllm_venv, repo_root, entry)
888
- for line in (res.log or "").splitlines():
889
- if line.strip():
890
- yield _sse({"type": "log", "message": line})
891
- if not res.ok:
892
- yield _sse({"type": "error", "message":
893
- f"vLLM 服务环境构建失败:{entry.name}。请查看日志后重试。"})
894
- return
905
+ from openspeechapi.local_engines.vllm_venv import (
906
+ create_vllm_venv, ensure_docker_image, resolve_serve_mode)
907
+ defaults = entry.default_settings or {}
908
+ # docker-first: prepare the official cross-arch image; fall back to a venv build.
909
+ if resolve_serve_mode(defaults.get("serve_mode", "auto")) == "docker":
910
+ image = defaults.get("docker_image", "vllm/vllm-omni:v0.22.0")
911
+ yield _sse({"type": "phase", "phase": "install",
912
+ "message": f"准备 Docker 镜像: {image}"})
913
+ ok, dlog = await asyncio.to_thread(ensure_docker_image, image)
914
+ for line in (dlog or "").splitlines():
915
+ if line.strip():
916
+ yield _sse({"type": "log", "message": line})
917
+ if ok:
918
+ serve_mode_resolved = "docker"
919
+ else:
920
+ yield _sse({"type": "log", "message": "Docker 镜像不可得 → 回退构建 venv"})
921
+ if serve_mode_resolved != "docker":
922
+ yield _sse({"type": "phase", "phase": "install",
923
+ "message": f"构建 vLLM 服务 venv: {entry.provider}(首次较慢)"})
924
+ res = await asyncio.to_thread(create_vllm_venv, repo_root, entry)
925
+ for line in (res.log or "").splitlines():
926
+ if line.strip():
927
+ yield _sse({"type": "log", "message": line})
928
+ if not res.ok:
929
+ yield _sse({"type": "error", "message":
930
+ f"vLLM 服务环境构建失败:{entry.name}。请查看日志后重试。"})
931
+ return
932
+ serve_mode_resolved = "venv"
895
933
  elif entry.isolated_venv:
896
934
  from openspeechapi.local_engines.isolated_venv import create_isolated_venv
897
935
  yield _sse({"type": "phase", "phase": "install",
@@ -939,10 +977,13 @@ async def install_engine_stream(request: Request, name: str):
939
977
  with open(config_path, encoding="utf-8") as f:
940
978
  existing = yaml.safe_load(f) or {}
941
979
  existing.setdefault("engines", {})
980
+ engine_settings = dict(entry.default_settings)
981
+ if serve_mode_resolved:
982
+ engine_settings["serve_mode"] = serve_mode_resolved
942
983
  existing["engines"][entry.default_alias] = {
943
984
  "provider": entry.provider,
944
985
  "exec_mode": entry.default_exec_mode,
945
- "settings": dict(entry.default_settings),
986
+ "settings": engine_settings,
946
987
  }
947
988
  with open(config_path, "w", encoding="utf-8") as f:
948
989
  yaml.dump(existing, f, default_flow_style=False, allow_unicode=True, sort_keys=False)
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "openspeechapi"
7
- version = "0.2.24"
7
+ version = "0.2.25"
8
8
  description = "Unified speech interface for STT/TTS providers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
File without changes