Metadata-Version: 2.4
Name: arm-ai-model-optimizer
Version: 2.1.5
Summary: Arm AI Model Optimizer command-line client and Python API for ML model optimization
Author: Nota Inc.
Maintainer-email: "Nota Inc." <netspresso@nota.ai>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://developer.arm.com/ai
Project-URL: Documentation, https://developer.arm.com/dev-docs/arm-ai-model-optimizer
Project-URL: Support, https://developer.arm.com/dev-docs/arm-ai-model-optimizer/support
Keywords: machine-learning,ml,model-optimization,model-optimisation,model-deployment,inference,profiling,cli,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: Arm AI Model Optimizer CLI SDK - EULA.txt
License-File: LICENSE
License-File: licenses/Appendix 2 - Copyright Attribution.md
License-File: licenses/Open Source Software Notice.md
License-File: licenses/Appendix 1/01_Apache-2.0.txt
License-File: licenses/Appendix 1/02_MIT.txt
License-File: licenses/Appendix 1/03_BSD-3-Clause.txt
License-File: licenses/Appendix 1/04_BSD-2-Clause.txt
License-File: licenses/Appendix 1/05_ISC.txt
License-File: licenses/Appendix 1/06_PSF-2.0.txt
License-File: licenses/Appendix 1/07_MPL-2.0.txt
Requires-Dist: pydantic>=2.0.1
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: typer>=0.12.0
Requires-Dist: rich>=13.7.0
Requires-Dist: requests>=2.31.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: huggingface-hub>=0.30.0
Requires-Dist: dependency-injector>=4.49.1
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.27.0; extra == "otel"
Requires-Dist: opentelemetry-sdk>=1.27.0; extra == "otel"
Requires-Dist: opentelemetry-instrumentation-logging>=0.48b0; extra == "otel"
Dynamic: license-file

# arm-ai-model-optimizer

Arm AI Model Optimizer command-line client and Python API.

This package installs the `np` command, a client that submits model optimization
work to the Arm AI Model Optimizer service and displays the results. Model optimization
is performed by the service. Profiling jobs can execute on target devices.

## Requirements

- Python 3.11 or later
- Network access to the Arm AI Model Optimizer service
- For `np profile`, network access from the target device to the configured broker
  and S3 model storage

## Installation

```bash
pip install arm-ai-model-optimizer
```

If you received a wheel file, install that file instead. Replace the quoted
placeholder below with the actual path to the supplied wheel:

```bash
python -m pip install "<path-to-provided-wheel.whl>"
```

## Getting started

### 1. Sign in

Issue a credential from the Arm AI Portal, then register it once on this machine:

```bash
np auth login <credential>
np auth status
```

The credential carries the address of the authentication server, so no further
configuration is needed. `np auth status` reports the state of the stored token.

### 2. Check the connection

```bash
np health ready
```

### 3. Run an optimization

```bash
np workspace init      # create a workspace with a sample project
np models ls           # browse registered models
np validate            # check run.yaml against the backend
np run                 # submit the run
np status              # follow progress
np report              # inspect the results
```

Run `np --help`, or `np <command> --help`, for the full reference.

## Commands

| Command | Purpose |
| --- | --- |
| `np auth` | Sign in, sign out, inspect the current session |
| `np workspace init` | Create a workspace and a sample project |
| `np models` / `np datasets` / `np devices` | Register and browse resources |
| `np projects` / `np experiments` / `np jobs` | Organize and inspect work |
| `np validate` / `np run` / `np cancel` | Validate, submit and cancel runs |
| `np status` / `np report` / `np ls` | Follow progress and read results |
| `np profile` / `np evaluate` | Measure latency and memory, score accuracy |
| `np analyze sensitivity` | Inspect layerwise sensitivity |
| `np visualize` | Generate a model visualization link |
| `np export` | Export artifacts for deployment or reproduction |

Some commands may be unavailable depending on the features enabled for your deployment.

## Profiling and network access

When using `np profile`, the target device connects to a broker to receive work and
to S3 storage to retrieve models. This is a networked workflow.

The separately supplied `executor_runner` profiling binaries can also be invoked
directly on a target device without a server connection or authentication. Their
standalone, local-processing description applies to direct execution of those
binaries, not to the full `np profile` workflow. See the README supplied with the
profiling binaries for supported models, devices and direct-execution instructions.

## Python API

The same package provides a Python API. Every command above has a counterpart, with
the same behaviour: where the CLI exits non-zero, the call raises.

The example below refers to registered model, device and dataset identifiers.
Replace these identifiers with resources available in your deployment.

```python
from netspresso.api import NetsPresso

client = NetsPresso()  # same environment and stored credential as the CLI
project = client.projects.create(name="resnet50-rpi5", model="resnet50_pt2_pytorch_static_fp32",
                                 device="raspberry_pi_5_16gb", runtime="executorch", backend="xnnpack",
                                 calibration_dataset="imagenet1k_calib_seed42_n1000",  # required for quantization
                                 evaluation_dataset="imagenet1k_eval_seed42_n5000")
experiment = client.experiments.create(project_path=project.project_path, steps="go,gq")
client.run(experiment_path=experiment.experiment_path, wait=True)
report = client.report(experiment_path=experiment.experiment_path)
```

See the Python API reference in the documentation below for every call.

## Documentation

https://developer.arm.com/dev-docs/arm-ai-model-optimizer

## License

This software is licensed under the End User License Agreement for Arm AI Model
Optimizer CLI, SDK and Related Software, provided in
`Arm AI Model Optimizer CLI SDK - EULA.txt`. Read it before you install or use the software.

Third-party components are subject to their respective license terms, as identified
in the accompanying third-party notices.

Notices for the open source software this package depends on are provided in
`licenses/Open Source Software Notice.md`, with the full license texts in `licenses/Appendix 1/`
and the copyright notices in `licenses/Appendix 2 - Copyright Attribution.md`.

The software bill of materials (SBOM) is provided in CycloneDX and SPDX formats in `sboms/`.

In the source distribution, these paths are relative to the top level. In an installed
package, the EULA and the `licenses/` directory are under
`arm_ai_model_optimizer-<version>.dist-info/licenses/`, and the SBOM files are under
`arm_ai_model_optimizer-<version>.dist-info/sboms/`.

