sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
Loading...
Searching...
No Matches
Non-Streaming (Offline) ASR Models

sherpa-onnx supports many non-streaming ASR model families through the SherpaOnnxCreateOfflineRecognizer() API. Configure exactly one model family by filling in the corresponding sub-struct of SherpaOnnxOfflineModelConfig.

See also
SherpaOnnxCreateOfflineRecognizer, SherpaOnnxOfflineRecognizerConfig, SherpaOnnxOfflineModelConfig

Zipformer Transducer

Zipformer transducer is a general-purpose offline ASR model using the encoder-decoder-joiner architecture.

memset(&config, 0, sizeof(config));
config.feat_config.sample_rate = 16000;
"./sherpa-onnx-zipformer-small-en-2023-06-26/encoder-epoch-99-avg-1.onnx";
"./sherpa-onnx-zipformer-small-en-2023-06-26/decoder-epoch-99-avg-1.onnx";
"./sherpa-onnx-zipformer-small-en-2023-06-26/joiner-epoch-99-avg-1.onnx";
"./sherpa-onnx-zipformer-small-en-2023-06-26/tokens.txt";
config.model_config.provider = "cpu";
config.decoding_method = "greedy_search";
const SherpaOnnxOfflineRecognizer *recognizer =
const SherpaOnnxOfflineRecognizer * SherpaOnnxCreateOfflineRecognizer(const SherpaOnnxOfflineRecognizerConfig *config)
Create a non-streaming ASR recognizer.
struct SherpaOnnxOfflineRecognizer SherpaOnnxOfflineRecognizer
Non-streaming recognizer handle.
Definition c-api.h:1221
SherpaOnnxOfflineTransducerModelConfig transducer
Definition c-api.h:1080
Configuration for a non-streaming ASR recognizer.
Definition c-api.h:1188
SherpaOnnxOfflineModelConfig model_config
Definition c-api.h:1192
SherpaOnnxFeatureConfig feat_config
Definition c-api.h:1190

Model package: sherpa-onnx-zipformer-small-en-2023-06-26

Example source: zipformer-c-api.c

Zipformer CTC

Zipformer CTC uses CTC decoding instead of transducer decoding.

"./sherpa-onnx-zipformer-ctc-zh-int8-2025-07-03/model.int8.onnx";
"./sherpa-onnx-zipformer-ctc-zh-int8-2025-07-03/tokens.txt";
SherpaOnnxOfflineZipformerCtcModelConfig zipformer_ctc
Definition c-api.h:1115

Model package: sherpa-onnx-zipformer-ctc-zh-int8-2025-07-03

Whisper

Whisper is OpenAI's general-purpose speech recognition model. It supports language hints and translation.

memset(&config, 0, sizeof(config));
config.feat_config.sample_rate = 16000;
"./sherpa-onnx-whisper-tiny/tiny-encoder.onnx";
"./sherpa-onnx-whisper-tiny/tiny-decoder.onnx";
config.model_config.whisper.task = "transcribe";
"./sherpa-onnx-whisper-tiny/tiny-tokens.txt";
config.model_config.provider = "cpu";
config.decoding_method = "greedy_search";
const SherpaOnnxOfflineRecognizer *recognizer =
SherpaOnnxOfflineWhisperModelConfig whisper
Definition c-api.h:1086

Model package: sherpa-onnx-whisper-tiny

Example source: whisper-c-api.c

For automatic language detection with a multilingual ONNX Whisper model, set config.model_config.whisper.language = "" before creating the recognizer. To restrict that detection for one stream, set language_candidates before decoding:

const SherpaOnnxOfflineRecognizer *automatic_recognizer =
const SherpaOnnxOfflineStream *stream =
SherpaOnnxCreateOfflineStream(automatic_recognizer);
SherpaOnnxOfflineStreamSetOption(stream, "language_candidates", "nl,ru,en");
struct SherpaOnnxOfflineStream SherpaOnnxOfflineStream
Non-streaming decoding state for one utterance.
Definition c-api.h:1224
void SherpaOnnxOfflineStreamSetOption(const SherpaOnnxOfflineStream *stream, const char *key, const char *value)
Set a per-stream runtime option for offline ASR.
const SherpaOnnxOfflineStream * SherpaOnnxCreateOfflineStream(const SherpaOnnxOfflineRecognizer *recognizer)
Create a non-streaming ASR input stream.

