MrTechKing

22 min read

sherpa-onnx: Offline Speech-to-Text and Text-to-Speech Anywhere (GitHub, Scanned)

A free toolkit for offline speech-to-text, text-to-speech and speaker tools that runs on PCs, phones and a Raspberry Pi.

sherpa-onnx logo
✅
Scan: safe. Nothing malicious. Two things to know: each pretrained model has its own licence, and the advisories sit in the example apps' lockfiles, not in the library. Scanned Nov 28, 2026; the full report is below.

sherpa-onnx is a free, open-source toolkit for speech AI that runs entirely offline. It turns speech into text, live from a microphone or from files, reads text aloud, works out who spoke when, listens for wake words, detects when someone is talking, adds punctuation and separates vocals from music. You pick a ready-made model, such as Whisper, SenseVoice, Parakeet or a Piper voice, download it once, and everything after that works without the internet.

It earns its place by running almost anywhere: Windows, macOS, Linux, Android, iOS, HarmonyOS, a Raspberry Pi, RISC-V boards and NPUs from Rockchip, Qualcomm and others, with APIs in 12 programming languages plus WebAssembly. That is why it sits inside many offline dictation, subtitle and voice-assistant apps; its PyPI package alone is downloaded more than a million times a week. You can hear the models first in the project's free demos on Hugging Face or its demo Android apps.

sherpa-onnx is Apache 2.0 and comes from the Next-gen Kaldi team (k2-fsa), led by Fangjun Kuang at Xiaomi, who wrote most of the commits. It has about 16,300 stars and around 300 contributors, and v2.0.3 came out on 22 November 2026. Each pretrained model keeps its own licence, so check the model's page before using it in a product.

  • Repository: github.com/k2-fsa/sherpa-onnx
  • Licence: Apache-2.0 (Apache License 2.0)
  • Language: C++. Stars: 16.3K. Forks: 1,931. Last push: Nov 28, 2026.
  • Scan: safe, Nov 28, 2026, commit 4ef1e51

Who it is for

App developers adding offline voice features, makers building voice assistants on a Raspberry Pi, and anyone who wants transcription or text-to-speech that never leaves their machine. It runs on an ordinary CPU, no GPU needed, but using it means a terminal or code; the demo apps are for trying models, not daily use.

Getting started

1. Try it in your browser first, no install (text-to-speech is at k2-fsa/text-to-speech)

https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition

2. Install the Python package, which also adds the sherpa-onnx command-line tools

pip install sherpa-onnx

3. Download a small English Whisper model (about 120 MB) from the project's releases

curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-whisper-tiny.en.tar.bz2
tar xvf sherpa-onnx-whisper-tiny.en.tar.bz2

4. Transcribe the sample recording that comes with it

sherpa-onnx-offline \
  --tokens=./sherpa-onnx-whisper-tiny.en/tiny.en-tokens.txt \
  --whisper-encoder=./sherpa-onnx-whisper-tiny.en/tiny.en-encoder.int8.onnx \
  --whisper-decoder=./sherpa-onnx-whisper-tiny.en/tiny.en-decoder.int8.onnx \
  ./sherpa-onnx-whisper-tiny.en/test_wavs/0.wav

5. On Android, the demo apps (speech recognition, text-to-speech engine and more) are listed per model and phone type

https://k2-fsa.github.io/sherpa/onnx/android/apk.html

pip installs prebuilt wheels and changes nothing else; models are plain folders you download and can delete. Building from source runs CMake, which downloads ONNX Runtime and other libraries. The Android demos are APKs you sideload, not Play Store apps. Our scan covers this repo's source, not the prebuilt wheels, APKs or the models themselves.

Safety scan

We cloned k2-fsa/sherpa-onnx at commit 4ef1e51 on Nov 28, 2026 and ran the checks described on the GitHub Tools page: credential patterns, decode-and-execute code, install-time scripts, committed binaries, risky CI workflows, every host the code talks to, known vulnerabilities in pinned dependencies, and project hygiene. A person read every hit. This is what we found.

  • 2 secret hits, both in scripts/medasr/export_onnx.py (lines 7 and 9): the placeholder hf_xxxx in a comment telling you to set your own Hugging Face token. The 20 committed binaries are all gradle-wrapper.jar files for the 18 Android demo apps and 2 Java examples, and their SHA-256 hashes match Gradle's published checksums for the 6.9 and 8.6 wrappers. 6,959 files and about 523,000 lines in all.
  • 0 pattern hits. The 586 shell scripts the scanner lists are example and model-export scripts that download models from the project's GitHub releases or Hugging Face; none pipes into a shell or edits your profile, and the three that mention sudo have it in a commented-out apt line.
  • No install script for users: pip install sherpa-onnx fetches prebuilt wheels. The Rust crate's build.rs downloads the project's own prebuilt libraries from its GitHub releases, and the cmake-js install hook in scripts/node-addon-api only applies when you build the Node addon from source.
  • 91 known advisories (5 critical, 8 high), all in the Cargo.lock files of the Rust and Tauri example apps rather than the library. All 5 criticals are in the zip crate, which sherpa-onnx-sys uses only at build time to unpack the project's own iOS archive, so no untrusted zip file reaches it; the crate now asks for zip 9, and a fresh build picks 9.9.0, past the fixes. The highs are in the same zip crate, quick-xml and rustls-webpki.
  • The library makes no network connections of its own; the hosts in the code are download and documentation links (GitHub, Hugging Face, ModelScope). 220 workflows, none using pull_request_target or workflow_run; release jobs publish to GitHub, PyPI, npm, crates.io, Hugging Face and ModelScope with tokens and sign the Android APKs, and only 1 of 750 third-party action uses is pinned to a commit. No security policy, Dependabot or CodeQL, and no OpenSSF Scorecard result.

