--- id: ai-edge-quantizer version: "0.8.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # ai-edge-quantizer — A quantizer for advanced developers to quantize converted AI Edge models. License: permissive · Maintenance: active · Downloads: 169.7K/mo ## 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 above — 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 pip install ai-edge-quantizer uv add ai-edge-quantizer 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_current - Install friction: low - Maintenance: active - Downloads: 169.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags model quantization litert, edge device model optimization, neural network weight quantization, on-device ml model compression, tflite model quantizer, genai model optimization, dynamic quantization framework, model-compression, edge-ml, quantization [View on SkillFed](https://skillfed.io/packages/ai-edge-quantizer) · [View on PyPI](https://pypi.org/project/ai-edge-quantizer/)