skillfed

sde4onnx

Simple doc_string eraser for ONNX.

sde4onnx v1.0.0 82.6K downloads/30d#14,154 on PyPI1
Permissive license MIT License Abandoned released

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 sde4onnx

uv

uv add sde4onnx

poetry

poetry add sde4onnx

Installing 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

onnx model doc string removalstrip metadata from onnx filesonnx file size reductiononnx graph cleaningremove onnx documentationonnx model optimizationonnx serialization cleanup
onnx-toolsmodel-optimization

More Artificial Intelligence packages