# tensorflow/model-optimization

A toolkit to optimize ML models for deployment for Keras and TensorFlow, including quantization and pruning.

Repository: https://github.com/tensorflow/model-optimization
Canonical: https://ross.abutalabs.com/products/model-optimization
Homepage: https://www.tensorflow.org/model_optimization
Language: Python
License: Apache-2.0
License Family: permissive
Topics: tensorflow, machine-learning, deep-learning, optimization, quantized-neural-networks, quantized-networks, quantized-training, keras, model-compression, compression, ml, pruning, sparsity, quantization
Last push: 2026-08-24T15:24:49+00:00

## Health v2 (maintenance only)
Score: 82/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 51, longevity 100
- inputs: {"age_days": 2863, "days_push": 9, "days_rel": 113, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1578, forks 346 (observed 2026-08-28T04:05:06.258501+00:00)

## What it is
The TensorFlow Model Optimization Toolkit (tfmot) is a Python library providing tools to optimize machine learning models for deployment, including quantization, pruning for sparsity, and weight clustering, with APIs built for Keras. It helps reduce model latency, size, and power consumption for cloud and edge inference.

## Use cases
- quantize a trained Keras model for TensorFlow Lite deployment
- prune neural network weights to increase sparsity and shrink model size
- reduce model latency and memory footprint on mobile and IoT devices
- cluster model weights to improve compression for deployment
- compress a deep learning model to fit edge device storage limits
- speed up inference cost for models served in the cloud

## When to choose
- you deploy TensorFlow or Keras models to mobile, IoT, or other edge devices with tight memory, power, or latency budgets
- you want post-training or quantization-aware training with stable Keras APIs
- you need smaller model files for download or on-device storage
- you target hardware accelerators that benefit from quantized or sparse weights

## When to avoid
- your models are built with PyTorch, JAX, or other non-TensorFlow frameworks
- you need general-purpose model compression outside the TensorFlow ecosystem
- you require cutting-edge optimization techniques not covered by quantization, pruning, or clustering
- your models run only on servers with no resource constraints

## Facets
- artifact type: library
- maturity: stable
- function: machine-learning, deep-learning, llm-training
- domain: machine-learning, deep-learning, mobile-development, iot, performance
- platform: python, cross-platform
- tags: quantization, pruning, sparsity, model-compression, keras, tensorflow, edge-deployment, model-optimization

## Member repositories
- tensorflow/model-optimization (main) score 82

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:06.258501+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:56:57.241280+00:00, confidence not recorded.
  - readme: https://github.com/tensorflow/model-optimization (fetched 2026-08-28T04:05:06.258501+00:00, sha f9e42594ef32)
  - homepage: https://www.tensorflow.org/model_optimization (fetched 2026-08-29T11:27:32.611171+00:00, sha 11f099771809)
  - site_page: https://www.tensorflow.org/install (fetched 2026-08-29T11:27:32.637325+00:00, sha 584a762da891)
  - site_page: https://www.tensorflow.org/tfx/api_docs (fetched 2026-08-29T11:27:32.641999+00:00, sha 6977825696fe)
  - site_page: https://www.tensorflow.org/about (fetched 2026-08-29T11:27:32.645576+00:00, sha 817250744d91)
  - site_page: https://www.tensorflow.org/about/case-studies (fetched 2026-08-29T11:27:32.647575+00:00, sha e6701029eec0)
  - site_page: https://www.tensorflow.org/model_optimization/api_docs/python/tfmot (fetched 2026-08-29T11:27:32.649580+00:00, sha 94d910a9b017)
  - site_page: https://www.tensorflow.org/about/bib (fetched 2026-08-29T11:27:32.651111+00:00, sha 5ca8943386b9)
  - site_page: https://www.tensorflow.org/community/contribute (fetched 2026-08-29T11:27:32.643815+00:00, sha 77d394fa76e7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
