nuwax-deploy-installer 0.2.2 → 0.2.3-beta.2
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.
- package/README.md +19 -8
- package/package.json +1 -1
- package/vendor/darwin-arm64/deploy-installer +0 -0
- package/vendor/darwin-arm64/document-parser +0 -0
- package/vendor/darwin-arm64/libonnxruntime.1.24.4.dylib +0 -0
- package/vendor/darwin-arm64/libonnxruntime.dylib +0 -0
- package/vendor/darwin-arm64/libsherpa-onnx-c-api.dylib +0 -0
- package/vendor/darwin-arm64/voice-cli +0 -0
- package/vendor/templates/document-parser/com.nuwax.document-parser.plist +4 -1
- package/vendor/templates/manifest.json +10 -1
- package/vendor/templates/voice-cli/com.nuwax.voice-cli.plist +40 -0
- package/vendor/templates/voice-cli/config.example.yml +119 -0
- package/vendor/templates/document-parser/run-server.sh +0 -16
package/README.md
CHANGED
|
@@ -5,21 +5,32 @@ Unified deployment CLI for nuwax services. **Binaries are bundled inside this np
|
|
|
5
5
|
## Quick start (Mac Apple Silicon)
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install -g nuwax-deploy-installer
|
|
9
|
-
deploy-installer
|
|
8
|
+
npm install -g nuwax-deploy-installer@beta
|
|
9
|
+
deploy-installer doctor
|
|
10
|
+
deploy-installer voice-cli install
|
|
11
|
+
deploy-installer document-parser install # 需 OSS_ACCESS_KEY_ID / SECRET
|
|
10
12
|
```
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
完整步骤:[mac-mini-quickstart.md](../../crates/deploy-installer/doc/mac-mini-quickstart.md)
|
|
13
15
|
|
|
14
16
|
## Commands
|
|
15
17
|
|
|
16
18
|
```bash
|
|
17
19
|
deploy-installer doctor
|
|
18
|
-
deploy-installer
|
|
19
|
-
deploy-installer document-parser install
|
|
20
|
-
deploy-installer
|
|
20
|
+
deploy-installer voice-cli install
|
|
21
|
+
deploy-installer document-parser install
|
|
22
|
+
deploy-installer voice-cli service status
|
|
23
|
+
deploy-installer document-parser service status
|
|
21
24
|
```
|
|
22
25
|
|
|
23
|
-
##
|
|
26
|
+
## Docs
|
|
27
|
+
|
|
28
|
+
| 文档 | 说明 |
|
|
29
|
+
|------|------|
|
|
30
|
+
| [mac-mini-quickstart.md](../../crates/deploy-installer/doc/mac-mini-quickstart.md) | Mac 部署与运维 |
|
|
31
|
+
| [MAINTAINER.md](../../crates/deploy-installer/doc/MAINTAINER.md) | 发布、OSS、Linux CUDA |
|
|
32
|
+
|
|
33
|
+
## Supported platforms
|
|
24
34
|
|
|
25
|
-
- macOS Apple Silicon (`darwin-arm64`)
|
|
35
|
+
- macOS Apple Silicon (`darwin-arm64`) — npm vendor + LaunchAgent
|
|
36
|
+
- Linux x86_64 + NVIDIA — OSS CUDA bundle + systemd(见 MAINTAINER.md)
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
<string>__INSTALL_DIR__</string>
|
|
9
9
|
<key>ProgramArguments</key>
|
|
10
10
|
<array>
|
|
11
|
-
<string>__INSTALL_DIR__/
|
|
11
|
+
<string>__INSTALL_DIR__/document-parser</string>
|
|
12
|
+
<string>--config</string>
|
|
13
|
+
<string>__INSTALL_DIR__/config.yml</string>
|
|
14
|
+
<string>server</string>
|
|
12
15
|
</array>
|
|
13
16
|
<key>EnvironmentVariables</key>
|
|
14
17
|
<dict>
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.2",
|
|
2
|
+
"version": "0.2.3-beta.2",
|
|
3
3
|
"optionalAssets": {
|
|
4
4
|
"venv": {
|
|
5
5
|
"darwin-arm64": "https://nuwa-packages.oss-rg-china-mainland.aliyuncs.com/uploads/document-parser/venv-macos-arm64-{version}.tar.gz"
|
|
6
|
+
},
|
|
7
|
+
"whisperLargeV3": {
|
|
8
|
+
"darwin-arm64": "https://nuwa-packages.oss-rg-china-mainland.aliyuncs.com/uploads/voice-cli/whisper-ggml-large-v3-{version}.tar.gz"
|
|
9
|
+
},
|
|
10
|
+
"whisperAll": {
|
|
11
|
+
"darwin-arm64": "https://nuwa-packages.oss-rg-china-mainland.aliyuncs.com/uploads/voice-cli/whisper-ggml-all-{version}.tar.gz"
|
|
12
|
+
},
|
|
13
|
+
"voiceCliCuda": {
|
|
14
|
+
"linux-x64": "https://nuwa-packages.oss-rg-china-mainland.aliyuncs.com/uploads/voice-cli/voice-cli-cuda-linux-x64-{version}.tar.gz"
|
|
6
15
|
}
|
|
7
16
|
}
|
|
8
17
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>Label</key>
|
|
6
|
+
<string>com.nuwax.voice-cli</string>
|
|
7
|
+
<key>WorkingDirectory</key>
|
|
8
|
+
<string>__INSTALL_DIR__</string>
|
|
9
|
+
<key>ProgramArguments</key>
|
|
10
|
+
<array>
|
|
11
|
+
<string>__INSTALL_DIR__/voice-cli</string>
|
|
12
|
+
<string>server</string>
|
|
13
|
+
<string>run</string>
|
|
14
|
+
<string>--config</string>
|
|
15
|
+
<string>__INSTALL_DIR__/config.yml</string>
|
|
16
|
+
</array>
|
|
17
|
+
<key>EnvironmentVariables</key>
|
|
18
|
+
<dict>
|
|
19
|
+
<key>PATH</key>
|
|
20
|
+
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
|
|
21
|
+
<key>HOME</key>
|
|
22
|
+
<string>__HOME__</string>
|
|
23
|
+
<key>TMPDIR</key>
|
|
24
|
+
<string>/tmp</string>
|
|
25
|
+
<key>RUST_LOG</key>
|
|
26
|
+
<string>info</string>
|
|
27
|
+
</dict>
|
|
28
|
+
<key>RunAtLoad</key>
|
|
29
|
+
<true/>
|
|
30
|
+
<key>KeepAlive</key>
|
|
31
|
+
<dict>
|
|
32
|
+
<key>SuccessfulExit</key>
|
|
33
|
+
<false/>
|
|
34
|
+
</dict>
|
|
35
|
+
<key>StandardOutPath</key>
|
|
36
|
+
<string>__INSTALL_DIR__/logs/launchd.stdout.log</string>
|
|
37
|
+
<key>StandardErrorPath</key>
|
|
38
|
+
<string>__INSTALL_DIR__/logs/launchd.stderr.log</string>
|
|
39
|
+
</dict>
|
|
40
|
+
</plist>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Voice CLI 配置模板(纯 Rust:STT transcribe-rs + TTS sherpa-onnx Kokoro)
|
|
2
|
+
# 部署时复制为 config.yml,按需修改 server.port / whisper.default_model / tts.enabled
|
|
3
|
+
# 启动必须用 `voice-cli server run --config config.yml`(--config 在 server run 后,全局 -c 在 server run 时被代码忽略)
|
|
4
|
+
# 字段权威源: src/models/config.rs + docs/DEPLOYMENT.md §5
|
|
5
|
+
|
|
6
|
+
server:
|
|
7
|
+
host: "0.0.0.0"
|
|
8
|
+
port: 8077 # ← 监听端口
|
|
9
|
+
max_file_size: 209715200 # 200MB 上传上限
|
|
10
|
+
cors_enabled: true
|
|
11
|
+
|
|
12
|
+
whisper:
|
|
13
|
+
default_model: "base" # 默认转写模型(CPU 用 base/tiny 加速;Metal/CUDA 可 large-v3)
|
|
14
|
+
models_dir: "./models"
|
|
15
|
+
auto_download: false # 建议 false(联网受限),模型手动放好
|
|
16
|
+
supported_models: ["tiny", "base", "small", "medium", "large-v3"]
|
|
17
|
+
audio_processing:
|
|
18
|
+
supported_formats: ["mp3", "wav", "flac", "m4a", "ogg", "aac", "opus", "mp4"]
|
|
19
|
+
auto_convert: true # ffmpeg-sidecar 自动转 16k/mono/s16le
|
|
20
|
+
conversion_timeout: 60
|
|
21
|
+
temp_file_cleanup: true
|
|
22
|
+
temp_file_retention: 300
|
|
23
|
+
workers:
|
|
24
|
+
transcription_workers: 3
|
|
25
|
+
channel_buffer_size: 100
|
|
26
|
+
worker_timeout: 3600
|
|
27
|
+
# engine: # STT 引擎配置(可选,全部有默认值)
|
|
28
|
+
# output_script: "simplified" # 输出脚本:simplified(默认,繁→简;英文透传) / original(原样输出)
|
|
29
|
+
# backend: "whisper" # STT 后端:whisper(默认) / sensevoice / fireredasr2 / funasrnano / qwen3asr。
|
|
30
|
+
# # sensevoice 仅批量(流式仍 whisper),中文 CER 优于 whisper、原生简体;
|
|
31
|
+
# # 需 `--features sensevoice` 编译(Mac)/ sensevoice-cuda(Linux)。
|
|
32
|
+
# # fireredasr2/funasrnano/qwen3asr 走 sherpa-onnx(与 TTS 同库,Mac 可 CoreML GPU),
|
|
33
|
+
# # 均仅批量;无需 feature 门控(sherpa-onnx C 库本就为 TTS 无条件链接)。
|
|
34
|
+
# sensevoice: # 仅 backend=sensevoice 生效(模型 host 预置,无自动下载)
|
|
35
|
+
# model_dir: "./models/sensevoice/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17"
|
|
36
|
+
# quantization: "int8" # fp32/fp16/int8(默认)/int4 → 读对应 model.<quant>.onnx
|
|
37
|
+
# use_itn: true # 逆文本归一化(数字/日期口语→书面)
|
|
38
|
+
# sherpa: # 仅 backend=fireredasr2|funasrnano|qwen3asr 生效(sherpa-onnx 引擎池)
|
|
39
|
+
# provider: "coreml" # ONNX EP:留空=CPU;coreml=Mac GPU/ANE;cuda=Linux NVIDIA。per-instance(与 transcribe-rs 全局 device 独立)
|
|
40
|
+
# pool_size: 1 # 引擎实例数(CPU 最优 1)
|
|
41
|
+
# fireredasr2: # FireRedASR2-AED(zh/en/20+ 方言,1.1B;Mac CoreML 受益最大)
|
|
42
|
+
# model_dir: "./models/fireredasr2/sherpa-onnx-fire-red-asr2-zh_en-int8-2026-02-26"
|
|
43
|
+
# funasrnano: # Fun-ASR-Nano(800M LLM-decoder,31 语 + 热词)
|
|
44
|
+
# model_dir: "./models/funasrnano/sherpa-onnx-funasr-nano-int8-2025-12-30"
|
|
45
|
+
# hotwords: "" # 热词(逗号分隔),可空
|
|
46
|
+
# qwen3asr: # Qwen3-ASR-0.6B(52 语 + 22 方言 + 热词)
|
|
47
|
+
# model_dir: "./models/qwen3asr/sherpa-onnx-qwen3-asr-0.6B-int8-2026-03-25"
|
|
48
|
+
# hotwords: ""
|
|
49
|
+
# max_new_tokens: 1024 # 生成 token 上限(长音频调高;sherpa Rust 默认 128 偏小)
|
|
50
|
+
# streaming: # STT 流式(可选,全部有默认值)
|
|
51
|
+
# engine: "whisper" # 流式引擎(与批量 backend 解耦;默认 whisper——唯一支持 LA2 真流式;
|
|
52
|
+
# # sherpa/sensevoice 是离线模型无流式能力)。加新流式引擎见 build_streaming_decoder
|
|
53
|
+
# model: "large-v3" # 流式 whisper 模型(None = 回退 default_model;可与批量 whisper 默认解耦)
|
|
54
|
+
# decode_interval_sec: 0.5 # 解码触发间隔
|
|
55
|
+
# tail_trim_sec: 0.3 # B 解码尾部裁剪
|
|
56
|
+
# min_agree_count: 2 # LA2 前缀稳定阈值
|
|
57
|
+
# buffer_max_sec: 30 # 长会话 utterance 切分阈值(超时 flush+reset,详见 docs/API.md §4)
|
|
58
|
+
# idle_timeout_sec: 30
|
|
59
|
+
# decode_timeout_sec: 30
|
|
60
|
+
# compare_granularity: "auto" # auto(按 language 推断)/ char / word
|
|
61
|
+
|
|
62
|
+
# TTS(sherpa-onnx;Kokoro / ZipVoice 双引擎)—— 默认禁用
|
|
63
|
+
# 启用: 置 enabled: true + 放模型到 ./models/tts/<model_id>/
|
|
64
|
+
# - Kokoro(标准多音色): kokoro-multi-lang-v1_1/(103 音色;lexicon 组合 us-en+zh,不含 gb-en)
|
|
65
|
+
# - ZipVoice(零样本克隆,中英): zipvoice-distill-int8-zh-en-emilia/ + vocos_24khz.onnx(vocoder 独立下载)
|
|
66
|
+
# 克隆需 reference 音频+文本:预置 config.tts.engine.zipvoice.voices(请求 voice:<name>)
|
|
67
|
+
# 或请求期动态上传 reference_audio(base64 WAV)。
|
|
68
|
+
# 模型下载见 docs/DEPLOYMENT.md §4
|
|
69
|
+
tts:
|
|
70
|
+
enabled: false # ← true 启用(不启用时 /api/v1/tts* 返回 403,STT 正常)
|
|
71
|
+
max_text_length: 5000
|
|
72
|
+
# tasks_db_path: "./data/tts_tasks.db" # TTS 异步任务独立 SQLite(默认;与 STT 的 ./data/tasks.db 隔离)
|
|
73
|
+
engine:
|
|
74
|
+
backend: kokoro # TTS 引擎:kokoro(标准多音色,默认)/ zipvoice(零样本克隆)
|
|
75
|
+
pool_size: 1 # 引擎实例数(CPU 最优 1;多实例并发但内存×N)
|
|
76
|
+
default_model: "kokoro-multi-lang-v1_1"
|
|
77
|
+
default_sid: 0 # Kokoro 默认音色 id(0-102)
|
|
78
|
+
default_speed: 1.0 # 语速(1.0 原速)
|
|
79
|
+
default_length_scale: 1.0 # Kokoro 时长缩放(model-level,仅首次加载生效)
|
|
80
|
+
num_threads: 4
|
|
81
|
+
warmup: true # 启动期预热默认引擎(避免首用户 ~10-20s 加载延迟;代价启动多 ~15s;关掉则首用户触发懒加载)
|
|
82
|
+
models_dir: "./models/tts"
|
|
83
|
+
# ZipVoice 引擎配置(仅 backend: zipvoice 生效)
|
|
84
|
+
# zipvoice:
|
|
85
|
+
# # model_dir: "./models/tts/zipvoice-distill-int8-zh-en-emilia" # None = {models_dir}/{default_model}
|
|
86
|
+
# # vocoder: "./models/tts/vocos_24khz.onnx" # None = 探测 {model_dir}/vocos_24khz.onnx
|
|
87
|
+
# num_steps: 4 # flow-matching 步数(4 默认;调大更稳但更慢)
|
|
88
|
+
# feat_scale: 0.1 # 4 个超参 Rust Default=0.0 会被 C++ 拒绝,必须 >0(下面是示例值)
|
|
89
|
+
# t_shift: 0.5
|
|
90
|
+
# target_rms: 0.1
|
|
91
|
+
# guidance_scale: 1.0
|
|
92
|
+
# voices: # 预置音色组(启动期加载缓存;请求 voice:<name> 引用)
|
|
93
|
+
# - name: leijun
|
|
94
|
+
# reference_wav: "./models/tts/zipvoice-distill-int8-zh-en-emilia/test_wavs/leijun-1.wav"
|
|
95
|
+
# reference_text: "那还是三十六年前, 一九八七年. 我呢考上了武汉大学的计算机系."
|
|
96
|
+
# streaming: # 可选,全部有默认值
|
|
97
|
+
# idle_timeout_sec: 30
|
|
98
|
+
# synth_timeout_sec: 120
|
|
99
|
+
# default_format: "pcm_s16le"
|
|
100
|
+
|
|
101
|
+
logging:
|
|
102
|
+
level: "info" # trace/debug/info/warn/error
|
|
103
|
+
log_dir: "./logs"
|
|
104
|
+
max_file_size: "100MB"
|
|
105
|
+
max_files: 20
|
|
106
|
+
|
|
107
|
+
daemon:
|
|
108
|
+
pid_file: "./voice-cli-server.pid"
|
|
109
|
+
log_file: "./logs/server-daemon.log"
|
|
110
|
+
work_dir: "./"
|
|
111
|
+
|
|
112
|
+
# 异步任务队列(apalis + SQLite,STT/TTS 共用)
|
|
113
|
+
task_management:
|
|
114
|
+
max_concurrent_tasks: 4
|
|
115
|
+
retry_attempts: 2
|
|
116
|
+
task_timeout_seconds: 3600
|
|
117
|
+
catch_panic: true
|
|
118
|
+
task_retention_minutes: 1440 # 24 小时
|
|
119
|
+
sqlite_db_path: "./data/tasks.db"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# LaunchAgent wrapper: load OSS secrets then start document-parser.
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH:-}"
|
|
5
|
-
# launchd may omit HOME; Python/HuggingFace caches and MPS need a real home
|
|
6
|
-
if [[ -z "${HOME:-}" ]]; then
|
|
7
|
-
HOME="$(cd ~ && pwd)"
|
|
8
|
-
export HOME
|
|
9
|
-
fi
|
|
10
|
-
export TMPDIR="${TMPDIR:-/tmp}"
|
|
11
|
-
cd "$(dirname "$0")"
|
|
12
|
-
set -a
|
|
13
|
-
# shellcheck disable=SC1091
|
|
14
|
-
source .document-parser.env
|
|
15
|
-
set +a
|
|
16
|
-
exec ./document-parser --config ./config.yml server
|