What the scanner counted

CheckResult
Secrets2 candidates found and read; see the notes above.
Suspicious codeNone found.
Install-time code2 npm lifecycle scripts. 1 setup.py with custom install logic. 5 Cargo build scripts. 586 installer scripts (one can call sudo)
Committed binaries20 executable or compiled objects committed; listed under the raw findings.
CI workflows220 workflows. None use pull_request_target. 749 of 750 third-party actions pinned to a tag rather than a commit.
Network hosts40 distinct hosts referenced from source; most often github.com, huggingface.co, k2-fsa.github.io, alphacephei.com. No URLs to bare IP addresses.
Known vulnerabilities91 advisories across 1,014 pinned packages: 5 critical, 8 high, 14 moderate, 10 low, 54 unrated. rust-api-examples/Cargo.lock: 219 packages, 28 advisories; tauri-examples/doubao-asr-file/src-tauri/Cargo.lock: 540 packages, 28 advisories; tauri-examples/hello_world/src-tauri/Cargo.lock: 473 packages, 38 advisories; tauri-examples/non-streaming-speech-recognition-from-file/src-tauri/Cargo.lock: 532 packages, 28 advisories; tauri-examples/non-streaming-speech-recognition-from-microphone/src-tauri/Cargo.lock: 528 packages, 26 advisories.
Project hygieneHas licence file. Missing security policy, automated dependency updates, CodeQL, contributing guide.
OpenSSF ScorecardNot scored: the project is not in Scorecard's weekly index.

The raw findings

Every hit the scanner wrote out, with a link to the exact line at the scanned commit. Secrets candidates are redacted.

Secret candidates (2, redacted)
WhereRuleMatch
scripts/medasr/export_onnx.py:7huggingface-tokenhf_xxx…xxx (37 chars)
scripts/medasr/export_onnx.py:9huggingface-tokenhf_xxx…xxx (37 chars)
npm lifecycle scripts (2)
  • scripts/node-addon-api/package.json install: cmake-js compile --log-level verbose
  • scripts/node-addon-api/package.json postinstall: npm run typecheck
Installer scripts (586)
Committed binaries (20)
  • android/SherpaOnnx/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnx2Pass/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxAar/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxAudioTagging/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxAudioTaggingWearOs/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxForcedAlignment/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxJavaDemo/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxKws/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxSimulateStreamingAsr/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxSimulateStreamingAsrWearOs/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxSpeakerDiarization/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxSpeakerIdentification/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxSpokenLanguageIdentification/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxTts/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxTtsEngine/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxVad/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxVadAsr/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • android/SherpaOnnxWebSocket/gradle/wrapper/gradle-wrapper.jar: JAR, 59 KB
  • java-api-examples/gradle-examples/gradle/wrapper/gradle-wrapper.jar: JAR, 43 KB
  • java-api-examples/gradle-kts-examples/gradle/wrapper/gradle-wrapper.jar: JAR, 43 KB
