Skip to main content

ModelBox Python API

This package contains the client library for the ModelBox API for managing Deep Learning models, checkpoints from experiments, and other model operations related services.

Concepts and Understanding the ModelBox API

Namespace

A Namespace is a mechanism to organize related models or models published by a team. They are also use for access control and such to the metadata of uploaded models, invoking benchmarks or other model transformation work. Namespaces are automatically created when a new model or experieemnt specifies the namespace it wants to be associated with.

Model

A model is an object to track common metadata, and to apply policies on models created by experiments to solve a machine learning task. For ex. datasets to evaluate all trained models of a task can be tracked using this object. Users can also add rules around retention policies of trained versions, setup policies for labelling a trained model if it has better metrics on a dataset, and meets all other criterion.

Model Version

A model version is a trained model, it includes the model binary, related files that a user wants to track - dataset file handles, any other metadata, model metrics, etc. Model versions are always related to a Model and all the policies created for a Model are applied to Model Versions.

Experiment and Checkpoints

Experiments are used to injest model checkpoints created during a training run. ModelBox is not an experiment metadata tracker so there is no support for rich experiment management which are available on experiment trackers such as Weights and Biases, the experiment abstraction here exists so that we can track and injest model checkpoints which eventually become model versions if they have good metrics and does well in benchmarks.

Example

from modelbox import ModelBoxClient, MLFramework

client = ModelBoxClient(SERVER_ADDR)

model = self._client.create_model(
            "yolo",
            "owner@email.com",
            "ai/vision/",
            "object_detection",
            "yolo_des",
            {"meta": "foo"},
        )
model_version = self._client.create_model_version(
            model.id, 
            "yolo4_v1",
            "v1",
            "A Yolo v4 trained with custom dataset", 
            ["s3://path/to/bucket/model.pt],
            {"model_hyperparam_1": "value"},
            MLFramework.PYTORCH,
        )

client.close()

Local Development and Installation

The modelbox client library can be installed locally in the following way -

cd <project-root>/client-py/
pip install .

This installs the version of the client checked out with the repo.

Build the client and create distribution packages

cd <project-root>/client-py/
python -m build .

Run Tests

cd <project-root>/client-py/
python tests/test_modelbox_api.py

Release files for modelbox 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modelbox 0.0.5
File Size Uploaded
modelbox-0.0.5.tar.gz 24.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for modelbox 0.0.5
File Interpreter ABI Platform
modelbox-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 48.6 kB

Release files / modelbox-0.0.5.tar.gz

Download URL modelbox-0.0.5.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f722084acb03cdf394d857968ad65d82284eea0beaeef225f1ffb04e8ddcf8fd
BLAKE2b-256 checksum
How to use checksums
21d2dc14bd570e8b3164d656e399043ea8e2875f96bc061fc6edef8128d0f5f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / modelbox-0.0.5-py3-none-any.whl

Download URL modelbox-0.0.5-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e6545a0c30731932bb682e9abab27a6248c13b6755d44e1007015d74dbe9c39
BLAKE2b-256 checksum
How to use checksums
35e6c9219c9513026934b932a995465e89ebde4c94c9157539342b1a4ba4ca3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page