sde4onnx
Simple doc_string eraser for ONNX.
What it is and what it does
sde4onnx is a lightweight utility that strips embedded documentation strings from ONNX model files. ONNX models—particularly those from Hugging Face or other model hubs—often carry verbose metadata and doc_strings that inflate file size without affecting inference. This tool reads an ONNX file, removes those doc_strings, and writes a cleaned version back to disk or returns the modified graph object for further processing.
The package offers both a command-line interface and a Python API. It has no runtime dependencies beyond ONNX itself (which you must install separately) and runs as pure Python. It is designed for a single, narrow task: if you need to reduce ONNX model size by stripping documentation, this tool does that. However, the project is no longer maintained—the last release and commit were in October 2022—so it may not adapt to future ONNX format changes.
Use it for:
- Reduce download and storage size of Stable Diffusion or other large ONNX models before deployment.
- Strip metadata from ONNX graphs in a preprocessing pipeline before quantization or optimization.
- Clean up ONNX files exported from frameworks like PyTorch or TensorFlow before shipping to edge devices.
- Automate doc_string removal in batch processing of model repositories.
- Integrate into CI/CD workflows to standardize ONNX artifacts by removing non-essential metadata.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Removes embedded doc_strings from ONNX model files, reducing file size and metadata bloat in serialized neural network graphs.
Yes, if you have a specific need to reduce ONNX file size by removing doc_strings and are willing to accept that the package is no longer maintained. The tool is simple, has no dependencies, and the task it performs is unlikely to break. No, if you expect ongoing support, compatibility updates, or if you need more comprehensive ONNX optimization—consider ONNX Runtime tools or TensorRT ONNX GraphSurgeon instead.
Install
sde4onnx on PyPI
pip
pip install sde4onnxuv
uv add sde4onnxpoetry
poetry add sde4onnxInstalling sde4onnx
Before you install
Low friction: pure Python wheel with no runtime dependencies. However, the package is abandoned—last release was 2022-10-15 and no commits since then. Use only if the single task of doc_string erasure is stable enough for your workflow.
License in practice
MIT License permits commercial and private use with minimal restrictions. No licensing barrier to adoption.
Quickstart
pip install sde4onnx
from sde4onnx import erase
onnx_graph = erase(
input_onnx_file_path="model.onnx",
output_onnx_file_path="model_erased.onnx"
)
Requires Python >=3.6. ONNX library must be installed separately (not declared as a dependency in sde4onnx itself).
Verify before relying
- Whether the package correctly handles all ONNX model variants and versions beyond the Stable Diffusion use case shown in docs.
- Whether abandonment since 2022-10-15 means compatibility issues with current ONNX spec or Python versions.
- Performance impact of doc_string erasure on model loading or inference speed.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,399 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,554/month — #14,154 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sde4onnx-1.0.0-py3-none-any.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
snd4onnxRemoves specified nodes from ONNX model graphs…
permissive · top 15,000 on PyPI
ssi4onnxInfers and fills missing tensor shape…
permissive · top 15,000 on PyPI
sod4onnxsod4onnx removes specified output operations…
permissive · top 15,000 on PyPI
spo4onnxApplies specialized optimization techniques to…
permissive · top 15,000 on PyPI
sne4onnxExtracts subgraphs from ONNX model files by…
permissive · top 15,000 on PyPI
scs4onnxCompresses ONNX model files by deduplicating…
permissive · top 15,000 on PyPI
sor4onnxRenames input, output, and operator nodes in…
permissive · top 15,000 on PyPI
sbi4onnxModifies ONNX model files to initialize or…
permissive · top 15,000 on PyPI
sng4onnxAutomatically generates and assigns operation…
permissive · top 15,000 on PyPI
sed4onnxEncodes and decodes Base64-formatted constant…
permissive · top 15,000 on PyPI