Metadata-Version: 2.4
Name: optimaxx
Version: 1.0.0
Summary: An intelligent AI model optimization framework for PyTorch.
Project-URL: Homepage, https://github.com/ivanho-git/optimaxx
Project-URL: Documentation, https://ivanho-git.github.io/optimaxx
Project-URL: Repository, https://github.com/ivanho-git/optimaxx
Project-URL: Issues, https://github.com/ivanho-git/optimaxx/issues
Project-URL: Changelog, https://github.com/ivanho-git/optimaxx/blob/main/CHANGELOG.md
Author-email: Ibhan Mukherjee <ibhaanm29@email.com>
License: Apache-2.0
License-File: LICENSE
Keywords: compiler,deep-learning,inference,machine-learning,optimization,performance,profiler,pytorch,quantization
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: jinja2>=3.1.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: packaging>=23.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0.0
Requires-Dist: toml>=0.10.2
Requires-Dist: torch>=2.0.0
Requires-Dist: typer>=0.9.0
Provides-Extra: all
Requires-Dist: onnx>=1.14.0; extra == 'all'
Requires-Dist: onnxruntime>=1.15.0; extra == 'all'
Requires-Dist: tensorrt>=8.6.0; (platform_machine == 'x86_64') and extra == 'all'
Provides-Extra: dev
Requires-Dist: black>=23.7.0; extra == 'dev'
Requires-Dist: mypy>=1.5.0; extra == 'dev'
Requires-Dist: pre-commit>=3.3.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest-xdist>=3.3.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: torchvision>=0.15.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.1.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.22.0; extra == 'docs'
Description-Content-Type: text/markdown

# Optimax

[![CI](https://github.com/optimax-ai/optimax/actions/workflows/ci.yml/badge.svg)](https://github.com/optimax-ai/optimax/actions)
[![PyPI](https://img.shields.io/pypi/v/optimax)](https://pypi.org/project/optimax/)
[![Python](https://img.shields.io/pypi/pyversions/optimax)](https://pypi.org/project/optimax/)
[![License](https://img.shields.io/pypi/l/optimax)](https://github.com/optimax-ai/optimax/blob/main/LICENSE)
[![Coverage](https://img.shields.io/codecov/c/github/optimax-ai/optimax)](https://codecov.io/gh/optimax-ai/optimax)

**Optimax** is an intelligent AI model optimization framework for PyTorch. It automatically analyzes hardware, profiles models, recommends optimizations, applies safe transformations, benchmarks performance, and generates rich reports.

## Vision

Developers should be able to optimize any PyTorch model with a single line of code:

```python
import optimax

report = optimax.analyze(model)
optimized_model = optimax.optimize(model, goal="latency", hardware="auto")
```

## Features

- **Hardware Detection** — Automatically detect CPU, GPU, CUDA, ROCm, Apple Metal, TPU, RAM, VRAM, and environment details.
- **Model Analysis** — Deep inspection of model architecture, parameters, FLOPs, memory usage, and execution graph.
- **Profiling** — Measure forward/backward latency, throughput, peak memory, and percentile statistics.
- **Recommendation Engine** — Generate actionable optimization suggestions with expected speedup, memory savings, risk, and compatibility.
- **Optimization Engine** — Modular, independent optimization passes (torch.compile, mixed precision, FlashAttention, quantization, operator fusion, gradient checkpointing, ONNX export, TensorRT) with validation and rollback.
- **Benchmarking** — Compare original vs. optimized models with statistical rigor.
- **Rich Reports** — JSON, HTML, Markdown, console, and PDF reports with charts and summaries.
- **CLI** — Full command-line interface for analysis, optimization, benchmarking, and diagnostics.
- **Configuration** — Support for pyproject.toml, YAML, JSON, and environment variables.

## Quick Start

```bash
pip install optimax
```

```python
import torch
import optimax

model = torch.nn.TransformerEncoderLayer(d_model=512, nhead=8)
report = optimax.analyze(model)
optimized = optimax.optimize(model, goal="latency", hardware="auto")
```

## CLI Usage

```bash
# Analyze a model file
optimax analyze model.py

# Benchmark a model
optimax benchmark --model model.py --input-shape 1 3 224 224

# Optimize a model
optimax optimize --model model.py --goal latency --output optimized.pt

# Generate a report
optimax report --input report.json --format html

# Run diagnostics
optimax doctor
```

## Documentation

Full documentation is available at [https://optimax-ai.github.io/optimax](https://optimax-ai.github.io/optimax).

## Installation

```bash
pip install optimax
```

For development:

```bash
pip install optimax[dev]
```

For optional backends (ONNX, TensorRT):

```bash
pip install optimax[all]
```

## Contributing

We welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) before submitting issues or pull requests.

## License

Optimax is licensed under the [Apache License 2.0](LICENSE).

## Security

Please see our [Security Policy](SECURITY.md) for reporting vulnerabilities.
