Model or dataset
tensorflow/model-optimization avatar
tensorflow/model-optimization

TensorFlow Model Optimization leaves TensorFlow out of its own requirements

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

1,584 stars348 forksPythonApache-2.0

At a glance

What is it?
The toolkit covers quantization and pruning for Keras models, and the most instructive file in the repository is not the README but setup.py, where eight required packages are listed and the framework the project exists to optimize is deliberately not one of them.
Who is it for?
TensorFlow Model Optimization earns its place when you already have a Keras model and want post-training quantization or sparsity applied to it, and it earns a careful read before you install, because the framework it optimizes is not in its own requirement list and its Keras binding is the tf-keras line at 2.14.1 rather than the standalone keras package.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • tensorflow/model-optimization1,584 ★ · +6
Star history
Repository2026-09-112026-11-13
tensorflow/model-optimization1.6k1.6k

6 Stars in the last 63 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The install list never names TensorFlow

The README does not contain an installation command at all. It sends you to a website page for install instructions, and it also sends you to the project site for the overview, the optimization gains and the roadmap. The machine readable version of what you need lives in setup.py instead, and the list has eight entries.

code
absl-py~=1.2
numpy>=1.23
six~=1.14
scipy
enum34~=1.1;python_version<"3.4"
dm-tree~=0.1.1
mock
tf-keras>=2.14.1

TensorFlow is not among them. That omission is deliberate and carries an explanatory comment attributed to alanchiao: an explicit TensorFlow requirement was deferred until TensorFlow itself stops shipping the split tf and tf-gpu packaging, where a user installs one of the two, and moves to a single tf package with a separate gpu package for GPU support. Until that happens, adding the requirement would force maintainers and their dependents to track two packaging schemes.

tf-keras at 2.14.1 is the Keras this toolkit binds to

The last entry in the requirement list is the one that decides whether your code runs at all: tf-keras at 2.14.1 or newer. That is the separately distributed Keras 2 line, not the keras package. The README says there are APIs built specifically for Keras, and the whole framing of the project is post-training quantization and pruning for sparse weights on models you already have, so the Keras surface is the product rather than an adapter. Nothing in the repository text discusses the standalone keras package or how the two relate. If your environment resolves keras rather than tf-keras, the version floor here is the first thing that will not line up, and it is easier to discover that before writing a training script than after.

requirements.txt repeats the runtime list and carries the test shims

The same eight entries appear a second time in requirements.txt, in the same order, with a blank line at the end. Two files, one list, no shared source. The practical difference between them is that the copy in requirements.txt is the one a person installs by hand, and it carries entries that a runtime install does not need: mock, which is a test shim, and six, which dates from before Python 3. Whatever process runs from that file installs test scaffolding into the environment, and because the two lists are maintained separately they can drift without either build complaining. The packaging script pip_pkg.sh sits at the root as well, so there is a third place where the set of dependencies is expressed.

enum34 is still required for Python older than 3.4

One entry carries an environment marker: enum34 at 1.1 or newer, but only when python_version is below 3.4. That marker describes an interpreter old enough that no supported Python release matches it, so on any current version the requirement is skipped and the package is never fetched. It is dead weight in both lists rather than a real constraint, left there from a period when the toolkit still supported those interpreters. It is harmless and it is also a signal about how the requirement list ages: entries are added when a dependency is needed and none of them appear to be pruned when a platform disappears, which is why a Python 3.3 conditional and a Keras 2 floor sit in the same eight lines.

Bazel files sit beside setup.py at the repository root

Two build systems are present at the same level. BUILD, WORKSPACE and bazel.rc are Bazel configuration for the in-repository tests and tooling, while setup.py, requirements.txt and pip_pkg.sh are the setuptools path that produces the installable package. setup.py also does something unusual for a version string: rather than reading a constant, it appends the path of the python/core directory inside the tensorflow_model_optimization package to sys.path and imports __version__ from a version module there, with a pylint disable for the late import. Below that sits a release path that branches on --release appearing in sys.argv, and the file ends partway into that branch, at the start of a statement named rel.

tfmot.clustering belongs to Arm, the other two subpackages do not

The maintainers table is an HTML table with three rows, one per subpackage, and it is the only statement of ownership in the repository. tfmot.clustering is assigned to Arm ML Tooling. tfmot.quantization and tfmot.sparsity are both assigned to TensorFlow Model Optimization. So one of the three named areas is maintained by a team outside the TensorFlow organization, and the other two are kept in house. Nothing further is said about what that arrangement means for issue triage, review or release timing, and the contribution section points at GitHub issues for requests and bugs without saying where an issue against a subpackage should go. For anyone depending on clustering specifically, the maintainer column is the only signal available.

Two years and three months sit between v0.8.0 and v0.8.1

The recent release list is short and the spacing is uneven. v0.7.5 is dated 2023-05-26. v0.8.0 is dated 2024-02-08, about nine months later. v0.8.1 is dated 2026-05-12, which is two years and three months after the tag before it. The default branch, meanwhile, records a push on 2026-10-02, five months after the newest tag. So work is landing on the branch well ahead of any released version, and the project is still numbered below 1.0. The README describes the toolkit as providing stable Python APIs, which is a statement about interface stability rather than about how often a release appears, and it points readers to the project website for the roadmap rather than naming a target version here.

Editorial conclusion

TensorFlow Model Optimization earns its place when you already have a Keras model and want post-training quantization or sparsity applied to it, and it earns a careful read before you install, because the framework it optimizes is not in its own requirement list and its Keras binding is the tf-keras line at 2.14.1 rather than the standalone keras package. Three things are worth settling first: whether your environment already provides TensorFlow, since this package will not pull it in; whether Arm's ownership of tfmot.clustering matches what you expect from support, since that table is the only statement of ownership anywhere in the repository; and which version you pin, because two years and three months separate v0.8.0 from v0.8.1 while the default branch was last pushed 2026-10-02.

Frequently asked questions

Does installing TensorFlow Model Optimization pull in TensorFlow?

No. The required package list in setup.py names absl-py, numpy, six, scipy, enum34, dm-tree, mock and tf-keras at 2.14.1 or newer. A comment in that file explains the TensorFlow requirement was deferred on purpose, pending a change in how TensorFlow packages GPU support.

Which Keras line does TensorFlow Model Optimization target?

tf-keras at 2.14.1 or newer, which is the separately distributed Keras 2 line rather than the keras package. The repository text says APIs are built specifically for Keras but does not discuss the standalone keras package.

Who maintains the clustering tools in tfmot?

The maintainers table assigns tfmot.clustering to Arm ML Tooling, while tfmot.quantization and tfmot.sparsity are both assigned to TensorFlow Model Optimization. It is the only statement of ownership in the repository.

How do I install TensorFlow Model Optimization?

The README points to the installation page at tensorflow.org/model_optimization/guide/install and contains no installation command itself. The dependency list is in setup.py and is mirrored in requirements.txt.

What does the TensorFlow Model Optimization toolkit cover?

Quantization and pruning for sparse weights, with APIs built specifically for Keras. The overview, the optimization gains and the roadmap are on the project website rather than in the repository.

When was the last TensorFlow Model Optimization release?

v0.8.1, dated 2026-05-12. The tag before it, v0.8.0, is dated 2024-02-08 and v0.7.5 is dated 2023-05-26, while the default branch records a push on 2026-10-02.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. tensorflow/model-optimization on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tensorflow-model-optimization.svg)](https://hysenlabs.com/projects/tensorflow-model-optimization)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/tensorflow-model-optimization.svg)](https://hysenlabs.com/projects/tensorflow-model-optimization)

Was this useful?