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.
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/PKG-INFO +1 -1
- openspeechapi-0.2.25/openspeechapi/local_engines/vllm_gb10_patch.py +100 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/vllm_venv.py +44 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/qwen3_omni_stt.py +144 -22
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/extras_installer.py +2 -1
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/management.py +57 -16
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/pyproject.toml +1 -1
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/.gitignore +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/README.md +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/__main__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/cli.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/client/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/client/client.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/config.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/base.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/enums.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/model_hub.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/models.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/registry.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/core/settings.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/demo.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/aim_provision.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/context.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/dispatcher.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/base.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/in_process.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/remote.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/subprocess_exec.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/fanout.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/filters.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/lifecycle.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/watcher.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/engine_catalog.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/engine_registry.yaml +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/exceptions.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/factory.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/aim_resolver.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/docker_backend.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/native_backend.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/base.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/faster_whisper.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/fish_speech.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/sherpa_onnx.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/whisper.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/whisperlivekit.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/isolated_venv.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/manager.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/models.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/progress.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/registry.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/task_store.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/tasks.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/logging_config.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/base.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/debug.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/latency.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/metrics.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/tracing.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/observe/usage.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/_template.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/_local_audio.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/alibaba.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/assemblyai.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/azure_speech.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/baidu.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/canary_qwen_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/deepgram.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/dolphin_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/elevenlabs.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/faster_whisper.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/fireredasr_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/funasr_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/gemma4.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/google_cloud.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/iflytek.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/kimi_audio_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/macos_speech.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/mlx_whisper_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/mms_languages.json +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/mms_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/moonshine_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/openai.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/paraformer.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/parakeet_mlx_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/phi4_multimodal_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/qwen3_asr.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/sensevoice.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/sherpa_onnx.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/tencent.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/volcengine.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/vosk_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/voxtral_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/wenet_stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/whisper.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/whisperlivekit.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/windows_speech.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/alibaba.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/azure_speech.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/baidu.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/coqui.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/cosyvoice.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/deepgram.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/elevenlabs.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/fish_speech.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/google_cloud.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/iflytek.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/macos_say.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/minimax.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/openai.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/piper.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/tencent.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/volcengine.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/tts/windows_sapi.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/app.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/auth.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/middleware.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/model_downloads.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/native_installer.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/stt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/tts.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/routes/webui.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/system_metrics.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/webui/app.js +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/webui/index.html +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/webui/styles.css +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/ws/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/ws/stt_stream.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/server/ws/tts_stream.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/telemetry/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/telemetry/perf.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/utils/__init__.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/utils/audio_converter.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/utils/audio_playback.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/vendor_registry.yaml +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/providers.example.yaml +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/aim_adopt.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/aim_consumers.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/cloud/install.sh +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/faster-whisper/native/install.sh +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/fish-speech/native/install.sh +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/macos-stt/_bundle.sh +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/macos-stt/install.sh +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/macos-stt/macos_stt.swift +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/macos-stt/request_auth.swift +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/sherpa-onnx/native/install.sh +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/sherpa-onnx/native/run_streaming_server.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/whisper/native/install.sh +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/whisperlivekit/native/install.sh +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/gen_mms_languages.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/preload_stt_model.py +0 -0
- {openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/release.sh +0 -0
|
@@ -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
|
|
301
|
-
ready.
|
|
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 ({}).
|
|
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
|
|
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
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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
|
|
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
|
|
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
|
|
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",
|
|
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
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
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":
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/in_process.py
RENAMED
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/dispatch/executors/subprocess_exec.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/__init__.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/docker_backend.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/backends/native_backend.py
RENAMED
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/__init__.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/faster_whisper.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/fish_speech.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/sherpa_onnx.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/whisper.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/local_engines/engines/whisperlivekit.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/canary_qwen_stt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/mlx_whisper_stt.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/mms_languages.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/parakeet_mlx_stt.py
RENAMED
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/openspeechapi/providers/stt/phi4_multimodal_stt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/faster-whisper/native/install.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openspeechapi-0.2.24 → openspeechapi-0.2.25}/scripts/engines/whisperlivekit/native/install.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|