skillfed

ai-edge-quantizer

A quantizer for advanced developers to quantize converted AI Edge models.

ai-edge-quantizer v0.8.0 169.7K downloads/30d#10,410 on PyPI189
Permissive license Apache-2.0 Active released

What it is and what it does

AI Edge Quantizer is a tool for converting unquantized LiteRT models into quantized versions optimized for edge device deployment. It targets advanced developers working with resource-constrained environments, particularly for GenAI and large language models. The package provides three quantization strategies: dynamic quantization (weights quantized, activations remain float, no calibration needed), weight-only quantization (reduced model size with float computation), and static quantization (both weights and activations quantized, requires calibration data). Users define quantization behavior through recipes that specify which operators to quantize, bit-widths, symmetry, and granularity settings.

The workflow is straightforward: instantiate a Quantizer with an input .tflite file, load a quantization recipe (either from built-in templates or custom-defined), then quantize and export. The package depends on numpy, scipy, absl-py for core functionality, plus Google's ai-edge-litert and litert-lm-builder for LiteRT model handling. It supports Python 3.10–3.13 on Linux and macOS, with active maintenance and nightly releases.

Use it for:

  • Reduce model size and memory footprint for deployment on mobile and embedded devices without calibration data using dynamic quantization.
  • Optimize inference latency on NPU hardware by applying static quantization with calibration on representative data.
  • Selectively quantize specific operators or layers while keeping others in FP32 to balance quality and performance.
  • Convert GenAI and large language models to 4-bit or 8-bit weight quantization for on-device inference.
  • Experiment with mixed-precision quantization strategies to find the optimal trade-off between model size and accuracy.

Worth the install?

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

Quantizes LiteRT models to reduce size and improve inference performance on edge devices, supporting dynamic, weight-only, and static quantization strategies with configurable recipes.

Yes, if you are quantizing LiteRT models for edge deployment. The package is actively maintained, has low install friction, carries a permissive license, and provides a clear API with multiple quantization strategies. No known vulnerabilities. Best suited for advanced developers; requires understanding of quantization trade-offs and model format requirements. Start with dynamic quantization recipes if you lack calibration data.

Install

ai-edge-quantizer on PyPI

pip

pip install ai-edge-quantizer

uv

uv add ai-edge-quantizer

poetry

poetry add ai-edge-quantizer

Installing ai-edge-quantizer

Before you install

Low friction install with a pure-Python wheel. Active maintenance with recent releases and passing unit tests. Depends on established packages (numpy, scipy, absl-py) plus Google's ai-edge-litert and litert-lm-builder, which may require additional setup.

License in practice

Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install ai-edge-quantizer

from ai_edge_quantizer import quantizer, recipe

qt = quantizer.Quantizer("path/to/input.tflite")
qt.load_quantization_recipe(recipe.dynamic_wi8_afp32())
qt.quantize().export_model("/path/to/output.tflite")

Requires Python 3.10 or later. Input model must be an unquantized FP32 LiteRT model in FlatBuffer format with .tflite extension. TensorFlow (tf-nightly) is listed as a dependency in the documentation.

Verify before relying

  • Whether tf-nightly is an actual runtime dependency or only a build/development requirement
  • Hardware compatibility details for each quantization strategy beyond the CPU/GPU vs NPU recommendation
  • Performance benchmarks or typical latency/size improvements across different model types

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — absl-py, immutabledict, numpy, scipy, ml_dtypes, ai-edge-litert, litert-lm-builder
Maintenance actively maintained — 32 days since the last release
Last repo commit
First released
Downloads 169,674/month — #10,410 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ai_edge_quantizer-0.8.0-py3-none-any.whl

Keywords: On-Device ML, AI, Google, TFLite, Quantization, LLMs, GenAI

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

model quantization litertedge device model optimizationneural network weight quantizationon-device ml model compressiontflite model quantizergenai model optimizationdynamic quantization framework
model-compressionedge-mlquantization

More Software Development packages

Further reading