Accept audio and decode the stream as usual. The existing result lang field contains the selected input language. Selection compares only the candidate language-token logits, reuses the encoder output, and produces one transcript; it does not run a separate recognition for each candidate.

The value is a comma-separated list of exact language codes supported by the loaded model. Surrounding whitespace is trimmed; one candidate is allowed. An empty value, empty item (including a trailing comma), duplicate code, or unknown code is invalid. Codes are case-sensitive, with no alias conversion. The first candidate wins an exact logit tie.

For the standard ONNX recognizer, an invalid list, a nonempty fixed language, or an English-only model causes a diagnostic log and an empty result before encoder execution. Any previous result on that stream is cleared. The process is not terminated, and detection does not fall back to unrestricted selection. There is no separate error status: an empty result alone does not distinguish an option error from other empty recognition results. QNN and Ascend Whisper recognizers warn and ignore this option, continuing normal recognition without restricting the language to the candidate list.

Omitting the option preserves the existing behavior. The option does not change the recognizer configuration, other streams, or the separate spoken-language identification API. An empty value does not remove the restriction; use a new stream without the option for unrestricted detection. Candidate restriction does not guarantee transcript accuracy or detect silence or out-of-list speech.

SenseVoice

SenseVoice is a multilingual model supporting Chinese, English, Japanese, Korean, and Cantonese. It supports automatic language detection and inverse text normalization.

"./sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17-int8/model.int8.onnx";
"./sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17-int8/tokens.txt";
SherpaOnnxOfflineSenseVoiceModelConfig sense_voice
Definition c-api.h:1107

Model package: sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17-int8

Example source: sense-voice-c-api.c

NeMo Parakeet TDT

Parakeet TDT is an NVIDIA NeMo transducer model. Set model_type to "nemo_transducer" so the runtime selects the correct decoder implementation.

"./sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8/encoder.int8.onnx";
"./sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8/decoder.int8.onnx";
"./sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8/joiner.int8.onnx";
"./sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8/tokens.txt";
config.model_config.model_type = "nemo_transducer";

Model package: sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8

Example source: nemo-parakeet-c-api.c

GigaAM v2 (NeMo Transducer, Russian)

GigaAM v2 is a NeMo transducer model for Russian speech recognition. Like Parakeet, set model_type to "nemo_transducer".

"./sherpa-onnx-nemo-transducer-giga-am-v2-russian-2025-04-19/"
"encoder.int8.onnx";
"./sherpa-onnx-nemo-transducer-giga-am-v2-russian-2025-04-19/"
"decoder.onnx";
"./sherpa-onnx-nemo-transducer-giga-am-v2-russian-2025-04-19/"
"joiner.onnx";
"./sherpa-onnx-nemo-transducer-giga-am-v2-russian-2025-04-19/"
"tokens.txt";
config.model_config.model_type = "nemo_transducer";

Model package: sherpa-onnx-nemo-transducer-giga-am-v2-russian-2025-04-19

Example source: nemo-giga-am-v2-c-api.c

NeMo CTC

NeMo CTC models use CTC decoding. They are simpler than NeMo transducer models (no joiner network).

"./sherpa-onnx-nemo-ctc-en-citrinet-512/model.onnx";
"./sherpa-onnx-nemo-ctc-en-citrinet-512/tokens.txt";
SherpaOnnxOfflineNemoEncDecCtcModelConfig nemo_ctc
Definition c-api.h:1084

Model package: sherpa-onnx-nemo-ctc-en-citrinet-512

Example source: nemo-ctc-c-api.c

Paraformer

Paraformer is a non-autoregressive ASR model from FunASR.

"./sherpa-onnx-paraformer-zh-small-2024-03-09/model.int8.onnx";
"./sherpa-onnx-paraformer-zh-small-2024-03-09/tokens.txt";
SherpaOnnxOfflineParaformerModelConfig paraformer
Definition c-api.h:1082

