{"id":22359,"library":"sherpa-onnx-core","title":"sherpa-onnx Core","description":"Core shared libraries for sherpa-onnx, a cross-platform speech recognition and text-to-speech toolkit. Version 1.12.40 provides the underlying ONNX Runtime-based engines for ASR, VAD, and TTS, with package updates for various platforms. Release cadence is approximately semi-monthly.","status":"active","version":"1.12.40","language":"python","source_language":"en","source_url":"https://github.com/k2-fsa/sherpa-onnx","tags":["asr","tts","onnx","speech-recognition","text-to-speech","vad"],"install":[{"cmd":"pip install sherpa-onnx-core","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"The recommended import is the module-level import; 'from sherpa_onnx import OfflineRecognizer' works but is less conventional.","wrong":"from sherpa_onnx import OfflineRecognizer","symbol":"OfflineRecognizer","correct":"import sherpa_onnx"},{"note":"sherpa-onnx-core does not expose a separate package; everything is under sherpa_onnx.","wrong":"from sherpa_onnx_core import OnlineRecognizer","symbol":"OnlineRecognizer","correct":"import sherpa_onnx"}],"quickstart":{"code":"import sherpa_onnx\n\nrecognizer = sherpa_onnx.OfflineRecognizer.from_models(\n    encoder=\"path/to/encoder.onnx\",\n    decoder=\"path/to/decoder.onnx\",\n    tokens=\"path/to/tokens.txt\",\n)\nwave = sherpa_onnx.read_wave(\"test.wav\")\nresult = recognizer.decode(wave)\nprint(result.text)","lang":"python","description":"Basic offline ASR using pre-downloaded ONNX models."},"warnings":[{"fix":"Install 'sherpa-onnx' instead: pip install sherpa-onnx","message":"The 'sherpa-onnx-core' package only contains shared libraries; the Python API is provided by 'sherpa-onnx'. Installing 'sherpa-onnx-core' alone will not give you importable Python modules.","severity":"gotcha","affected_versions":"all"},{"fix":"Always download the latest model files for your sherpa-onnx version.","message":"Model file formats may change between major releases. Models downloaded for version 1.9 may not work with 1.12.","severity":"breaking","affected_versions":">=1.10"},{"fix":"Use 'OfflineRecognizer.from_models(...)' instead of 'OfflineRecognizer(...)'.","message":"The 'sherpa_onnx.OfflineRecognizer' constructor signature changed in v1.10; 'from_models' is now the preferred factory method.","severity":"deprecated","affected_versions":">=1.10"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install 'sherpa-onnx' (pip install sherpa-onnx) which provides the Python API.","cause":"The 'sherpa-onnx-core' package does not include the Python bindings; only the C libraries.","error":"ImportError: cannot import name 'OfflineRecognizer' from 'sherpa_onnx'"},{"fix":"Run 'pip install sherpa-onnx'.","cause":"Neither 'sherpa-onnx' nor 'sherpa-onnx-core' is installed.","error":"ModuleNotFoundError: No module named 'sherpa_onnx'"},{"fix":"Download the model files from the official model zoo and provide absolute paths.","cause":"The model path is incorrect or the model was not downloaded.","error":"RuntimeError: Model file not found: /path/to/encoder.onnx"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}