model-compression-toolkit
A Model Compression Toolkit for neural networks
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-toolkituv
uv add model-compression-toolkitpoetry
poetry add model-compression-toolkitInstalling 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
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
compressed-tensorsProvides a unified format for storing and…
permissive · top 5,000 on PyPI
edge-mdt-clProvides custom neural network layers for…
permissive · top 15,000 on PyPI
nncfNNCF provides post-training and training-time…
permissive · top 5,000 on PyPI
tensorflow-model-optimizationProvides quantization, pruning, and clustering…
permissive · top 15,000 on PyPI
nvidia-modeloptApplies state-of-the-art model optimization…
permissive · top 15,000 on PyPI
ai-edge-quantizerQuantizes LiteRT models to reduce size and…
permissive · top 15,000 on PyPI
auto-gptqQuantizes large language models to lower…
permissive · top 15,000 on PyPI
qwixQwix is a JAX quantization library that applies…
permissive · top 15,000 on PyPI
segmentation-models-pytorchProvides PyTorch-based neural network models…
permissive · top 15,000 on PyPI
diffqDiffQ performs differentiable quantization of…
noncommercial · top 15,000 on PyPI