openspeechapi 0.1.0__tar.gz → 0.2.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.
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.env.example +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.github/workflows/ci.yml +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/Dockerfile +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/PKG-INFO +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/README.md +45 -45
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docker-compose.yml +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/architecture/local-engine-manager.md +5 -5
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/architecture/logging-spec.md +20 -20
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/architecture/stt-streaming-spec.md +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/architecture/webui-phase-a.md +2 -2
- openspeechapi-0.2.0/docs/engines/fish-speech-docker.md +40 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/engines/stt-native-models.md +13 -13
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/plans/2026-04-01-phase1-implementation.md +269 -269
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/plans/2026-04-11-macos-native-tts-stt.md +69 -69
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/specs/2026-04-01-openspeech-api-design.md +6 -6
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/specs/2026-04-03-hot-lazy-loading.md +9 -9
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/specs/2026-04-03-phase2-protocol-layer.md +8 -8
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/specs/2026-04-03-phase3-production.md +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/specs/2026-04-11-macos-native-tts-stt-design.md +23 -23
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/specs/2026-04-12-cloud-providers-webui-design.md +12 -12
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/specs/2026-04-15-streaming-tts-stt-fixes-display-names.md +23 -23
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/superpowers/specs/2026-04-16-provider-management-engines-rename.md +12 -12
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/examples/client_stt.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/examples/client_tts.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/examples/stt_simple.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/examples/tts_simple.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/__init__.py +14 -14
- openspeechapi-0.2.0/openspeechapi/__main__.py +5 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/cli.py +14 -14
- openspeechapi-0.2.0/openspeechapi/client/__init__.py +4 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/client/client.py +4 -4
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/config.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/core/base.py +3 -3
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/core/enums.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/core/models.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/core/registry.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/demo.py +16 -16
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/context.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/dispatcher.py +19 -19
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/executors/base.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/executors/in_process.py +4 -4
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/executors/remote.py +4 -4
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/executors/subprocess_exec.py +11 -11
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/fanout.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/filters.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/lifecycle.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/watcher.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/engine_catalog.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/exceptions.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/factory.py +40 -40
- openspeechapi-0.2.0/openspeechapi/local_engines/__init__.py +12 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/backends/docker_backend.py +3 -3
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/backends/native_backend.py +4 -4
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/base.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/engines/faster_whisper.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/engines/fish_speech.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/engines/sherpa_onnx.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/engines/whisper.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/engines/whisperlivekit.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/manager.py +7 -7
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/models.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/progress.py +1 -1
- openspeechapi-0.2.0/openspeechapi/local_engines/registry.py +19 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/task_store.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/tasks.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/logging_config.py +26 -26
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/observe/base.py +3 -3
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/observe/debug.py +11 -11
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/observe/latency.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/observe/metrics.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/observe/tracing.py +3 -3
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/observe/usage.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/_template.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/alibaba.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/assemblyai.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/azure_speech.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/baidu.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/deepgram.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/elevenlabs.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/faster_whisper.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/google_cloud.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/iflytek.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/macos_speech.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/openai.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/sherpa_onnx.py +8 -8
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/tencent.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/volcengine.py +7 -7
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/whisper.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/whisperlivekit.py +7 -7
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/windows_speech.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/alibaba.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/azure_speech.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/baidu.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/coqui.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/cosyvoice.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/deepgram.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/elevenlabs.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/fish_speech.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/google_cloud.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/iflytek.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/macos_say.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/minimax.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/openai.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/piper.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/tencent.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/volcengine.py +7 -7
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/windows_sapi.py +5 -5
- openspeechapi-0.2.0/openspeechapi/server/__init__.py +1 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/app.py +11 -11
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/middleware.py +2 -2
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/routes/management.py +12 -12
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/routes/stt.py +4 -4
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/routes/tts.py +4 -4
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/webui/index.html +3 -3
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/ws/stt_stream.py +6 -6
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/ws/tts_stream.py +5 -5
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/telemetry/__init__.py +1 -1
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/telemetry/perf.py +3 -3
- openspeechapi-0.2.0/openspeechapi/utils/__init__.py +5 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/utils/audio_converter.py +3 -3
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/utils/audio_playback.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/providers.example.yaml +18 -18
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/pyproject.toml +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/cloud/install.sh +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/macos-stt/install.sh +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/sherpa-onnx/native/run_streaming_server.py +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/conftest.py +5 -5
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/e2e/conftest.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/e2e/test_fanout_e2e.py +8 -8
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/e2e/test_faster_whisper_e2e.py +5 -5
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/e2e/test_openai_e2e.py +6 -6
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/e2e/test_webui_e2e.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/integration/test_fanout_integration.py +5 -5
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/integration/test_in_process_integration.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/integration/test_server_client.py +6 -6
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_aim_resolver.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_audio_converter.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_audio_playback.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_base.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_cli.py +5 -5
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_cli_engine.py +10 -10
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_client.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_config.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_context.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_debug_observer.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_dispatcher.py +9 -9
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_docker_backend_progress.py +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_engine_registry.py +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_enums.py +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_executor_base.py +1 -1
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_fanout.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_filters.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_hot_reload.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_in_process.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_latency_observer.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_lifecycle.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_local_engine_task_store.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_local_engines_manager.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_logging.py +20 -20
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_metrics_observer.py +5 -5
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_models.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_native_backend.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_observer_base.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_plugin_mechanism.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_cloud_providers.py +33 -33
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_elevenlabs_stt.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_macos_say.py +9 -9
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_macos_speech.py +7 -7
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_openai_base_url.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_openai_stt.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_openai_tts.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_sherpa_onnx_stt.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_stt_stubs.py +9 -9
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_tts_stubs.py +19 -19
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/test_whisperlivekit_stt.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_registry.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_remote.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_server/test_auth.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_server/test_config_api.py +2 -2
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_server/test_routes.py +4 -4
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_server/test_websocket.py +6 -6
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_subprocess.py +3 -3
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_usage_observer.py +5 -5
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_watcher.py +1 -1
- openspeechapi-0.1.0/docs/engines/fish-speech-docker.md +0 -40
- openspeechapi-0.1.0/openspeech/__main__.py +0 -5
- openspeechapi-0.1.0/openspeech/client/__init__.py +0 -4
- openspeechapi-0.1.0/openspeech/local_engines/__init__.py +0 -12
- openspeechapi-0.1.0/openspeech/local_engines/registry.py +0 -19
- openspeechapi-0.1.0/openspeech/server/__init__.py +0 -1
- openspeechapi-0.1.0/openspeech/utils/__init__.py +0 -5
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.dockerignore +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.gitignore +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/en.aiff +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/en_16k.wav +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/en_16k_pad6.wav +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/en_long.aiff +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/en_long_16k.wav +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/en_mid.aiff +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/en_mid_16k.wav +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/zh.aiff +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/audio/zh_16k.wav +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/openspeech-8600.log +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/openspeech-serve.log +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/webui-server.log +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/webui-server.pid +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/wlk12101.log +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/wlk12101.pid +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/wlk12102.log +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/.tmp/wlk12102.pid +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/AGENTS.md +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/CLAUDE.md +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/aibox-script/aibox-1.0.0-SNAPSHOT-stdout.log +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/aibox-script/aibox.2026-04-02.log +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/aibox-script/com.user.restart-jar.plist +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/aibox-script/restart-jar.sh +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/aibox-script.tar.gz +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/architecture/stt-engineering-optimization-guide.md +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/docs/engines/fish-speech-native.md +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/core/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/core/settings.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/dispatch/executors/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/engine_registry.yaml +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/aim_resolver.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/backends/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/local_engines/engines/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/observe/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/stt/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/providers/tts/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/auth.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/routes/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/routes/webui.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/webui/app.js +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/webui/styles.css +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/server/ws/__init__.py +0 -0
- {openspeechapi-0.1.0/openspeech → openspeechapi-0.2.0/openspeechapi}/vendor_registry.yaml +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/output/output.wav +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/output.wav +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/faster-whisper/native/install.sh +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/fish-speech/native/install.sh +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/macos-stt/macos_stt.swift +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/macos-stt/request_auth.swift +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/sherpa-onnx/native/install.sh +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/whisper/native/install.sh +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/scripts/engines/whisperlivekit/native/install.sh +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/__init__.py +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/e2e/__init__.py +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/fixtures/hello.wav +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/integration/__init__.py +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/__init__.py +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_providers/__init__.py +0 -0
- {openspeechapi-0.1.0 → openspeechapi-0.2.0}/tests/unit/test_server/__init__.py +0 -0
|
@@ -22,10 +22,10 @@ jobs:
|
|
|
22
22
|
run: pip install -e ".[dev]"
|
|
23
23
|
|
|
24
24
|
- name: Lint with ruff
|
|
25
|
-
run: ruff check
|
|
25
|
+
run: ruff check openspeechapi/ tests/
|
|
26
26
|
|
|
27
27
|
- name: Run unit and integration tests
|
|
28
28
|
run: pytest tests/unit tests/integration -v --tb=short
|
|
29
29
|
|
|
30
30
|
- name: Check coverage
|
|
31
|
-
run: pytest tests/unit tests/integration --cov=
|
|
31
|
+
run: pytest tests/unit tests/integration --cov=openspeechapi --cov-report=term-missing --cov-fail-under=70
|
|
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
9
9
|
|
|
10
10
|
# Copy project files
|
|
11
11
|
COPY pyproject.toml .
|
|
12
|
-
COPY
|
|
12
|
+
COPY openspeechapi/ openspeechapi/
|
|
13
13
|
COPY providers.example.yaml providers.yaml
|
|
14
14
|
|
|
15
15
|
# Install with all provider deps + server
|
|
@@ -17,4 +17,4 @@ RUN pip install --no-cache-dir -e ".[all,server]"
|
|
|
17
17
|
|
|
18
18
|
EXPOSE 8600
|
|
19
19
|
|
|
20
|
-
CMD ["
|
|
20
|
+
CMD ["openspeechapi", "serve", "--config", "providers.yaml", "--host", "0.0.0.0", "--port", "8600"]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenSpeechAPI
|
|
2
2
|
|
|
3
3
|
> Unified speech interface for STT/TTS providers — one API, multiple backends.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
OpenSpeechAPI 提供统一的语音接口,通过字符串指定 provider 即可切换不同的 STT/TTS 后端(云端 API、本地模型),无需关心底层实现。
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
|
@@ -28,13 +28,13 @@ pip install -e ".[dev]"
|
|
|
28
28
|
|
|
29
29
|
```python
|
|
30
30
|
import asyncio
|
|
31
|
-
from
|
|
31
|
+
from openspeechapi import create_provider
|
|
32
32
|
|
|
33
33
|
async def main():
|
|
34
34
|
tts = create_provider("openai-tts", api_key="sk-...")
|
|
35
35
|
await tts.start()
|
|
36
36
|
|
|
37
|
-
audio = await tts.synthesize("Hello,
|
|
37
|
+
audio = await tts.synthesize("Hello, OpenSpeechAPI!")
|
|
38
38
|
|
|
39
39
|
import wave
|
|
40
40
|
with wave.open("output.wav", "wb") as wf:
|
|
@@ -52,7 +52,7 @@ asyncio.run(main())
|
|
|
52
52
|
|
|
53
53
|
```python
|
|
54
54
|
import asyncio
|
|
55
|
-
from
|
|
55
|
+
from openspeechapi import create_provider, AudioData, AudioFormat
|
|
56
56
|
from pathlib import Path
|
|
57
57
|
|
|
58
58
|
async def main():
|
|
@@ -64,7 +64,7 @@ async def main():
|
|
|
64
64
|
sample_rate=16000, channels=1, format=AudioFormat.WAV,
|
|
65
65
|
)
|
|
66
66
|
result = await stt.transcribe(audio)
|
|
67
|
-
print(result.text) # "Hello,
|
|
67
|
+
print(result.text) # "Hello, OpenSpeechAPI!"
|
|
68
68
|
print(result.language) # "en"
|
|
69
69
|
print(result.confidence) # 0.98
|
|
70
70
|
|
|
@@ -96,7 +96,7 @@ open scripts/engines/macos-stt/MacOSSTTHelper.app
|
|
|
96
96
|
# 系统设置 > 键盘 > 听写 > 下载所需语言模型(中文/英文等)
|
|
97
97
|
|
|
98
98
|
# 6. 启动服务和 WebUI
|
|
99
|
-
python -m
|
|
99
|
+
python -m openspeechapi.cli --config providers.yaml serve
|
|
100
100
|
|
|
101
101
|
# 7. 浏览器打开 http://127.0.0.1:8600/ui/
|
|
102
102
|
# - TTS:选择 macos_tts → 选择发音人(如 Tingting)→ 输入文本 → Run TTS
|
|
@@ -111,22 +111,22 @@ python -m openspeech.cli --config providers.yaml serve
|
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
113
|
# TTS:文本 → 语音
|
|
114
|
-
python -m
|
|
114
|
+
python -m openspeechapi.demo tts -t "Hello world" -o output.wav
|
|
115
115
|
|
|
116
116
|
# STT:语音 → 文本
|
|
117
|
-
python -m
|
|
117
|
+
python -m openspeechapi.demo stt -i output.wav -p faster-whisper
|
|
118
118
|
|
|
119
119
|
# Roundtrip:文本 → TTS → STT → 文本
|
|
120
|
-
python -m
|
|
120
|
+
python -m openspeechapi.demo roundtrip -t "Hello world"
|
|
121
121
|
|
|
122
122
|
# Compare:多引擎对比
|
|
123
|
-
python -m
|
|
123
|
+
python -m openspeechapi.demo compare -i output.wav -p openai,faster-whisper
|
|
124
124
|
|
|
125
125
|
# REPL:交互模式
|
|
126
|
-
python -m
|
|
126
|
+
python -m openspeechapi.demo repl
|
|
127
127
|
|
|
128
128
|
# WebUI(Phase A)
|
|
129
|
-
python -m
|
|
129
|
+
python -m openspeechapi.cli serve --host 0.0.0.0 --port 8600
|
|
130
130
|
# 浏览器打开 http://127.0.0.1:8600/ui
|
|
131
131
|
|
|
132
132
|
# 实时 STT:优先使用 WebSocket PCM 流式(/v1/stt/stream),
|
|
@@ -137,23 +137,23 @@ python -m openspeech.cli serve --host 0.0.0.0 --port 8600
|
|
|
137
137
|
|
|
138
138
|
```bash
|
|
139
139
|
# 1) 下载/更新运行镜像
|
|
140
|
-
python -m
|
|
140
|
+
python -m openspeechapi.cli engine install --name fish-speech --runtime docker --follow
|
|
141
141
|
|
|
142
142
|
# 2) 启动本地引擎(含健康检查)
|
|
143
|
-
python -m
|
|
143
|
+
python -m openspeechapi.cli engine start --name fish-speech --runtime docker --follow
|
|
144
144
|
|
|
145
145
|
# 3) 查看运行状态/日志
|
|
146
|
-
python -m
|
|
147
|
-
python -m
|
|
146
|
+
python -m openspeechapi.cli engine status --name fish-speech --runtime docker
|
|
147
|
+
python -m openspeechapi.cli engine logs --name fish-speech --runtime docker --lines 200
|
|
148
148
|
|
|
149
149
|
# 4) 停止
|
|
150
|
-
python -m
|
|
150
|
+
python -m openspeechapi.cli engine stop --name fish-speech --runtime docker --follow
|
|
151
151
|
|
|
152
152
|
# 5) 跨进程查询任务
|
|
153
|
-
python -m
|
|
154
|
-
python -m
|
|
155
|
-
python -m
|
|
156
|
-
python -m
|
|
153
|
+
python -m openspeechapi.cli engine task list --name fish-speech --limit 20
|
|
154
|
+
python -m openspeechapi.cli engine task status --task-id <TASK_ID>
|
|
155
|
+
python -m openspeechapi.cli engine task follow --task-id <TASK_ID>
|
|
156
|
+
python -m openspeechapi.cli engine task cancel --task-id <TASK_ID>
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
进度反馈会显示 task id、阶段、百分比和当前消息,便于追踪长耗时任务。
|
|
@@ -162,14 +162,14 @@ python -m openspeech.cli engine task cancel --task-id <TASK_ID>
|
|
|
162
162
|
|
|
163
163
|
```bash
|
|
164
164
|
# faster-whisper 模型资产(native,无常驻服务)
|
|
165
|
-
python -m
|
|
166
|
-
python -m
|
|
167
|
-
python -m
|
|
165
|
+
python -m openspeechapi.cli engine install --name faster-whisper --runtime native --follow
|
|
166
|
+
python -m openspeechapi.cli engine start --name faster-whisper --runtime native --follow
|
|
167
|
+
python -m openspeechapi.cli engine status --name faster-whisper --runtime native
|
|
168
168
|
|
|
169
169
|
# whisper 模型资产(native,无常驻服务)
|
|
170
|
-
python -m
|
|
171
|
-
python -m
|
|
172
|
-
python -m
|
|
170
|
+
python -m openspeechapi.cli engine install --name whisper --runtime native --follow
|
|
171
|
+
python -m openspeechapi.cli engine start --name whisper --runtime native --follow
|
|
172
|
+
python -m openspeechapi.cli engine status --name whisper --runtime native
|
|
173
173
|
```
|
|
174
174
|
|
|
175
175
|
说明:安装会优先读取 `~/.aim/config.json + ~/.aim/registry.json` 的 provision 信息来定位模型;若 AIM 未命中,再回退默认本地路径候选。若仍未找到,可按配置走“模拟下载”流程以验证安装进度。
|
|
@@ -178,10 +178,10 @@ python -m openspeech.cli engine status --name whisper --runtime native
|
|
|
178
178
|
|
|
179
179
|
```bash
|
|
180
180
|
# 合成后直接播放
|
|
181
|
-
python -m
|
|
181
|
+
python -m openspeechapi.demo tts -t "Hello world" --play
|
|
182
182
|
|
|
183
183
|
# 指定播放参数
|
|
184
|
-
python -m
|
|
184
|
+
python -m openspeechapi.demo tts -t "Hello world" --play \
|
|
185
185
|
--play-backend sounddevice --play-device 2 --play-volume 0.8
|
|
186
186
|
```
|
|
187
187
|
|
|
@@ -213,7 +213,7 @@ python -m openspeech.demo tts -t "Hello world" --play \
|
|
|
213
213
|
### 查看所有 provider
|
|
214
214
|
|
|
215
215
|
```python
|
|
216
|
-
from
|
|
216
|
+
from openspeechapi import list_providers
|
|
217
217
|
print(list_providers())
|
|
218
218
|
# ['coqui', 'cosyvoice', 'deepgram', 'elevenlabs', 'faster-whisper',
|
|
219
219
|
# 'fish-speech', 'minimax', 'openai-stt', 'openai-tts', 'piper', 'whisper',
|
|
@@ -234,7 +234,7 @@ create_provider("openai-stt",
|
|
|
234
234
|
转录选项通过 `STTOptions` 传入:
|
|
235
235
|
|
|
236
236
|
```python
|
|
237
|
-
from
|
|
237
|
+
from openspeechapi import STTOptions
|
|
238
238
|
result = await stt.transcribe(audio, STTOptions(
|
|
239
239
|
language="zh", # 语言提示
|
|
240
240
|
prompt="技术会议记录", # 上下文提示
|
|
@@ -268,7 +268,7 @@ create_provider("openai-tts",
|
|
|
268
268
|
合成选项通过 `TTSOptions` 传入:
|
|
269
269
|
|
|
270
270
|
```python
|
|
271
|
-
from
|
|
271
|
+
from openspeechapi import TTSOptions
|
|
272
272
|
audio = await tts.synthesize("Hello", TTSOptions(
|
|
273
273
|
voice="nova", # 覆盖默认声音
|
|
274
274
|
speed=1.2, # 语速倍率
|
|
@@ -390,13 +390,13 @@ create_provider("macos-stt",
|
|
|
390
390
|
### 启动服务
|
|
391
391
|
|
|
392
392
|
```bash
|
|
393
|
-
|
|
393
|
+
openspeechapi serve --config providers.yaml --port 8600
|
|
394
394
|
```
|
|
395
395
|
|
|
396
396
|
### Python Client(与 Library 模式接口一致)
|
|
397
397
|
|
|
398
398
|
```python
|
|
399
|
-
from
|
|
399
|
+
from openspeechapi import Client
|
|
400
400
|
|
|
401
401
|
async with Client("http://localhost:8600") as c:
|
|
402
402
|
# STT
|
|
@@ -459,9 +459,9 @@ providers:
|
|
|
459
459
|
- `in_process`:预留给真正进程内推理(兼容旧配置,建议迁移)
|
|
460
460
|
|
|
461
461
|
```python
|
|
462
|
-
from
|
|
463
|
-
from
|
|
464
|
-
from
|
|
462
|
+
from openspeechapi import ServiceDispatcher, ProviderRegistry
|
|
463
|
+
from openspeechapi.providers.stt.openai import OpenAISTT
|
|
464
|
+
from openspeechapi.providers.stt.faster_whisper import FasterWhisperSTT
|
|
465
465
|
|
|
466
466
|
registry = ProviderRegistry()
|
|
467
467
|
registry.register("openai-stt", OpenAISTT)
|
|
@@ -477,7 +477,7 @@ await dispatcher.stop()
|
|
|
477
477
|
### FanOut — 多引擎并发
|
|
478
478
|
|
|
479
479
|
```python
|
|
480
|
-
from
|
|
480
|
+
from openspeechapi.dispatch.fanout import FirstCompleted, CollectAll
|
|
481
481
|
|
|
482
482
|
# 取最快返回的结果
|
|
483
483
|
result = await dispatcher.stt.fanout(
|
|
@@ -511,8 +511,8 @@ providers:
|
|
|
511
511
|
### Observers(可观测性)
|
|
512
512
|
|
|
513
513
|
```python
|
|
514
|
-
from
|
|
515
|
-
from
|
|
514
|
+
from openspeechapi.observe.metrics import MetricsObserver
|
|
515
|
+
from openspeechapi.observe.debug import DebugLogObserver
|
|
516
516
|
|
|
517
517
|
dispatcher.add_observer(MetricsObserver()) # TTFB、耗时、吞吐
|
|
518
518
|
dispatcher.add_observer(DebugLogObserver()) # 详细日志
|
|
@@ -534,7 +534,7 @@ AudioFormat: PCM_16K | PCM_44K | WAV | AIFF | MP3 | OGG | FLAC | OPUS
|
|
|
534
534
|
## 项目结构
|
|
535
535
|
|
|
536
536
|
```
|
|
537
|
-
|
|
537
|
+
openspeechapi/
|
|
538
538
|
core/ # L1: Provider 抽象层(models, enums, base, registry)
|
|
539
539
|
providers/ # Provider 适配器(stt/ 5个含macos, tts/ 8个含macos)
|
|
540
540
|
utils/ # 工具模块(audio_converter, audio_playback)
|
|
@@ -544,7 +544,7 @@ openspeech/
|
|
|
544
544
|
client/ # Python 薄客户端
|
|
545
545
|
factory.py # create_provider() 工厂函数
|
|
546
546
|
config.py # YAML 配置加载
|
|
547
|
-
cli.py #
|
|
547
|
+
cli.py # openspeechapi list / check / serve
|
|
548
548
|
demo.py # 交互式 demo CLI
|
|
549
549
|
examples/ # 示例脚本(Library 模式 + Client 模式)
|
|
550
550
|
tests/ # 332 tests(unit + integration + E2E)
|
|
@@ -575,12 +575,12 @@ docker-compose up -d
|
|
|
575
575
|
# 查看日志
|
|
576
576
|
docker-compose logs -f
|
|
577
577
|
|
|
578
|
-
# GPU 支持(编辑 docker-compose.yml 取消注释
|
|
578
|
+
# GPU 支持(编辑 docker-compose.yml 取消注释 openspeechapi-gpu 服务)
|
|
579
579
|
```
|
|
580
580
|
|
|
581
581
|
**直接启动:**
|
|
582
582
|
```bash
|
|
583
|
-
|
|
583
|
+
openspeechapi serve --config providers.yaml --port 8600
|
|
584
584
|
```
|
|
585
585
|
|
|
586
586
|
## 认证
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
version: "3.8"
|
|
2
2
|
|
|
3
3
|
services:
|
|
4
|
-
|
|
4
|
+
openspeechapi:
|
|
5
5
|
build: .
|
|
6
6
|
ports:
|
|
7
7
|
- "8600:8600"
|
|
@@ -12,7 +12,7 @@ services:
|
|
|
12
12
|
restart: unless-stopped
|
|
13
13
|
|
|
14
14
|
# GPU variant (uncomment for local models like faster-whisper, cosyvoice)
|
|
15
|
-
#
|
|
15
|
+
# openspeechapi-gpu:
|
|
16
16
|
# build: .
|
|
17
17
|
# ports:
|
|
18
18
|
# - "8600:8600"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Local Engine Manager (M1)
|
|
2
2
|
|
|
3
|
-
`
|
|
3
|
+
`openspeechapi.local_engines` is an engine-runtime layer separated from provider adapters.
|
|
4
4
|
|
|
5
5
|
## Goals
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- Engine: `fish-speech`
|
|
14
14
|
- Runtime backend: `docker` and `native` (both implemented)
|
|
15
15
|
- Actions: `install`, `update`, `start`, `stop`, `status`, `logs`
|
|
16
|
-
- Persisted tasks: saved under `~/.
|
|
16
|
+
- Persisted tasks: saved under `~/.openspeechapi/engine_tasks/*.json`
|
|
17
17
|
|
|
18
18
|
## Progress model
|
|
19
19
|
|
|
@@ -30,14 +30,14 @@ Long-running actions emit structured progress events:
|
|
|
30
30
|
CLI can stream updates in real time:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
|
|
33
|
+
openspeechapi engine install --name fish-speech --runtime docker --follow
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
Task history is queryable across processes:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
openspeechapi engine task list --name fish-speech
|
|
40
|
+
openspeechapi engine task status --task-id <TASK_ID>
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## HTTP endpoints (for future WebUI)
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
### 命令行
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
|
|
52
|
+
openspeechapi --log-level INFO --log-format json --log-dir logs --log-perf basic serve
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
| 参数 | 环境变量 | 默认值 | 说明 |
|
|
@@ -62,7 +62,7 @@ openspeech --log-level INFO --log-format json --log-dir logs --log-perf basic se
|
|
|
62
62
|
### 程序化
|
|
63
63
|
|
|
64
64
|
```python
|
|
65
|
-
from
|
|
65
|
+
from openspeechapi import configure_logging, bind_context, milestone, Event, PerfTimer
|
|
66
66
|
|
|
67
67
|
configure_logging(level="INFO", format="json", log_dir="logs", perf="verbose")
|
|
68
68
|
|
|
@@ -73,7 +73,7 @@ with bind_context(request_id="abc123", provider="faster-whisper"):
|
|
|
73
73
|
|
|
74
74
|
### 文件输出
|
|
75
75
|
|
|
76
|
-
- 位置:`<log_dir>/
|
|
76
|
+
- 位置:`<log_dir>/openspeechapi.jsonl`(默认 `logs/openspeechapi.jsonl`)
|
|
77
77
|
- 轮转:单文件 50 MB,保留 14 天(参数可配置)。
|
|
78
78
|
- 写入:每条一行 JSON(`\n` 结尾),异步 enqueue 落盘,不阻塞事件循环。
|
|
79
79
|
|
|
@@ -85,7 +85,7 @@ with bind_context(request_id="abc123", provider="faster-whisper"):
|
|
|
85
85
|
|
|
86
86
|
```python
|
|
87
87
|
from loguru import logger
|
|
88
|
-
from
|
|
88
|
+
from openspeechapi import (
|
|
89
89
|
integrate_with_host,
|
|
90
90
|
openspeech_filter,
|
|
91
91
|
openspeech_level_filter,
|
|
@@ -94,40 +94,40 @@ from openspeech import (
|
|
|
94
94
|
# 1. 宿主先配置自己的 sink(正常做法)
|
|
95
95
|
logger.add("wallex.log", format="{time} | {level} | [{extra[component]}] {message}")
|
|
96
96
|
|
|
97
|
-
# 2. 一行完成集成:给
|
|
98
|
-
integrate_with_host(tag="
|
|
97
|
+
# 2. 一行完成集成:给 OpenSpeechAPI 记录打 tag、设独立级别
|
|
98
|
+
integrate_with_host(tag="openspeechapi", level="DEBUG", perf="verbose")
|
|
99
99
|
|
|
100
|
-
# 之后
|
|
101
|
-
# 且带 record.extra["component"] == "
|
|
100
|
+
# 之后 OpenSpeechAPI 的 logger.info(...) 会自动走宿主的 sink,
|
|
101
|
+
# 且带 record.extra["component"] == "openspeechapi"
|
|
102
102
|
|
|
103
|
-
# 可选:给一条 sink 单独限定
|
|
103
|
+
# 可选:给一条 sink 单独限定 openspeechapi 的级别
|
|
104
104
|
logger.add("wallex.log", filter=openspeech_level_filter("WARNING"))
|
|
105
105
|
|
|
106
|
-
# 可选:把
|
|
107
|
-
logger.add("
|
|
106
|
+
# 可选:把 openspeechapi 日志分离到独立文件
|
|
107
|
+
logger.add("openspeechapi.log", filter=openspeech_filter)
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
`integrate_with_host` 参数:
|
|
111
111
|
|
|
112
112
|
| 参数 | 说明 |
|
|
113
113
|
| --- | --- |
|
|
114
|
-
| `tag` | `record.extra["component"]` 的值;默认 `"
|
|
115
|
-
| `level` | **仅对
|
|
114
|
+
| `tag` | `record.extra["component"]` 的值;默认 `"openspeechapi"` |
|
|
115
|
+
| `level` | **仅对 OpenSpeechAPI 记录**生效的最低级别(通过 filter 实现) |
|
|
116
116
|
| `perf` | 性能里程碑详细度(`off` / `basic` / `verbose`),独立于宿主日志级别 |
|
|
117
|
-
| `attach_sinks` | 默认 `False` —
|
|
117
|
+
| `attach_sinks` | 默认 `False` — OpenSpeechAPI 把 sink 完全让给宿主;`True` 保留自带的 console/JSONL sink(罕用) |
|
|
118
118
|
|
|
119
119
|
辅助函数:
|
|
120
120
|
|
|
121
|
-
- `openspeech_filter(record) -> bool`:判断是否为
|
|
121
|
+
- `openspeech_filter(record) -> bool`:判断是否为 OpenSpeechAPI 记录。
|
|
122
122
|
- `openspeech_level_filter(min_level)`:返回一个 loguru sink filter,对
|
|
123
|
-
|
|
123
|
+
OpenSpeechAPI 记录应用单独的最低级别,其他来源记录不受影响。
|
|
124
124
|
- `get_integration_tag()` / `is_host_managed()`:查询当前集成状态。
|
|
125
125
|
|
|
126
126
|
语义保证:
|
|
127
127
|
|
|
128
128
|
- `integrate_with_host()` **绝不**调用 `logger.remove()`;宿主已有的 sink
|
|
129
129
|
不会被误删。
|
|
130
|
-
- 之后调用 `create_app()` 或任何
|
|
130
|
+
- 之后调用 `create_app()` 或任何 openspeechapi API 不会再注册 OpenSpeechAPI 自己
|
|
131
131
|
的 sink(`ensure_configured()` 在 `host_managed=True` 时是 no-op)。
|
|
132
132
|
- `tag` 可在运行时通过再次调用 `integrate_with_host(tag="...")` 更新。
|
|
133
133
|
- **宿主的 sink 格式字符串**请使用 `{extra[component]}` 读取 tag;注意
|
|
@@ -137,7 +137,7 @@ logger.add("openspeech.log", filter=openspeech_filter)
|
|
|
137
137
|
|
|
138
138
|
## 4. 事件枚举(`Event`)
|
|
139
139
|
|
|
140
|
-
下表即 `
|
|
140
|
+
下表即 `openspeechapi.telemetry.perf.Event` 全量值。命名原则:`<layer>.<phase>`;
|
|
141
141
|
一旦发布就不允许重命名,只允许新增。
|
|
142
142
|
|
|
143
143
|
### 4.1 HTTP 层(中间件)
|
|
@@ -199,7 +199,7 @@ logger.add("openspeech.log", filter=openspeech_filter)
|
|
|
199
199
|
- **优先字段**:使用 `event` + `elapsed_ms` + `request_id` 即可复现完整
|
|
200
200
|
调用时序。
|
|
201
201
|
- **检索模板**:
|
|
202
|
-
- 单请求全链路:`grep '"request_id":"abc123"'
|
|
202
|
+
- 单请求全链路:`grep '"request_id":"abc123"' openspeechapi.jsonl`
|
|
203
203
|
- TTFB 分析:`jq 'select(.event=="ws.first_response") | .elapsed_ms'`
|
|
204
204
|
- Provider 冷启动耗时:`jq 'select(.event=="lifecycle.provider_init") | {provider, elapsed_ms}'`
|
|
205
205
|
- **错误聚类**:`select(.level=="ERROR" and .exception)` 过滤,再按
|
|
@@ -210,7 +210,7 @@ logger.add("openspeech.log", filter=openspeech_filter)
|
|
|
210
210
|
## 6. 贡献规范
|
|
211
211
|
|
|
212
212
|
1. 新增 `Event` 条目必须:
|
|
213
|
-
- 在 `
|
|
213
|
+
- 在 `openspeechapi/telemetry/perf.py` 的 `Event` 枚举中新增;
|
|
214
214
|
- 在本文件 4.x 节中补充一行描述(级别 + payload 字段);
|
|
215
215
|
- 在发布之前写入单测或集成测试验证。
|
|
216
216
|
2. 不允许同名事件改变含义;必须保证字段向后兼容。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# WebUI Phase A
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
OpenSpeechAPI now includes a built-in WebUI at `/ui` for:
|
|
4
4
|
|
|
5
5
|
- Capability Lab: STT and TTS test operations from browser
|
|
6
6
|
- Engine Manager: install/update/start/stop local engines with live task progress
|
|
@@ -9,7 +9,7 @@ OpenSpeech now includes a built-in WebUI at `/ui` for:
|
|
|
9
9
|
## How to run
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
python -m
|
|
12
|
+
python -m openspeechapi.cli serve --host 0.0.0.0 --port 8600
|
|
13
13
|
# open http://127.0.0.1:8600/ui
|
|
14
14
|
```
|
|
15
15
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Fish-Speech Docker Runtime
|
|
2
|
+
|
|
3
|
+
## Install image
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
openspeechapi engine install --name fish-speech --runtime docker --follow
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Start service
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
openspeechapi engine start --name fish-speech --runtime docker --follow
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
By default this starts container `openspeechapi-fish-speech` and exposes port `8080`.
|
|
16
|
+
|
|
17
|
+
## Check status
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
openspeechapi engine status --name fish-speech --runtime docker
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Show logs
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
openspeechapi engine logs --name fish-speech --runtime docker --lines 200
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Stop service
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
openspeechapi engine stop --name fish-speech --runtime docker --follow
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Optional overrides
|
|
36
|
+
|
|
37
|
+
- `--image` to choose a custom image
|
|
38
|
+
- `--container-name` to avoid conflicts
|
|
39
|
+
- `--host-port` to change exposed host port
|
|
40
|
+
- `--health-url` if your image uses a non-default health endpoint
|
|
@@ -13,24 +13,24 @@ This project now supports native STT local engines:
|
|
|
13
13
|
## Commands
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
openspeechapi engine install --name faster-whisper --runtime native --follow
|
|
17
|
+
openspeechapi engine start --name faster-whisper --runtime native --follow
|
|
18
|
+
openspeechapi engine status --name faster-whisper --runtime native
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
openspeechapi engine install --name whisper --runtime native --follow
|
|
21
|
+
openspeechapi engine start --name whisper --runtime native --follow
|
|
22
|
+
openspeechapi engine status --name whisper --runtime native
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
openspeechapi engine install --name whisperlivekit --runtime native --follow
|
|
25
|
+
openspeechapi engine start --name whisperlivekit --runtime native --follow
|
|
26
|
+
openspeechapi engine status --name whisperlivekit --runtime native
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
openspeechapi engine install --name sherpa-onnx --runtime native --follow
|
|
29
|
+
openspeechapi engine start --name sherpa-onnx --runtime native --follow
|
|
30
|
+
openspeechapi engine status --name sherpa-onnx --runtime native
|
|
31
31
|
|
|
32
32
|
# install with a real model repo download (instead of simulation)
|
|
33
|
-
|
|
33
|
+
openspeechapi engine install \
|
|
34
34
|
--name sherpa-onnx \
|
|
35
35
|
--runtime native \
|
|
36
36
|
--model-repo k2-fsa/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 \
|