OnnxSlim: A Toolkit to Help Optimize Onnx Model
Project description
OnnxSlim can help you slim your onnx model, with less operators, but same accuracy, better inference speed.
- 🚀 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
onnxslim-0.1.83.tar.gz
(591.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
onnxslim-0.1.83-py3-none-any.whl
(235.3 kB
view details)
File details
Details for the file onnxslim-0.1.83.tar.gz.
File metadata
- Download URL: onnxslim-0.1.83.tar.gz
- Upload date:
- Size: 591.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03525d57cd5e9d2ae0f9676deafcd0f61f1ff24e1c4e68a8aa6c3523fa99dbc4
|
|
| MD5 |
5ce71791171141dc4dad25a3d31b998f
|
|
| BLAKE2b-256 |
7bad54740db0d81460ec7e22dde3414e741506e3d4acfad1074c99e4cb74946a
|
File details
Details for the file onnxslim-0.1.83-py3-none-any.whl.
File metadata
- Download URL: onnxslim-0.1.83-py3-none-any.whl
- Upload date:
- Size: 235.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
392634c969311ccfb704fb13f38b23492dc6f501bad32797f8d554e87a31af87
|
|
| MD5 |
0e7719204f07650f974e087daa02e1cb
|
|
| BLAKE2b-256 |
f6c78dab8ff59f26a58d7c452663c14dc3b7bdc35e19a7d2305167fa1ae58c88
|