Metadata-Version: 2.5
Name: mlia-converters-litert
Version: 0.1.2
Summary: ML Inference Advisor LiteRT Converter Plugin
Project-URL: Homepage, https://github.com/arm/mlia-converters-litert.git
Author-email: Arm Ltd <mlia@arm.com>
License-Expression: Apache-2.0
License-File: LICENSES/Apache-2.0.txt
Keywords: arm,litert,ml,tflite,tosa
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: <3.14,>=3.10
Requires-Dist: mlia<0.13,>=0.12.0
Requires-Dist: tosa-converter-for-tflite==2026.2.0
Description-Content-Type: text/markdown

<!---
SPDX-FileCopyrightText: Copyright 2026, Arm Limited and/or its affiliates.
SPDX-License-Identifier: Apache-2.0
--->

# MLIA LiteRT Converter Plugin

This repository contains the MLIA converter plugin that translates LiteRT /
TensorFlow Lite `.tflite` models into TOSA so they can be consumed by MLIA
backends and target flows that operate on TOSA artifacts.

The package is distributed as `mlia-converters-litert`. When installed, it
registers the transformer name `tflite_to_tosa` with MLIA through the plugin
entry-point system.

## Table of Contents

- [Overview](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#overview)
- [Repository contents](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#repository-contents)
- [Installation](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#installation)
- [How MLIA uses this plugin](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#how-mlia-uses-this-plugin)
- [Reporting bugs](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#reporting-bugs)
- [Development (uv)](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#development-uv)
- [Documentation](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#documentation)
- [Releases](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#releases)
- [License](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#license)
- [Trademarks and copyrights](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/README.md#trademarks-and-copyrights)

## Overview

This plugin provides the conversion bridge between LiteRT / TensorFlow Lite
`.tflite` model files and TOSA-based MLIA backends. It gives the wider MLIA
ecosystem a dedicated package for `.tflite`-to-TOSA conversion and keeps
converter logic separate from the core MLIA framework.

The implementation package lives under
`src/mlia/backend/tosa_converter_for_tflite/` and includes:

- Conversion logic.
- Transformer registration.
- Backend installation metadata used by MLIA.

## Repository contents

- `src/mlia/backend/tosa_converter_for_tflite/`: implementation package and
  plugin registration.
- `tests/`: unit tests for converter registration and conversion behaviour.
- `pre_commit_hooks/`: local repository hooks shared with CI quality checks.
- `pyproject.toml`: package metadata, including the public
  `tosa-converter-for-tflite` dependency.

## Installation

Install the package into an environment that already contains `mlia`:

```bash
pip install mlia-converters-litert
```

For source-based development with `uv`:

```bash
uv sync --group dev
```

The project supports the Python versions declared in `pyproject.toml` and keeps
its direct dependency surface small, with MLIA as the primary runtime
dependency.

## How MLIA uses this plugin

MLIA discovers this repository through the `mlia.plugin.transformer` entry
point. When installed, the plugin registers the transformer name
`tflite_to_tosa`.

The package and transformer use different names:

- `tflite_to_tosa` is the transformer name used in MLIA workflows.
- `tosa_converter_for_tflite` is the Python implementation package.

That means downstream MLIA components can:

- Discover the converter without hard-coded import paths.
- Request a LiteRT / TensorFlow Lite `.tflite`-to-TOSA conversion through the
  transformer registry.
- Treat the converter as a separately versioned plugin package.

For more implementation detail, see [docs/README.md](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/docs/README.md).

## Reporting bugs

Report bugs by creating GitHub issues. Use the
[`arm/mlia` issue tracker](https://github.com/arm/mlia/issues) by default.

Only open an issue in
[`arm/mlia-converters-litert`](https://github.com/arm/mlia-converters-litert/issues)
when the bug is clearly and specifically in this LiteRT converter plugin.

## Development (uv)

This repository uses `uv` for environment management and test execution. Ensure
the Python version in `.python-version` is available, then install dependencies:

```bash
uv sync --group dev
```

Run unit tests (uses dependencies installed from the package index, including `mlia`):

```bash
uv run pytest --no-success-flaky-report tests/
```

Run a quick test subset:

```bash
uv run pytest --no-success-flaky-report -m "not slow" tests/
```

Lint checks:

```bash
uv run pre-commit run --all-files
```

Build a wheel:

```bash
uv build --wheel
```

## Documentation

Additional repository documentation lives in [docs/README.md](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/docs/README.md).

## Releases

Latest changes and release history can be found in
[MLIA LiteRT Converter releases](https://github.com/arm/mlia-converters-litert/releases).

## License

This project is licensed under the Apache License 2.0. See
[`LICENSES/Apache-2.0.txt`](https://github.com/arm/mlia-converters-litert/blob/7935a3c2c30fceebb933c0ea3645f89f6a62395b/LICENSES/Apache-2.0.txt) for the full license text.

## Trademarks and copyrights

- Arm is a registered trademark or trademark of Arm Limited (or its subsidiaries) in the U.S. and/or elsewhere.
- TensorFlow is a trademark of Google LLC.
- Linux is the registered trademark of Linus Torvalds in the U.S. and elsewhere.
- Python is a registered trademark of the PSF.
