Skip to main content

MLSteam Model SDK

Project description

mlsteam-model-sdk

SDK for accessing MLSteam models

Setup

pip3 install mlsteam-model-sdk

To process encrypted model versions, install the Themis development package according to the official instrunctions. Debian/Ubuntu users have a handy installation method:

# for users that already have administrator privileges
mlsteam-model-cli install-themisdev

# for those that need privilege lifting
sudo mlsteam-model-cli install-themisdev

Usage

Initilize SDK

SDK needs to be initialized if you have not done so (replace the fields started with $):

mlsteam-model-cli init \
    --default_project_type=name \
    --default_project_val=$PROJECT_OWNER/$PROJECT_NAME

By default, the settings will be at $HOME/.mlsteam-model-sdk/cfg.ini.

If the program is running out of an MLSteam system, you may also need to setup api_token with this command instead, or by editing the api_token field in cfg.ini:

mlsteam-model-cli init \
    --api_token=$YOUR_API_TOKEN \
    --default_project_type=name \
    --default_project_val=$PROJECT_OWNER/$PROJECT_NAME

Downloading a model version with SDK

from mlsteam_model_sdk.sdk.model import Model

sdk_model = Model()
sdk_model.download_model_version(model_name='model_name',
                                 version_name='version_name')

You will need administrator privileges to handle encrypted model versions. For this case, either run the Python program with sudo, or enter your password in a sudo prompt during program execution. Administrator privileges are not required when you only process non-encrypted model versions.

By default, the model version will be downloaded at $HOME/.mlsteam-model-sdk/models/download/.

This loads a model version and makes prediction:

mv = sdk_model.load_model_version(model_name='model_name',
                                  version_name='version_name')
outputs = mv.predict(inputs)

Importing a model version with CLI

This example assumes the following files are locally available:

  1. model version package (required)
  2. package encryption key (required only for encrypted packages)

You will need administrator privileges to import an encrypted model version, as mentioned in the previous example.

To import a package:

# for non-encrypted packages
mlsteam-model-cli mv import-local -f $PACKAGE_FILE_PATH

# for encrypted packages
mlsteam-model-cli mv import-local -f $PACKAGE_FILE_PATH -k $ENCKEY_FILE_PATH

By default, the model and version names to register are read from the package manifest. You may customize these settings with the --model_name and --version_name options.

If the operation is successful, you will find the imported pakage in local model registry:

mlsteam-model-cli mv list-local
   muuid     model_name       vuuid        version_name     puuid     packaged   encrypted      download_time
 ================================================================================================================
 __local__   ...          local-........   ...            __local__   1          ...            .....

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

mlsteam_model_sdk-0.4.5-cp311-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138.5 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

mlsteam_model_sdk-0.4.5-cp310-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (134.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

mlsteam_model_sdk-0.4.5-cp39-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

mlsteam_model_sdk-0.4.5-cp38-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (147.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

mlsteam_model_sdk-0.4.5-cp37-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (134.7 kB view details)

Uploaded CPython 3.7 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

mlsteam_model_sdk-0.4.5-cp36-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (132.4 kB view details)

Uploaded CPython 3.6 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

File details

Details for the file mlsteam_model_sdk-0.4.5-cp311-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mlsteam_model_sdk-0.4.5-cp311-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c126fe1601b1d245cd0a145f9c98d451cd6d14641666180a06420f4fa3e4b218
MD5 7f4929e2f1439479a81164ff3c792c41
BLAKE2b-256 93b55614c31ea77145799d03fb626203eb27664707f5632b24ddfef4e68ae6db

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.5-cp310-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mlsteam_model_sdk-0.4.5-cp310-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0de84fbc28f156b523806be9a26d72bbd08a11b4b3ecda7058df631b8457088
MD5 eb3a480a2582e5f3c6f3c45f9cf84389
BLAKE2b-256 d2657dd2801caaf4b592bedc516f8e9df2ab96085ad61833c5916767ce11cfd0

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.5-cp39-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mlsteam_model_sdk-0.4.5-cp39-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d8b7d038c1b46da372845becc3cc6d46014f955c23e958737afe93b3466835f
MD5 66bc5a6987316a3b881b18f24e6f668b
BLAKE2b-256 efb84632a59c348a90fa8a49eed5b8531ed4059eaeb409a17510757d626d7b87

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.5-cp38-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mlsteam_model_sdk-0.4.5-cp38-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75699ff4aa37fd69342d81cc3b2c0cf5965f8bf418afcaaf9fe81c1071cceac1
MD5 7b3811a2d7a48ab964bea47a16c7cbac
BLAKE2b-256 69ab1dc7224d3d90cea366e33363fc0e42c1032e58206b62d43c54ff8e305379

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.5-cp37-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mlsteam_model_sdk-0.4.5-cp37-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a13394a94d0a5cfc3b225381402cd1c36a8ffa559bba401d1c8fa8e76b805955
MD5 5098cf53b3e03a858076817361654e7b
BLAKE2b-256 9f4b64041f8a7a21f006f7d2703ebef512b0e9ae8414048f31cbf043b0c97629

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.5-cp36-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mlsteam_model_sdk-0.4.5-cp36-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d4fd9cb54b4028ac1d1701f46a0bc21fae86e78dcfd433dd5188fb8ff0b7ab5
MD5 a5c018a3ca856be2d67ba4d6ffb19dc7
BLAKE2b-256 b255a694ba1ab522f2b922abc9e5314d32973f8cf4c4ba153bec500de4cf067c

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