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
Release files for onnxslim 0.1.97
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| onnxslim-0.1.97.tar.gz | 606.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| onnxslim-0.1.97-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 850.6 kB
Release files / onnxslim-0.1.97.tar.gz
| Download URL | onnxslim-0.1.97.tar.gz |
|---|---|
| Size | 606.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
036d0db5e1aca6464325f2d1f65c6685a77bed49a7ac78815e19104025500d55
|
|
BLAKE2b-256 checksum How to use checksums |
813b6da464bf24226d9ca0a129030b92c88b71173fd5e4114d66b2f102961dff
|
| 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.97-py3-none-any.whl
| Download URL | onnxslim-0.1.97-py3-none-any.whl |
|---|---|
| Size | 244.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a775941253a00db3621c301e225266d89bd4426ba6bc4d38e533bdcd03db752c
|
|
BLAKE2b-256 checksum How to use checksums |
a776a3caa0489cc7722fe9d14cd2f58790c95bbc0fb21b9f226e3bedbaf42a6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|