Worst known vulnerabilities (24 of 91)
AdvisorySeverityPackageSummary
GHSA-m665-v7pm-7grjcriticalzip@9.0.0zip: Critical Parser Differential & Security Control Bypass via Dual-Header Inconsistencies (Zip Cloaking) Leading to Ar…
GHSA-m665-v7pm-7grjcriticalzip@2.6.1zip: Critical Parser Differential & Security Control Bypass via Dual-Header Inconsistencies (Zip Cloaking) Leading to Ar…
GHSA-4684-h2q9-2vcpcriticalzip@2.6.1ZipStreamReader::extract() and ZipArchive::extract() apply Unix permissions through symlinks without confining the targe…
GHSA-m665-v7pm-7grjcriticalzip@2.4.2zip: Critical Parser Differential & Security Control Bypass via Dual-Header Inconsistencies (Zip Cloaking) Leading to Ar…
GHSA-4684-h2q9-2vcpcriticalzip@2.4.2ZipStreamReader::extract() and ZipArchive::extract() apply Unix permissions through symlinks without confining the targe…
GHSA-82j2-j2ch-gfr8highrustls-webpki@0.103.10rustls-webpki: Denial of service via panic on malformed CRL BIT STRING
GHSA-q7v9-x93c-xqv3highzip@2.6.1zip: Unbounded Symlink-Target Handling Can Abort Or Exhaust Memory During Extraction
GHSA-vv5m-jxxh-4627highzip@2.6.1Insecure Preservation of SUID/SGID Bits during ZIP Extraction Leading to Potential Privilege Escalation
GHSA-q7v9-x93c-xqv3highzip@2.4.2zip: Unbounded Symlink-Target Handling Can Abort Or Exhaust Memory During Extraction
GHSA-vv5m-jxxh-4627highzip@2.4.2Insecure Preservation of SUID/SGID Bits during ZIP Extraction Leading to Potential Privilege Escalation
RUSTSEC-2026-0194highquick-xml@0.38.4Quadratic run time when checking a start tag for duplicate attribute names
RUSTSEC-2026-0195highquick-xml@0.38.4Unbounded namespace-declaration allocation in `NsReader` enables memory-exhaustion denial of service
GHSA-82j2-j2ch-gfr8highrustls-webpki@0.103.12rustls-webpki: Denial of service via panic on malformed CRL BIT STRING
GHSA-2mjx-qc3c-rqvcmoderaterustls@0.23.37Rustls: TLS 1.3 handshake messages incorrectly accepted across encryption level boundaries
GHSA-c8m5-c952-6cm4moderaterustls@0.23.37Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKs
GHSA-3pv8-6f4r-ffg2moderatetar@0.4.45tar has a PAX header desynchronization issue
GHSA-8wcq-xq25-7fhmmoderatecookie@0.18.2Private cookie nonces can repeat in processes that fork
GHSA-wrw7-89jp-8q8gmoderateglib@0.18.5Unsoundness in `Iterator` and `DoubleEndedIterator` impls for `glib::VariantStrIter`
GHSA-8hxf-qr8p-62x4moderatezip@2.6.1zip: AES Entry HMAC Authentication Bypass on Premature EOF
GHSA-2mjx-qc3c-rqvcmoderaterustls@0.23.43Rustls: TLS 1.3 handshake messages incorrectly accepted across encryption level boundaries
GHSA-c8m5-c952-6cm4moderaterustls@0.23.43Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKs
GHSA-8hxf-qr8p-62x4moderatezip@2.4.2zip: AES Entry HMAC Authentication Bypass on Premature EOF
GHSA-8wcq-xq25-7fhmmoderatecookie@0.18.1Private cookie nonces can repeat in processes that fork
GHSA-2mjx-qc3c-rqvcmoderaterustls@0.23.38Rustls: TLS 1.3 handshake messages incorrectly accepted across encryption level boundaries

By the numbers

Stars16.3K
Forks1,931
Contributors300
Commits2,279
Open issues578
Open pull requests107
Releases199
Latest releasev2.0.3
LicenceApache-2.0
Main languageC++
Project age4 years
Last pushNov 28, 2026
Tracked files6,959
Lines of code523K
Checkout size32 MB

Lines by language: C++ 125.8K, Python 90.9K, YAML 64.9K, C/C++ header 53.6K, Shell 32.1K, JavaScript 28.7K.

Questions

Is sherpa-onnx free?

Yes. It is free and open source under Apache 2.0, with no paid tier or account. The models it runs come from many sources and keep their own licences (Whisper is MIT, for example), so check before shipping one in a product.

sherpa-onnx or Whisper?

Whisper is one speech-recognition model with OpenAI's own Python code. sherpa-onnx is an engine that runs Whisper and dozens of other models, often faster on CPUs and phones, and adds text-to-speech, speaker labels and wake words. Pick sherpa-onnx to build an offline app.

Does sherpa-onnx work on phones?

Yes. Android and iOS are supported for developers, and the project publishes demo Android APKs you can sideload to try it, including a system text-to-speech engine. iOS demos have to be built in Xcode.

Does sherpa-onnx send my audio anywhere?

No. Once a model is downloaded, recognition and speech run entirely on your device with no internet. The online part is fetching the package and the models.

Can sherpa-onnx clone voices?

A few of its text-to-speech models can: ZipVoice and Pocket TTS copy a voice from a short sample clip. Most voices, such as Piper and Matcha, are fixed. Only copy a voice with its owner's permission.


This post is part of GitHub Tools, where every repository is cloned and scanned before it is written up. The scan is a snapshot of one commit on one day; the repository has moved on since, so check it before you install.