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.2-cp311-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138.4 kB view details)

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

mlsteam_model_sdk-0.4.2-cp310-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (134.5 kB view details)

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

mlsteam_model_sdk-0.4.2-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.2-cp38-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (147.4 kB view details)

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

mlsteam_model_sdk-0.4.2-cp37-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.7 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

mlsteam_model_sdk-0.4.2-cp36-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (132.3 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.2-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.2-cp311-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4fcfab780f447595b41107fde91baa850a1dc39031d9af0745f2471e12086125
MD5 ebfecf3827f72e0d0a1cae20a2101dd9
BLAKE2b-256 8b32ca722c5066a50b67024587393c2f9af39c5f9c00412ce9cf0f2d91a71613

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.2-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.2-cp310-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 14c4d39919d204c34281aed97a6e69ec435b6e361dc0edd8e2157efb6a79fcb5
MD5 e83890207f7985aee6f0cd995c9e62f4
BLAKE2b-256 3adab478b7fd41687a2ba047ce85c179caddc73d92462e20a816b9a782c62002

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.2-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.2-cp39-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5bb8ee0a924211854e30bdf280f31969d9175350cb9c6ae66b7149deed1dac7
MD5 ee13c644be75f663c68006dbf80d7e7a
BLAKE2b-256 ebdfad026bafb286bb0dbd950c8d4c3768f4a8770164869077e1b9aecf375eee

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.2-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.2-cp38-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5593ad46ea8987266667b62b36baad292428f7e1a9c20b9b8456c881123d4359
MD5 c65def5a7ff23ff1b18a53e0319162b1
BLAKE2b-256 c4ccdb84a8187a7f2440afe6a3a5cef35104a48b7fa27c627333c42641f7bcd8

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.2-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.2-cp37-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 021592c1a21013db9359632fdfa9ef92f7022729b15464b636f15b14e1ac999f
MD5 373f7db2f9cc38950690b49d7b3f9a6c
BLAKE2b-256 c9d05ca9ff481adfd4db3793a93d616298f51d59cb23d9ebbcd8319cd0e3b98b

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.2-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.2-cp36-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f6ff7b943aa4bcf7ea802f7a1886e4f9b0d3ddeab630aeea67c81ce58e0206b
MD5 cda1abb86a6d321504c98c7948f686f6
BLAKE2b-256 c7dd0de566507f27d33cb6c0c90ec06e762baf156d3fa2e105c579ce34c289e4

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