What is sherpa-onnx?
sherpa-onnx is an open-source speech toolkit from the k2-fsa project that runs entirely on your own device, with no cloud service required. It uses ONNX Runtime to execute pre-trained models, so the same speech features work the same way across many machines. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in C++ and licensed Apache-2.0.
Overview
sherpa-onnx is an open-source speech toolkit from the k2-fsa project that runs entirely on your own device, with no cloud service required. It uses ONNX Runtime to execute pre-trained models, so the same speech features work the same way across many machines.
It covers a wide range of audio tasks in one package: speech-to-text (both streaming and non-streaming), text-to-speech, speaker identification, speaker verification, speaker diarization, spoken language identification, audio tagging, voice activity detection, keyword spotting, punctuation, speech enhancement and source separation.
The toolkit is unusually portable. It runs on Linux, macOS, Windows, Android, iOS and HarmonyOS, on x86, ARM and RISC-V chips, and even in the browser through WebAssembly. You can call it from many languages, including Python, C++, C, Go, C#, Java, Kotlin, JavaScript, Swift, Rust and Dart.
What it does
- Offline speech-to-text with both streaming (real-time) and non-streaming modes, supporting many languages and model families such as Zipformer, Paraformer, Whisper and SenseVoice.
- Local text-to-speech that turns written text into audio without any network call.
- Speaker tools: identification, verification and diarization to tell who is speaking and separate speakers in a recording.
- Voice activity detection, keyword spotting, punctuation, audio tagging, spoken language identification, speech enhancement and source separation.
- Broad platform reach: desktop, Android, iOS, HarmonyOS, NodeJS, WebAssembly, Raspberry Pi and NVIDIA Jetson, on CPU, GPU and several NPUs.
- Bindings for a dozen programming languages, so you can embed speech features in almost any stack.
Getting started
The fastest way to try sherpa-onnx is the Python package. It installs a CPU-only build that works on Linux, macOS and Windows. You then download a pre-trained model and run one of the bundled examples.
Install the Python package
Install the CPU-only build from PyPI. This pulls in the core library and its prebuilt binaries.
pip install sherpa-onnx sherpa-onnx-binPick a pre-trained model
sherpa-onnx does not ship models inside the package. Browse the documentation for the task you need (for example speech recognition or text-to-speech) and download a ready-made model, then unpack it locally.
Run a built-in example
The repository includes ready-to-run example scripts for each task under python-api-examples, so you can confirm your install and model work before writing your own code.
Try it in the browser first
If you would rather test without installing anything, the project hosts live demos on Hugging Face Spaces for speech recognition, text-to-speech, speaker diarization and more.
Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Add private, offline voice transcription to a desktop or mobile app where audio must never leave the device.
- Generate spoken audio from text locally for voice assistants, accessibility tools or read-aloud features.
- Build meeting tools that detect speech, identify speakers and separate who said what using diarization and speaker ID.
- Run real-time captioning or keyword spotting on low-power hardware such as Raspberry Pi, NVIDIA Jetson or in a web page via WebAssembly.
How sherpa-onnx compares
sherpa-onnx alongside other open-source audio, music & voice tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| VoiceStudio | ★ 121k | A local-first desktop voice studio that clones and designs voices, dubs video, and handles dictation, running 16 text-to-speech and 11 speech-recognition engines on your own hardware. |
| Whisper | ★ 114k | OpenAI's speech recognition model that transcribes and translates audio across many languages. |
| GPT-SoVITS | ★ 64.3k | An open-source WebUI that clones a voice from a short audio sample and turns text into speech, with zero-shot and few-shot fine-tuning. |
| Voicebox | ★ 61.6k | Local-first voice studio that clones a voice from a short sample, generates speech across seven TTS engines and 23 languages, handles system-wide dictation, and speaks for agents over MCP. |
| VibeVoice | ★ 57.6k | Microsoft's text-to-speech model for generating long, expressive multi-speaker audio like podcasts. |
| whisper.cpp | ★ 55.7k | A dependency-free C/C++ port of Whisper built on ggml, running speech recognition on CPU, Metal, CUDA, Vulkan and NPUs from phones to servers. |
| Coqui TTS | ★ 46.3k | A library of text-to-speech models including the multilingual XTTS voice-cloning model. |
| sherpa-onnx | ★ 16.3k | On-device speech-to-text, text-to-speech and more, powered by ONNX Runtime |

