--- id: model-compression-toolkit version: "2.6.0" license: unclear license_treatment: permissive maintenance: active --- # model-compression-toolkit — A Model Compression Toolkit for neural networks License: permissive · Maintenance: active · Downloads: 115.2K/mo ## 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 above — 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 pip install model-compression-toolkit uv add model-compression-toolkit 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_current - Install friction: low - Maintenance: active - Downloads: 115.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags neural network quantization, model compression pytorch keras, post-training quantization ptq, mixed-precision quantization search, hardware-aware model optimization, structured pruning neural networks, edge model deployment optimization, model-optimization, quantization, edge-deployment [View on SkillFed](https://skillfed.io/packages/model-compression-toolkit) · [View on PyPI](https://pypi.org/project/model-compression-toolkit/)