Python client for MLflow REST API
.. title
|status| |PyPI| |PyPI License| |PyPI Python Version| |ReadTheDocs| |Build| |Coverage| |pre-commit.ci|
.. |status| image:: https://www.repostatus.org/badges/latest/active.svg :target: https://www.repostatus.org/#active .. |PyPI| image:: https://badge.fury.io/py/mlflow-rest-client.svg :target: https://badge.fury.io/py/mlflow-rest-client .. |PyPI License| image:: https://img.shields.io/pypi/l/mlflow-rest-client.svg :target: https://github.com/MobileTeleSystems/mlflow-rest-client/blob/main/LICENSE.txt .. |PyPI Python Version| image:: https://img.shields.io/pypi/pyversions/mlflow-rest-client.svg :target: https://badge.fury.io/py/mlflow-rest-client .. |ReadTheDocs| image:: https://img.shields.io/readthedocs/mlflow-rest-client.svg :target: https://mlflow-rest-client.readthedocs.io .. |Build| image:: https://github.com/MobileTeleSystems/mlflow-rest-client/workflows/Tests/badge.svg :target: https://github.com/MobileTeleSystems/mlflow-rest-client/actions .. |Coverage| image:: https://codecov.io/gh/MobileTeleSystems/mlflow-rest-client/branch/main/graph/badge.svg :target: https://codecov.io/gh/MobileTeleSystems/mlflow-rest-client .. |pre-commit.ci| image:: https://results.pre-commit.ci/badge/github/MobileTeleSystems/mlflow-rest-client/main.svg :target: https://results.pre-commit.ci/latest/github/MobileTeleSystems/mlflow-rest-client/main
Python client for MLflow <https://mlflow.org>
_ REST API.
Features:
Minimal dependencies
Unlike MLflow Tracking client <https://mlflow.org/docs/latest/python_api/mlflow.tracking.html>
__
all REST API methods and params are exposed to user.
MLflow URL is passed via constructor argument instead of env variable, so multiple client instances could be created in the same Python interpreter.
Basic and Bearer auth are supported (via constructor args too).
All class fields are validated with pydantic <https://pydantic-docs.helpmanual.io>
_.
All methods and classes are documented.
Limitations:
There is no integration with ML frameworks and libraries.
You should use official MLflow client <https://mlflow.org/docs/latest/python_api/mlflow.html>
__ instead.
There is no integration with S3 or other artifact storage type.
You should access it directly with boto3 <https://boto3.amazonaws.com>
_ or other client.
Supported MLflow versions: from 1.17.0
to 1.23.0
.
It is possible to use client with older MLflow versions (e.g. 1.10.0
), but this is not guaranteed.
Only Python 3.7+ is supported. Python 3.6 and lower already reached end of life.
.. documentation
See https://mlflow-rest-client.readthedocs.io/
.. contribution
See <CONTRIBUTING.rst>
__
See <SECURITY.rst>
__
.. install
Stable release
Stable version is released on every tag to ``master`` branch. Please use stable releases on production environment.
Version example: ``2.0.0``
.. code:: bash
pip install mlflow-rest-client==2.0.0 # exact version
pip install mlflow-rest-client # latest release
Development release
Development version is released on every commit to dev
branch. You can use them to test some new features before official release.
Version example: 2.0.0.dev5
.. code:: bash
pip install mlflow-rest-client==2.0.0.dev5 # exact dev version
pip install --pre mlflow-rest-client # latest dev version
.. develop
Clone repo:
.. code:: bash
git clone [email protected]:MobileTeleSystems/mlflow-rest-client.git
cd mlflow-rest-client
Install dependencies for development:
.. code:: bash
pip install -r requirements-dev.txt
Install pre-commit hooks:
.. code:: bash
pre-commit install
pre-commit autoupdate
pre-commit install-hooks
Test pre-commit hooks run:
.. code:: bash
pre-commit run --all-files -v
.. usage
Make sure you have an MLflow Tracking Server <https://mlflow.org/docs/latest/tracking.html#running-a-tracking-server>
_ running.
.. code:: python
from mlflow_rest_client import MLflowRESTClient
client = MLflowRESTClient("https://mlflow.domain", ignore_ssl_check=True)
experiment = client.get_or_create_experiment("experiment_name")
run = client.create_run(experiment.id)
See sample.py <https://github.com/MobileTeleSystems/mlflow-rest-client/blob/main/samples/sample.py>
_ for more examples.