Model package: sherpa-onnx-paraformer-zh-small-2024-03-09

Example source: paraformer-c-api.c

Moonshine

Moonshine is a compact speech recognition model. It uses a preprocessor, encoder, and decoder (cached or uncached).

"./sherpa-onnx-moonshine-tiny-en-int8/preprocess.onnx";
"./sherpa-onnx-moonshine-tiny-en-int8/encode.int8.onnx";
"./sherpa-onnx-moonshine-tiny-en-int8/uncached_decode.int8.onnx";
"./sherpa-onnx-moonshine-tiny-en-int8/cached_decode.int8.onnx";
"./sherpa-onnx-moonshine-tiny-en-int8/tokens.txt";
SherpaOnnxOfflineMoonshineModelConfig moonshine
Definition c-api.h:1109

Model package: sherpa-onnx-moonshine-tiny-en-int8

Example source: moonshine-c-api.c

FireRedAsr

FireRedAsr is an encoder-decoder ASR model supporting Chinese and English.

"./sherpa-onnx-fire-red-asr-large-zh_en-2025-02-16/encoder.int8.onnx";
"./sherpa-onnx-fire-red-asr-large-zh_en-2025-02-16/decoder.int8.onnx";
"./sherpa-onnx-fire-red-asr-large-zh_en-2025-02-16/tokens.txt";
SherpaOnnxOfflineFireRedAsrModelConfig fire_red_asr
Definition c-api.h:1111

Model package: sherpa-onnx-fire-red-asr-large-zh_en-2025-02-16

Example source: fire-red-asr-c-api.c

FireRedAsr CTC

CTC variant of FireRedAsr.

"./sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25/model.int8.onnx";
"./sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25/tokens.txt";
SherpaOnnxOfflineFireRedAsrCtcModelConfig fire_red_asr_ctc
Definition c-api.h:1127

Model package: sherpa-onnx-fire-red-asr2-ctc-zh_en-int8-2026-02-25

Example source: fire-red-asr-ctc-c-api.c

Dolphin

Dolphin is a multilingual CTC model.

"./sherpa-onnx-dolphin-base-ctc-multi-lang-int8-2025-04-02/model.int8.onnx";
"./sherpa-onnx-dolphin-base-ctc-multi-lang-int8-2025-04-02/tokens.txt";
SherpaOnnxOfflineDolphinModelConfig dolphin
Definition c-api.h:1113

Model package: sherpa-onnx-dolphin-base-ctc-multi-lang-int8-2025-04-02

Example source: dolphin-ctc-c-api.c

NeMo Canary

Canary is an NVIDIA NeMo model supporting English, Spanish, German, and French with source/target language selection and punctuation.

"./sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8/encoder.int8.onnx";
"./sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8/decoder.int8.onnx";
"./sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8/tokens.txt";
SherpaOnnxOfflineCanaryModelConfig canary
Definition c-api.h:1117

Model package: sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8

Example source: nemo-canary-c-api.c

Cohere Transcribe

Cohere Transcribe is a multilingual encoder-decoder model with built-in punctuation and inverse text normalization.

"./sherpa-onnx-cohere-transcribe-14-lang-int8-2026-04-01/encoder.int8.onnx";
"./sherpa-onnx-cohere-transcribe-14-lang-int8-2026-04-01/decoder.int8.onnx";
"./sherpa-onnx-cohere-transcribe-14-lang-int8-2026-04-01/tokens.txt";
SherpaOnnxOfflineCohereTranscribeModelConfig cohere_transcribe
Definition c-api.h:1131

Model package: sherpa-onnx-cohere-transcribe-14-lang-int8-2026-04-01

Example source: cohere-transcribe-c-api.c

WeNet CTC

WeNet CTC models support Chinese, English, and Cantonese.

"./sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10/"
"model.int8.onnx";
"./sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10/"
"tokens.txt";
SherpaOnnxOfflineWenetCtcModelConfig wenet_ctc
Definition c-api.h:1119

Model package: sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10

Example source: wenet-ctc-c-api.c

Omnilingual

Omnilingual is a CTC model supporting 1600 languages.

