← Back to Leaderboard
Sk2-fsa

k2-fsa/sherpa-onnx

C++ and ONNX Runtime SDK for offline speech and real-time transcription

Engineering Health (Methodology)
A+ · 97/100
Maintenance Activity
● Updated today
Latest Release
v2.0.3
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption22/25
Release Cadence20/20
License Clarity20/20
Self-HostedLocal AIAPI
Total Stars
★ 16,424
24h Growth
+20
7d Growth
+136
Forks
1,968

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

k2-fsa/sherpa-onnx Star History (2022-09-02 - 2026-12-04) ALL-TIME STAR HISTORY (2022-09 – 2026-12) +16.4k in 1554d · avg +11/day 17.3k 8.7k 0 2022-09-02: ★ 12022-12-10: ★ 132023-03-18: ★ 582023-06-24: ★ 1502023-09-30: ★ 2352024-01-06: ★ 4032024-04-13: ★ 7062024-07-20: ★ 2,4552024-10-26: ★ 3,2822025-02-01: ★ 4,3402025-05-10: ★ 5,7362025-08-16: ★ 6,8882025-11-22: ★ 8,7732026-02-28: ★ 10,3472026-06-06: ★ 12,6342026-09-12: ★ 14,6582026-12-04: ★ 16,424 ★ 16.4k 2022-09 2024-10 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

sherpa-onnx is a native C++ speech and audio SDK with an ONNX Runtime-based inference stack. Applications supply audio to a task-specific API and configure the corresponding model assets. Streaming ASR accepts successive chunks for a live session; non-streaming ASR processes a completed recording or segment. VAD, synthesis, and speaker processing are separate capabilities an application can compose, not stages every request must pass through.

The native integration surface is visible in CMakeLists.txt, cmake/, c-api-examples/, and cxx-api-examples/; Package.swift and the Swift and SwiftUI example directories provide Apple integration entry points. Twelve language APIs, including Python, C#, Go, Dart, and Rust, provide alternatives to writing a C++ application. The WebSocket server/client path places inference behind a network boundary; use it when service separation matters, not on the assumption that the SDK implements a managed transcription API contract.

Key Capabilities & Differentiators

The recognition catalog gives teams distinct choices for live and recorded audio: streaming Zipformer includes Chinese–English bilingual variants and compact Chinese and English models listed for Cortex-A7; non-streaming examples include Whisper tiny.en and the English NeMo Parakeet TDT 0.6B v2 INT8 package. Forced alignment solves a different problem: given audio and its transcript, it produces word-level timestamps. Available bundles include Chinese pinyin models and English MFA models with pronunciation dictionaries.

The SDK also covers TTS, speaker diarization, identification and verification, spoken-language identification, punctuation, audio tagging, VAD, keyword spotting, enhancement, and source separation. Teams can combine these selectively—for example, segment speech with VAD before non-streaming recognition—but should evaluate each stage separately. Supported acceleration paths include RKNN, QNN, Ascend, Axera, and OpenVINO for Intel NPU; the platform and accelerator lists are not an all-model compatibility matrix.

Trade-offs & Limitations

Compared with a hosted Whisper API, sherpa-onnx keeps inference under your control and can run without an internet connection once the runtime and models are in place. It also covers tasks beyond transcription. The trade-off is that your team selects and distributes models, handles native compatibility, and owns upgrades and capacity. A hosted API is simpler when the requirement is only to send a recording and receive text, and sending audio to an external service is acceptable.

Local inference removes a cloud round trip, but it is not automatically faster end to end. Compare accuracy on representative audio, time to first partial result for streaming, sustained throughput, and peak memory at the intended concurrency. On edge devices, also check package size and sustained performance under thermal limits. Apache-2.0 covers the SDK; verify the terms of model weights, dictionaries, and any bundled dependencies separately before redistribution.

Hardware & Deployment Guide

