OnnxSlim can help you slim your onnx model, with less operators, but same accuracy, better inference speed.
- 🚀 2026/06/02: Achieved 10M downloads
- 🚀 2026/01/04: Achieved 5M downloads
- 🚀 2025/11/29: Top 1% on PyPI
- 🚀 2025/11/27: OnnxSlim is merged into NVIDIA TensorRT-Model-Optimizer 🤗🤗🤗
- 🚀 2025/05/17: OnnxSlim is merged into HuggingFace optimum 🤗🤗🤗
- 🚀 2025/04/30: Rank 1st in the AICAS 2025 LLM inference optimization challenge
- 🚀 2025/01/28: Achieved 1M downloads
- 🚀 2024/06/23: OnnxSlim is merged into transformers.js 🤗🤗🤗
- 🚀 2024/06/02: OnnxSlim is merged into ultralytics ❤️❤️❤️
- 🚀 2024/04/30: Rank 1st in the AICAS 2024 LLM inference optimization challenge held by Arm and T-head
- 🚀 2024/01/25: OnnxSlim is merged to mnn-llm, performance increased by 5%
Installation
Using Prebuilt
pip install onnxslim
Install From Source
pip install git+https://github.com/inisis/OnnxSlim@main
Install From Local
git clone https://github.com/inisis/OnnxSlim && cd OnnxSlim/
pip install .
How to use
Bash
onnxslim your_onnx_model slimmed_onnx_model
Inscript
import onnx
import onnxslim
model = onnx.load("model.onnx")
slimmed_model = onnxslim.slim(model)
if slimmed_model:
onnx.save(slimmed_model, "slimmed_model.onnx")
For more usage, see onnxslim -h or refer to our examples
Projects using OnnxSlim
References
Contributors
Contact
Discord: https://discord.gg/nRw2Fd3VUS QQ Group: 873569894
Metadata
Release files for onnxslim 0.1.99
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| onnxslim-0.1.99.tar.gz | 616.1 kB | Without provenance | Details for onnxslim-0.1.99.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onnxslim-0.1.99-py3-none-any.whl | Python 3 | none | any | Details for onnxslim-0.1.99-py3-none-any.whl |
Total release size: 864.6 kB
Release files / onnxslim-0.1.99.tar.gz
| Download URL | onnxslim-0.1.99.tar.gz |
|---|---|
| Size | 616.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d662d6a6c384b64fe7464527a5865020c4335f8619a4a1272512ca0cc266867c
|
|
BLAKE2b-256 checksum How to use checksums |
feac8610e7274fe6bf26b6269f91de5a2acd03bfa2133153e691fc93f71a6f64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / onnxslim-0.1.99-py3-none-any.whl
| Download URL | onnxslim-0.1.99-py3-none-any.whl |
|---|---|
| Size | 248.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c6a3ddbbb7c5426f8f9c38ed1917bb4ab6335919c7d973328ba520faca469e4
|
|
BLAKE2b-256 checksum How to use checksums |
76d1063874f0c02d3c00a169bce3ccf24a4f42ffbc4263d4b1593499c39f7a4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for onnxslim 0.1.99
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.