Skip to main content

ONNX ASR

PyPI - Version PyPI - Downloads PyPI - Python Version PyPI - Types PyPI - License
uv Ruff mypy Material for MkDocs CodeFactor Grade Codecov GitHub - CI

onnx-asr is a Python package for Automatic Speech Recognition using ONNX models. It's a lightweight, fast, and easy-to-use pure Python package with minimal dependencies (no need for PyTorch, Transformers, or FFmpeg):

numpy onnxruntime huggingface-hub

Key features of onnx-asr include:

  • Supports many modern ASR models
  • Runs on a wide range of devices, from small IoT/edge devices to servers with powerful GPUs (benchmarks)
  • Works on Windows, Linux, and macOS on x86 and Arm CPUs, with support for CUDA, TensorRT, CoreML, DirectML, ROCm, and WebGPU
  • Supports NumPy versions from 1.22 to 2.4+ and Python versions from 3.10 to 3.14
  • Loads models from Hugging Face or local directories, including quantized versions
  • Accepts WAV files or NumPy arrays, with built-in file reading and resampling
  • Supports custom models (see the Conversion Guide for instructions)
  • Supports batch processing
  • Supports long-form recognition using VAD (Voice Activity Detection)
  • Can return token-level timestamps and log probabilities
  • Provides a fully typed and well-documented Python API
  • Provides a simple command-line interface (CLI)

Quick Start

Install onnx-asr:

pip install onnx-asr[cpu,hub]

Load a model and recognize a WAV file:

import onnx_asr

# Load the Parakeet TDT v3 model from Hugging Face (may take a few minutes)
model = onnx_asr.load_model("nemo-parakeet-tdt-0.6b-v3")

# Recognize speech and print the result
result = model.recognize("test.wav")
print(result)

For more examples, see the Usage Guide.

See the Installation Guide for detailed installation instructions.

Supported Model Architectures

The package supports the following modern ASR model architectures. See supported model names for a complete list and the model comparison for comparisons with the original implementations.

  • NVIDIA NeMo Conformer/FastConformer/Parakeet/Canary (with CTC, RNN-T, TDT, and Transformer decoders)
  • GigaChat GigaAM v2/v3/Multilingual (with CTC and RNN-T decoders, including E2E versions)
  • Kaldi Icefall Zipformer (with a stateless RNN-T decoder), including Alpha Cephei Vosk 0.52+
  • T-Tech T-one (with a CTC decoder; streaming is not yet supported)
  • OpenAI Whisper

When these models are saved in ONNX format, typically only the encoder and decoder are included. Running them requires the corresponding preprocessing and decoding implementations. This package provides both for all supported models:

  • Log-mel spectrogram preprocessors
  • Greedy search decoding

Benchmarks

Inverse Real-Time Factor (RTFx) is the ratio of audio duration to processing time. An RTFx greater than 1 indicates faster-than-real-time processing; higher values indicate better performance.

Model 9800X3D CPU (RTFx) Cortex A53 CPU (RTFx) T4 CUDA (RTFx) RTX 5070 Ti TensorRT (RTFx)
NeMo Parakeet v2/v3 36 1.0 57 320
NeMo Canary v2 8 N/A 21 36
GigaAM v3 CTC 59 1.6 84 1370
GigaAM v3 RNN-T 43 1.5 40 130

See the Benchmarks page for detailed performance benchmarks.

Troubleshooting and FAQ

See the Troubleshooting Guide for common issues and solutions.

For more help, check the GitHub Issues or open a new one.

License

MIT License

Metadata

Release files for onnx-asr 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onnx-asr 0.12.0
File Size Uploaded
onnx_asr-0.12.0.tar.gz 46.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onnx-asr 0.12.0
File Interpreter ABI Platform
onnx_asr-0.12.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.0 MB

Release files / onnx_asr-0.12.0.tar.gz

Download URL onnx_asr-0.12.0.tar.gz
Size 46.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c1fcacddbced392f9f769ed5c6223f4ce739a6e4549346de33b9b520d4ead713
BLAKE2b-256 checksum
How to use checksums
4c11136f556cda02ecc172674dcea79232e9e84e74b951bbcd2e2722117f633b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / onnx_asr-0.12.0-py3-none-any.whl

Download URL onnx_asr-0.12.0-py3-none-any.whl
Size 4.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5e7ceca454609819ea7833f61e2302e0c8f6ece4f8a78b66c5daba53cb51de4a
BLAKE2b-256 checksum
How to use checksums
6a602fa469a2ee674c35ab48821a1039762ae7b9d0b88188ac1012e779477f76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.12.0 This release

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page