For an offline app, provision the native runtime or target binding and the selected model assets before network access is removed. Use the CMake build path for native source builds. The tree includes Android ABI, iOS, HarmonyOS, ARM Linux, and RISC-V Linux scripts, as well as task-specific WASM SIMD builds. Pre-built Android APKs are useful for evaluating individual tasks; the iOS Flutter TTS demo has a source-build requirement. For self-hosting, the WebSocket server/client path gives networked applications a service boundary without requiring managed inference.

Pin the SDK build and tested model assets together when distributing an app or operating a service. In v2.0.2, changes included a fix for NeMo TDT speech dropped by modified beam search, per-stream language candidates for Whisper, and an optional QNN HTP performance mode. In v2.0.3, diarization clustering was restricted to embeddings with enough clean speech, and a no-op Pad before AveragePool was removed from WeSpeaker CAM++ models. Include representative audio and target hardware in regression tests when adopting those changes.

Recognition modes: Streaming Chinese–English Zipformer for incremental results; non-streaming Whisper and NeMo Parakeet TDT for completed audio.
Transcript alignment: Forced alignment produces word-level timestamps from audio and an existing transcript, with Chinese pinyin and English MFA model bundles.
Integration: Native C and C++ examples, APIs across 12 languages, and a WebSocket server/client route alongside in-process embedding.
Portable builds: CMake plus target-specific scripts for Android, iOS, HarmonyOS, Linux on ARM and RISC-V, and task-specific WebAssembly SIMD builds.
Accelerator options: Rockchip RKNN, Qualcomm QNN, Ascend, Axera, and Intel NPU via OpenVINO; verify the exact model and build for each target.
Audio pipeline components: VAD and keyword spotting support voice interfaces; diarization, enhancement, and source separation address distinct recording workflows.
Best For

Teams embedding offline voice features in apps or edge devices, or self-hosting live transcription with control over where audio is processed and which models run.

Skip If

You need a managed, drop-in Whisper API endpoint or cannot own model selection, native packaging, and target-device validation.

Reviewed on 2026-12-01 · Grounded in GitHub README, root file tree & releasesMethodology

Comparison vs. Top Voice, Vision & Video Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
sherpa-onnx ★16.4k+136C++Apache-2.0C++ and ONNX Runtime SDK for offline speech and real-time transcription
whisperX26.5k+677PythonBSD-2-ClauseBatched Whisper with forced alignment for word timings and optional speaker labe
moonshine11.7k+48C++—On-device C++ SDK for live transcription, intent recognition, and speech synthes
mlx-audio8.4k+32PythonMITMLX inference SDK for local speech and audio pipelines on Apple Silicon

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/k2-fsa/sherpa-onnx.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

k2-fsa/sherpa-onnx Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about sherpa-onnx

How should I integrate live transcription?

Embed the native SDK through the binding that matches your application, or run the WebSocket server as a separate process for network clients. Choose the recognition mode before choosing the model: use a streaming model such as Zipformer for incremental results, or a non-streaming model such as Whisper for completed recordings or segments. Feeding VAD-cut segments to a non-streaming model is not the same as native streaming recognition.

Do I need a GPU, and how should I size the runtime?

A GPU is not inherently required for local inference; CPU is a practical starting point. There is no single RAM or VRAM requirement across models, tasks, and backends. Test the exact model and build on the target device, measuring model load time, peak memory, and whether it can keep up with live audio at the intended stream count. On mobile, also test power draw and sustained performance.

Can I ship it commercially or self-host it for sensitive audio?

The SDK is Apache-2.0, which permits commercial use and self-hosting subject to its terms. Review the terms of the model weights, lexicons, packaged dependencies, and any other assets you distribute; the SDK license does not automatically cover them. Local inference avoids sending audio to a managed inference provider, but your application still controls who can access recordings, transcripts, and logs and how long they are retained.

Is it a drop-in replacement for a hosted Whisper API?

It can replace the transcription function when an available model meets your language, accuracy, and throughput requirements, but it is not a drop-in Whisper API replacement. The SDK can run Whisper locally for non-streaming transcription or use a streaming model such as Zipformer for live captions. If callers must keep an existing HTTP contract, plan an adapter and validate request formats and response semantics.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining k2-fsa/sherpa-onnx? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature k2-fsa/sherpa-onnx on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare