k2-fsa/sherpa
Self-hosted speech-to-text with PyTorch transducer and CTC models
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
sherpa is a C++ speech-to-text inference framework backed by PyTorch, with C++ and Python APIs for running pretrained end-to-end transducer and CTC models. The application supplies speech audio and uses the selected model to obtain a transcript. WebSocket is a service integration path when the recognizer needs to run separately from its clients, rather than a requirement for in-process API use.
CMakeLists.txt and setup.py provide native build and Python packaging entry points, respectively, while python-api-examples/ is a starting point for client integration. requirements.txt lists websockets, kaldifeat, sentencepiece>=0.1.96, and numpy; the container recipe also installs torchaudio and a pinned k2 build. The presence of triton/ alone does not establish a supported Triton configuration or a production service contract.
Key Capabilities & Differentiators
The main capability is transcribing speech with pretrained end-to-end transducer and CTC models. That gives teams two model families to evaluate without making the serving framework responsible for training or fine-tuning; those workflows belong in icefall. Use the API surface and examples to validate the inference integration, and test WebSocket separately if browser or remote clients will connect to a recognition service.
Choose the model before committing to a rollout. There are no verified specifications here for language coverage, input audio format, decoding options, partial-result semantics, or serving capacity. A browser demo provides a way to try recognition without installing the stack, but it does not establish the production protocol or what latency and recognition quality to expect on your own audio.
Trade-offs & Limitations
Compared with a managed Whisper API, self-hosting sherpa gives your team control over where audio is processed and which supported model it runs. In return, the team owns dependency compatibility, model rollout, capacity planning, and service reliability. Neither lower latency nor lower cost follows automatically; compare end-to-end behavior with your model, hardware, concurrency, and network path.
If removing PyTorch or targeting iOS, Android, or embedded systems is a hard requirement, start by evaluating the related projects sherpa-onnx and sherpa-ncnn, which do not depend on PyTorch and cover those platforms. For commercial distribution, Apache-2.0 applies to the sherpa repository; verify the separate terms for your model weights, dependencies, and container base.
Hardware & Deployment Guide
For the Docker path, check the host NVIDIA driver against the nvcr.io/nvidia/pytorch:22.12-py3 base and the pinned k2 build, 1.24.4.dev20240223+cuda11.7.torch1.13.1, before installing or changing runtime components. The recipe installs torchaudio, clones icefall under /workspace, and adds it to PYTHONPATH. The Dockerfile excerpt ends at an incomplete clone line, so it does not establish a runnable image build, a server command, an exposed port, or model mounts.
For direct integration, use the CMake or Python packaging path as appropriate and provision a compatible pretrained model. Profile RAM, VRAM where applicable, and real-time performance under representative stream concurrency rather than sizing from the base image. The January 8–10, 2025 releases are labeled speaker-segmentation-models, vad-models, and speaker-recognition-models; those names do not establish runtime changes or a unified API for these tasks.
python-api-examples/, and a WebSocket service path.websockets, kaldifeat, sentencepiece>=0.1.96, and numpy are listed in requirements.txt.22.12-py3 and k2 1.24.4.dev20240223+cuda11.7.torch1.13.1.Teams self-hosting pretrained transducer or CTC speech recognition through a C++ or Python API or a WebSocket service, with the capacity to maintain a PyTorch runtime.
You need a PyTorch-free mobile or embedded runtime, a training framework, or a managed transcription API that removes inference operations from your team.
Comparison vs. Top Voice, Vision & Video Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| sherpa ★ | 1k | +1 | C++ | Apache-2.0 | Self-hosted speech-to-text with PyTorch transducer and CTC models |
| WhisperLiveKit | 11.3k | +27 | Python | Apache-2.0 | Self-hosted streaming speech-to-text with pluggable ASR and speaker diarization |
| sherpa-onnx | 16.4k | +136 | C++ | Apache-2.0 | C++ and ONNX Runtime SDK for offline speech and real-time transcription |
| whisperX | 26.5k | +677 | Python | BSD-2-Clause | Batched Whisper with forced alignment for word timings and optional speaker labe |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/k2-fsa/sherpa.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about sherpa
Should I embed sherpa or run it as a separate service?
How much RAM or VRAM should I provision?
Can I self-host sherpa in a commercial product?
When should I choose sherpa over sherpa-onnx, sherpa-ncnn, or a managed Whisper API?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
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