Skip to main content

Client Library of the ModelBox Service

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modelbox-0.0.5.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

modelbox-0.0.5-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file modelbox-0.0.5.tar.gz.

File metadata

  • Download URL: modelbox-0.0.5.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for modelbox-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f722084acb03cdf394d857968ad65d82284eea0beaeef225f1ffb04e8ddcf8fd
MD5 e2d23e6503ab07b1ac495f47344e5970
BLAKE2b-256 21d2dc14bd570e8b3164d656e399043ea8e2875f96bc061fc6edef8128d0f5f5

See more details on using hashes here.

File details

Details for the file modelbox-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: modelbox-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for modelbox-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2e6545a0c30731932bb682e9abab27a6248c13b6755d44e1007015d74dbe9c39
MD5 12bcbdd7d88c68f85ce0ae46b648dd99
BLAKE2b-256 35e6c9219c9513026934b932a995465e89ebde4c94c9157539342b1a4ba4ca3c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page