skillfed

model-compression-toolkit

A Model Compression Toolkit for neural networks

model-compression-toolkit v2.6.0 115.2K downloads/30d#12,262 on PyPI
Permissive license Active released

What it is and what it does

Model Compression Toolkit is a library for reducing the size and computational cost of neural networks through quantization, pruning, and hardware-aware optimization. It supports three main quantization workflows: post-training quantization (PTQ, low computational cost), gradient-based post-training quantization (GPTQ, moderate cost), and quantization-aware training (QAT, high cost). The toolkit takes a pre-trained floating-point model (PyTorch or Keras) and applies compression techniques to produce a smaller, faster model suitable for edge deployment.

The package includes advanced features like mixed-precision bit-width search per layer, graph optimizations, quantization parameter tuning, data-free synthetic data generation from batch normalization statistics, structured pruning, and hardware-aware optimization via Target Platform Capabilities (TPC). It provides visualization and debugging tools through TensorBoard integration and a network editor for manual quantization configuration. With 14 runtime dependencies covering numerical computing, visualization, and ML frameworks, it integrates into standard ML pipelines.

Use it for:

  • Reduce inference latency and memory footprint of trained PyTorch or Keras models for deployment on resource-constrained edge devices.
  • Perform post-training quantization on existing models without retraining, when representative data is available or can be synthetically generated.
  • Search for optimal per-layer bit-widths across a model to balance accuracy and compression for a specific hardware target.
  • Generate synthetic training data from model statistics when real representative data is unavailable, enabling quantization without access to original datasets.
  • Debug and visualize quantization impact on model layers using TensorBoard and adjust per-layer quantization settings via the network editor.
  • Prune redundant channels from neural network layers to reduce model complexity and improve hardware utilization.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Compresses and optimizes neural networks through quantization, pruning, and hardware-aware techniques, reducing model size and computational cost for edge deployment.

Yes. The package is actively maintained, has low install friction, carries a permissive Apache 2.0 license, and addresses a real production need (model compression for edge deployment). It supports both PyTorch and Keras, offers multiple quantization strategies with varying computational costs, and includes practical features like data-free quantization and hardware-aware optimization. Install it if you need to compress trained models for deployment; the main constraint is the Python >=3.10 requirement and the need to provide a pre-trained model as input.

Install

model-compression-toolkit on PyPI

pip

pip install model-compression-toolkit

uv

uv add model-compression-toolkit

poetry

poetry add model-compression-toolkit

Installing model-compression-toolkit

Before you install

Low install friction with a pure-Python wheel distribution. Active maintenance status and a large dependency set (14 runtime packages including numpy, scikit-learn, tensorboard, protobuf) that are all standard ML libraries, so resolution is straightforward on modern systems.

License in practice

Apache 2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for production deployment in most organizational contexts.

Quickstart

pip install model-compression-toolkit

from model_compression_toolkit import pytorch_post_training_quantization

# Quantize a pre-trained PyTorch model
quantized_model = pytorch_post_training_quantization(model, representative_data_gen)

Requires Python >=3.10 and a pre-trained floating-point model (PyTorch or Keras) as input; PyTorch >=2.3 or TensorFlow >=2.14 must be installed separately.

Verify before relying

  • Whether the package supports quantization-aware training (QAT) end-to-end or requires external training loop integration.
  • Compatibility with newer PyTorch/TensorFlow versions beyond the minimum specified.
  • Performance benchmarks for quantized model inference speed and accuracy trade-offs on target hardware.
  • Whether data generation capability works with non-image models or only vision tasks.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 14 — networkx, tqdm, Pillow, numpy, scikit-image, scikit-learn, tensorboard, PuLP, matplotlib, scipy, protobuf, mct-quantizers, pydantic, edge-mdt-cl
Maintenance actively maintained — 163 days since the last release
First released
Downloads 115,244/month — #12,262 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: model_compression_toolkit-2.6.0-py3-none-any.whl

License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

neural network quantizationmodel compression pytorch keraspost-training quantization ptqmixed-precision quantization searchhardware-aware model optimizationstructured pruning neural networksedge model deployment optimization
model-optimizationquantizationedge-deployment

More Artificial Intelligence packages

Further reading