onnxruntime-genai
ONNX Runtime GenAI
What it is and what it does
ONNX Runtime GenAI is a Python library that wraps ONNX Runtime to simplify inference of language models and multi-modal models. It abstracts away the complexity of loading ONNX model files and managing inference sessions, letting you focus on running models rather than configuring the runtime. The library depends on numpy and onnxruntime, and is distributed as pre-built wheels across Windows, Linux, and macOS on both x86 and ARM architectures.
The package is intended for scenarios where you want to deploy or experiment with LLMs and SLMs locally or in cloud environments without relying on external APIs. It bridges the gap between raw ONNX Runtime (a low-level inference engine) and high-level model frameworks, offering a middle ground for developers who have ONNX-converted models and want a straightforward Python interface to run them.
Use it for:
- Deploy a quantized LLM locally on a laptop or edge device for inference without cloud API calls
- Run multi-modal models in a Python application using pre-converted ONNX weights
- Integrate on-device SLM inference into a web service or backend for low-latency responses
- Experiment with different model architectures by swapping ONNX model files without code changes
- Build a chatbot or text-generation pipeline that runs entirely on-premises for privacy
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Runs small and large language models and multi-modal models on-device and in the cloud using ONNX Runtime as the execution backend.
Yes, if you have ONNX-converted models and want a straightforward Python interface to run them on-device or in the cloud. The library is actively maintained, has no known vulnerabilities, and offers broad platform coverage. Install only if you already have or plan to convert models to ONNX format; it is not a model hub or download tool.
Install
onnxruntime-genai on PyPI
pip
pip install onnxruntime-genaiuv
uv add onnxruntime-genaipoetry
poetry add onnxruntime-genaiInstalling onnxruntime-genai
Before you install
Medium install friction due to pre-built wheels for multiple Python versions and platforms. Active maintenance with a release 8 days old.
License in practice
MIT License permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install onnxruntime-genai
import onnxruntime_genai
# Load and run a model via the ONNX Runtime GenAI API
Requires numpy and onnxruntime as runtime dependencies; model files and platform-specific ONNX Runtime support are prerequisites.
Verify before relying
- Specific model formats and sizes supported by this version
- Performance characteristics (latency, throughput) on different hardware
- Whether quantization or optimization tooling is included
- API stability and backward compatibility guarantees
- Python version requirements (requires_python field is unspecified)
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — numpy, onnxruntime |
| Maintenance | actively maintained — 8 days since the last release |
| First released | |
| Downloads | 131,825/month — #11,573 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: onnxruntime_genai-0.15.2-cp311-cp311-macosx_12_0_arm64.whl; onnxruntime_genai-0.15.2-cp311-cp311-manylinux_2_28_aarch64.whl; onnxruntime_genai-0.15.2-cp311-cp311-manylinux_2_28_x86_64.whl; onnxruntime_genai-0.15.2-cp311-cp311-win_amd64.whl; onnxruntime_genai-0.15.2-cp311-cp311-win_arm64.whl; onnxruntime_genai-0.15.2-cp312-cp312-macosx_12_0_arm64.whl; onnxruntime_genai-0.15.2-cp312-cp312-manylinux_2_28_aarch64.whl; onnxruntime_genai-0.15.2-cp312-cp312-manylinux_2_28_x86_64.whl; onnxruntime_genai-0.15.2-cp312-cp312-win_amd64.whl; onnxruntime_genai-0.15.2-cp312-cp312-win_arm64.whl; onnxruntime_genai-0.15.2-cp313-cp313-macosx_12_0_arm64.whl; onnxruntime_genai-0.15.2-cp313-cp313-manylinux_2_28_aarch64.whl; onnxruntime_genai-0.15.2-cp313-cp313-manylinux_2_28_x86_64.whl; onnxruntime_genai-0.15.2-cp313-cp313-win_amd64.whl; onnxruntime_genai-0.15.2-cp313-cp313-win_arm64.whl; onnxruntime_genai-0.15.2-cp314-cp314-macosx_12_0_arm64.whl; onnxruntime_genai-0.15.2-cp314-cp314-manylinux_2_28_aarch64.whl; onnxruntime_genai-0.15.2-cp314-cp314-manylinux_2_28_x86_64.whl; onnxruntime_genai-0.15.2-cp314-cp314-win_amd64.whl; onnxruntime_genai-0.15.2-cp314-cp314-win_arm64.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
onnxruntime-openvinoEnables ONNX Runtime to accelerate machine…
permissive · top 15,000 on PyPI
litert-lm-builderProvides Python tools for building, inspecting,…
permissive · top 15,000 on PyPI
optimum-onnxExports Hugging Face transformer models to ONNX…
permissive · top 15,000 on PyPI
tflite-runtimeTensorFlow Lite runtime enables on-device…
permissive · top 15,000 on PyPI
ai-edge-litertai-edge-litert runs machine learning models on…
permissive · top 15,000 on PyPI
optimumOptimum provides optimization tools to export…
permissive · top 5,000 on PyPI
onnxslimOnnxSlim reduces the size and operator count of…
permissive · top 5,000 on PyPI
executorchExecuTorch exports and runs PyTorch models on…
permissive · top 15,000 on PyPI
openvino-genaiopenvino-genai simplifies running inference on…
permissive · top 15,000 on PyPI
genai-perfGenAI-Perf is a command-line tool for measuring…
permissive · top 15,000 on PyPI