Sherpaw (the "w" stands for "WASM") is a WebAssembly (WASM) wrapper for Sherpa-ONNX—a framework for speech-related tasks (ASR, VAD, TTS, STT, SD, etc.) using onnxruntime purely locally.
Install Git LFS and run git lfs install before checking out the submodules so that model data files are downloaded.
git clone git@github.com:sumimakito/sherpaw.git
git submodule init
git submodule updateThe published Hugging Face models are pinned as submodules under models/huggingface/. Each model includes preload.data, preload.js, and preload.js.metadata in install/bin/wasm/.
X-ASR streaming model packs are available in the same preload layout:
| Model | Hugging Face repository | Model data size |
|---|---|---|
| X-ASR zh-en, 480 ms, INT8 | sherpaw-x-asr-zh-en-480ms-int8 | 169.23 MB |
| X-ASR zh-en, 480 ms, FP32 | sherpaw-x-asr-zh-en-480ms-fp32 | 614.98 MB |
Both expose /decoder.onnx, /encoder.onnx, /joiner.onnx, and /tokens.txt.
The INT8 encoder/joiner are renamed for compatibility without changing their
bytes. See packaging and verification
for reproduction commands, and use the pinned Hugging Face submodules below
models/huggingface/ for reproducible deployment.
Speaker embedding and keyword spotting model packs are also available:
| Model | Hugging Face repository | Model data size |
|---|---|---|
| CAM++ Chinese/English advanced | sherpaw-campplus-zh-en-advanced | 28.28 MB |
| ERes2NetV2 Chinese common | sherpaw-eres2netv2-zh-cn | 71.44 MB |
| KWS Zipformer Chinese/English | sherpa-onnx-kws-zipformer-zh-en-3M-2025-12-20 | 13.08 MB |
| KWS Zipformer Wenetspeech Chinese | sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01 | 13.08 MB |
The speaker packs expose /speaker-embedding.onnx; the KWS packs expose /encoder.onnx, /decoder.onnx, /joiner.onnx, and /tokens.txt. Each requires its separate WASM runtime. Their model cards and manifests record source attribution, packaging details, and SHA-256 hashes. The data files contain the unchanged upstream ONNX bytes. Use the pinned submodule revisions for reproducible downloads.
The sandbox includes speaker identification at /speaker-identification and speaker diarization at /speaker-diarization. Run pnpm dev and select one from the home page.
Speaker identification is available in @sherpaw/speaker-identification, with WASM embedding extraction, enrollment, scored identification, and verification. Download and preload-pack scripts are available for CAM++ Chinese/English advanced and ERes2NetV2 Chinese. See the model research and browser / fake-microphone experiments.
Streaming keyword spotting is available in @sherpaw/kws. It runs in a Worker, accepts PCM audio and encoded keyword tokens, and supports replacing keywords while listening. Try the sandbox playground at /kws with a microphone or an audio file.
Speaker diarization is available in @sherpaw/speaker-diarization. It combines pyannote-segmentation-3.0 with any supported speaker embedding model, such as the CAM++ pack above. It returns speaker turns for a complete recording, or labels live audio as it arrives, with enrolled people and saved voiceprints. Try it at /speaker-tracking in the sandbox.
Follow Sherpa-ONNX's Install Emscripten and Emscripten's Download and install guides to set up the Emscripten SDK.
Important
Some versions of Emscripten may be incompatible with Sherpa-ONNX. Ensure you follow their official documentation and use the recommended version.
# Assuming Emscripten 3.1.64 is used
# Refer to the documentation above when selecting a version
./emsdk install 3.1.64
./emsdk activate 3.1.64
cd sherpa-onnx
./build.shThe build outputs are located in sherpa-onnx/build/install/bin/wasm/.
Copyright 2025 Makito
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.