# Sherpa-ONNX browser runtime

This directory contains the **runtime only** build of [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx), tag `v1.13.4`, licensed under Apache-2.0. It contains no acoustic-model weights, tokenizer, recordings, credentials, or cached content.

`sherpa-runtime.mjs` and `sherpa-runtime.wasm` were built from that tag with Emscripten 4.0.23. The upstream browser ASR CMake target was adjusted only to:

- omit `-pthread` and the pthread pool, so it runs where `crossOriginIsolated` is false;
- omit the upstream preloaded encoder/data file;
- export the offline-recognizer C APIs alongside the existing online APIs;
- produce a modular ES module named `createSherpaModule` and export `FS` for verified Cache API model mounting.

The JavaScript API facade is not copied here. At build time, `scripts/bundle-runtime.mjs` takes the matching `sherpa-onnx@1.13.4` package's `sherpa-onnx-asr.js`, adds ES-module exports, and writes it to `dist/sherpa/sherpa-api.mjs`.

The generated runtime must be rebuilt from the pinned upstream source for any runtime-version update, and its output must be checked to contain no `-pthread`, `PTHREAD_POOL_SIZE`, `em-pthread`, or bundled model-data file.