"./sherpa-onnx-omnilingual-asr-1600-languages-300M-ctc-int8-2025-11-12/"
"model.int8.onnx";
"./sherpa-onnx-omnilingual-asr-1600-languages-300M-ctc-int8-2025-11-12/"
"tokens.txt";
SherpaOnnxOfflineOmnilingualAsrCtcModelConfig omnilingual
Definition c-api.h:1121

Model package: sherpa-onnx-omnilingual-asr-1600-languages-300M-ctc-int8-2025-11-12

Example source: omnilingual-asr-ctc-c-api.c

FunASR Nano

FunASR Nano is an LLM-based ASR model from FunASR.

"./sherpa-onnx-funasr-nano-int8-2025-12-30/encoder_adaptor.int8.onnx";
"./sherpa-onnx-funasr-nano-int8-2025-12-30/embedding.int8.onnx";
"./sherpa-onnx-funasr-nano-int8-2025-12-30/llm.int8.onnx";
"./sherpa-onnx-funasr-nano-int8-2025-12-30/Qwen3-0.6B";
"./sherpa-onnx-funasr-nano-int8-2025-12-30/tokens.txt";
SherpaOnnxOfflineFunASRNanoModelConfig funasr_nano
Definition c-api.h:1125

Model package: sherpa-onnx-funasr-nano-int8-2025-12-30

Before decoding, use SherpaOnnxOfflineStreamSetOption() to override hotwords, language, itn, or user_prompt for a single stream without reloading the model. Unset options use the recognizer configuration. Explicit empty hotwords, language, and user_prompt strings clear the corresponding defaults. For itn, "0" disables and any nonzero integer enables ITN (normally use "1"); empty, unparsable, or out-of-range values fall back to the configured value. These options do not change other streams.

SherpaOnnxOfflineStreamSetOption(stream, "hotwords", "Sherpa,FunASR");

For a custom context prompt, clear any configured hotwords and language and enable ITN so that the nonempty user_prompt is used verbatim:

SherpaOnnxOfflineStreamSetOption(stream, "hotwords", "");
SherpaOnnxOfflineStreamSetOption(stream, "language", "");
SherpaOnnxOfflineStreamSetOption(stream, "user_prompt", "前文:...\n语音转写:");

Otherwise the prompt is built from hotwords, language, and ITN as before. An empty user_prompt selects the standard transcription prompt.

Example source: funasr-nano-c-api.c

Qwen3-ASR

Qwen3-ASR is an LLM-based ASR model from Alibaba.

"./sherpa-onnx-qwen3-asr-0.6B-int8-2026-03-25/conv_frontend.onnx";
"./sherpa-onnx-qwen3-asr-0.6B-int8-2026-03-25/encoder.int8.onnx";
"./sherpa-onnx-qwen3-asr-0.6B-int8-2026-03-25/decoder.int8.onnx";
"./sherpa-onnx-qwen3-asr-0.6B-int8-2026-03-25/tokenizer";
"./sherpa-onnx-qwen3-asr-0.6B-int8-2026-03-25/tokens.txt";
SherpaOnnxOfflineQwen3ASRModelConfig qwen3_asr
Definition c-api.h:1129

Model package: sherpa-onnx-qwen3-asr-0.6B-int8-2026-03-25

Example source: qwen3-asr-c-api.c

MedASR

MedASR is a medical-domain CTC model.

"./sherpa-onnx-medasr-ctc-en-int8-2025-12-25/model.int8.onnx";
"./sherpa-onnx-medasr-ctc-en-int8-2025-12-25/tokens.txt";
SherpaOnnxOfflineMedAsrCtcModelConfig medasr
Definition c-api.h:1123

Model package: sherpa-onnx-medasr-ctc-en-int8-2025-12-25

Example source: medasr-ctc-c-api.c

TeleSpeech CTC

TeleSpeech is a Chinese CTC model. Note the simple string assignment for the model path.

"./sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04/model.int8.onnx";
"./sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04/tokens.txt";
const char * telespeech_ctc
Definition c-api.h:1105

Model package: sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04

Example source: telespeech-c-api.c