Metadata-Version: 2.3
Name: michelangelo
Version: 0.1.0
Summary: Michelangelo is an end-to-end model lifecycle management system at large scale
Author: Michelangelo Team
Author-email: michelangelo-oss-group@uber.com
Requires-Python: >=3.9.0,<4.0.0
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: Programming Language :: Python :: 3.13
Provides-Extra: dev
Provides-Extra: example
Provides-Extra: plugin
Provides-Extra: vllm
Requires-Dist: accelerate (==0.34.2) ; extra == "example" or extra == "vllm"
Requires-Dist: datasets (==3.2.0) ; extra == "example" or extra == "vllm"
Requires-Dist: einops (==0.8.0) ; extra == "example" or extra == "vllm"
Requires-Dist: fsspec (==2024.9.0)
Requires-Dist: grpcio (>=1.70.0,<2.0.0)
Requires-Dist: jinja2 (>=3.1.2,<4.0.0) ; extra == "dev"
Requires-Dist: numpy (==1.25) ; extra == "dev" or extra == "example" or extra == "vllm"
Requires-Dist: pandas (==1.5.1) ; extra == "dev" or extra == "example" or extra == "vllm"
Requires-Dist: pre-commit (>=4.2.0,<5.0.0) ; extra == "dev"
Requires-Dist: protobuf (>=5.29.3,<6.0.0)
Requires-Dist: pyarrow (>=19.0.0,<20.0.0) ; extra == "dev" or extra == "example" or extra == "vllm"
Requires-Dist: pydantic (>=2.10.6,<3.0.0)
Requires-Dist: pyspark (==3.5.5) ; extra == "plugin"
Requires-Dist: pytest (>=8.3.4,<9.0.0) ; extra == "dev"
Requires-Dist: pytorch_lightning (==2.2.0) ; extra == "dev" or extra == "example" or extra == "vllm"
Requires-Dist: ray[default] (>=2.41.0,<3.0.0) ; extra == "plugin" or extra == "example" or extra == "vllm"
Requires-Dist: ruff (>=0.9.1,<0.10.0) ; extra == "dev"
Requires-Dist: s3fs (==2024.9.0) ; extra == "example" or extra == "vllm"
Requires-Dist: setuptools (==74.1.1) ; extra == "vllm"
Requires-Dist: torch (==2.6.0) ; extra == "dev" or extra == "example" or extra == "vllm"
Requires-Dist: transformers (==4.48.2) ; extra == "dev" or extra == "example" or extra == "vllm"
Requires-Dist: typing-extensions (>=4.12.2,<5.0.0)
Requires-Dist: vllm (==0.8.1) ; extra == "vllm"
Requires-Dist: xgboost (==2.1.4) ; extra == "example"
Requires-Dist: xgboost_ray (==0.1.19) ; extra == "example"
Description-Content-Type: text/markdown

Michelangelo SDK

## User Guide

Install core packges only

```
pip install michelangelo
```

Install with bundle plugins

```
pip install michelangelo[plugin]
```

## User Guide

### Michelangelo Python Client

1. Set Michelangelo API server address using environment variable `MICHELANGELO_API_SERVER`. e.g.

```bash
export MICHELANGELO_API_SERVER="localhost:12345"
```

2. Access API resources using Michelangelo Python client.

```python
from michelangelo.api.v2.client import APIClient
from michelangelo.gen.api.v2.project_pb2 import Project

APIClient.set_caller('my-client') # initialize client with caller name
# If not specified in Python code, the client will use the Michelangelo API server
# address from MICHELANGELO_API_SERVER environment variable.

# list existing projects
projects = APIClient.ProjectService.list_project(namespace='default')
print("Existing projects:")
print(projects)

# create a new project
proj = Project()
proj.metadata.namespace = "default"
proj.metadata.name = "demo-project"
proj.spec.tier = 2
proj.spec.description = "demo project"
proj.spec.owner.owning_team = "8D8AC610-566D-4EF0-9C22-186B2A5ED793"
proj.spec.git_repo = "https://github.com/michelangelo-ai/michelangelo"
proj.spec.root_dir = "/demo-project"
APIClient.ProjectService.create_project(proj)

# get the new project
project = APIClient.ProjectService.get_project(namespace='default', name='demo-project')
print(project)
```

## Developer Guide

### Preprequisites

- Python 3.9
- Poetry: https://python-poetry.org

### Cheat Sheet

- Install dependencies: `poetry install`
  - Install dependencies with plugins: `poetry install -E plugin`
- Add a new dependency: `poetry add <package-name>`
- Run tests: `poetry run pytest`
- Run examples:
  - Install dependencies for example (ML libs for BERT model): `poetry install -E example`
  - Run example: `$ PYTHONPATH="." poetry run python ./examples/bert_cola/bert_cola.py`
- Format code: `poetry run ruff format .`
- Run Michelangelo CLI: `poetry run ma --help`

### Environment Setup: Mac

- Install Python 3.9: `brew install python@3.9`
- Install Poetry: `curl -sSL https://install.python-poetry.org | python3.9 -`
- Create Python virtual environment and install packages: `poetry install`

The last step will create a `.venv` directory if it doesn't already exist.
This directory contains a Python virtual environment with all the dependencies installed.
You can activate this virtual environment and use it like any other Python virtual environment,
or you can run commands via the Poetry CLI, e.g., `poetry run python`, `poetry run pytest`, etc.

### Dockerfile

If you experience issues with the Python environment, you can use the Dockerfile to build a Docker image with the necessary dependencies.
We recommend to setup your local environment with the instructions above (with poetry), but you can use the Dockerfile as a fallback.

```bash
$ cd $REPO_ROOT/python
$ docker build -t $IMAGE_NAME -f ./examples/bert_cola/Dockerfile .
$ docker run $IMAGE_NAME
```

### Regenerate Python gRPC client code

After protobuf file changes, use the following script to regenerate the Python gRPC client code.
tools/gen-grpc-client.sh --clients python

