Views
No views yet
moonshine_streaming architecture) for in-browser speech-to-text with transformers.js. No official ONNX export of this architecture exists upstream; this one was built and validated by Workmind. The export is batch/full-utterance (encoder + merged decoder with past-KV), not chunked-streaming.1import { pipeline } from '@huggingface/transformers';
2
3const transcriber = await pipeline(
4 'automatic-speech-recognition',
5 'Workmind/moonshine-streaming-small-ONNX',
6 { dtype: { encoder_model: 'q8', decoder_model_merged: 'q8' } },
7);
8
9const { text } = await transcriber(audio); // Float32Array, 16 kHz monoconfig.json says moonshine)moonshine_streaming registration yet, so the published config.json intentionally declares model_type: "moonshine" with v1-shaped normalized-config keys. The stock transformers.js bundle then loads this model through its registered Moonshine v1 path; all v2 architectural differences (including the sliding-window encoder attention mask, synthesized all-ones inside the graph) are baked into the ONNX graphs, which are v1-compatible in I/O. Once native moonshine_streaming support ships upstream, a new revision of this repo will carry the real config.| Variant | Encoder | Decoder (merged) | Notes |
|---|---|---|---|
| fp32 | encoder_model.onnx (196 MB) | decoder_model_merged.onnx (340 MB) | reference |
| q8 | encoder_model_quantized.onnx (71 MB) | decoder_model_merged_quantized.onnx (87 MB) | recommended; transcript-lossless vs fp32 |
| q4 | encoder_model_q4.onnx (56 MB) | decoder_model_merged_q4.onnx (116 MB) | transcript-lossless vs fp32 |
UsefulSensors/moonshine-streaming-small at revision 2c036506f23a09c18df5a50057599ba6d9280999 with transformers 5.14.1 and a patched optimum-onnx export config. The full reproducible pipeline (export, quantization, parity checks, config rewrite) lives at WorkmindAI/stt-models.