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

Downloading a model version with SDK

This example assumes the program is running in an MLSteam system. If it is not the case, you may need to setup API_TOKEN with mlsteam-model-cli init --api_token=YOUR_API_TOKEN

You will need administrator privileges to download or load encrypted model versions. For this case, either run the following program with sudo, or enter your password in a sudo prompt during program execution.

sudo python your_program.py

or during execution

[sudo] password for some_username:

Administrator privileges are not required when you only process non-encrypted model versions.

from mlsteam_model_sdk.sdk.model import Model

sdk_model = Model()
sdk_model.download_model_version(project_name='project_owner/project_name',
                                 model_name='model_name',
                                 version_name='version_name')

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 download or load encrypted model versions, as mentioned in the previous example.

Initialize the SDK settings if you have not done so:

mlsteam-model-cli init

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

To import a package:

# for non-encrypted packages
mlsteam-model-cli mv import-local -f path/to/pkg/file

# for encrypted packages
mlsteam-model-cli mv import-local -f path/to/pkg/file -k path/to/enckey/file

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

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

mlsteam_model_sdk-0.4.0-cp310-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (134.4 kB view details)

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

mlsteam_model_sdk-0.4.0-cp39-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141.2 kB view details)

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

mlsteam_model_sdk-0.4.0-cp38-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (147.2 kB view details)

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

mlsteam_model_sdk-0.4.0-cp37-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (134.4 kB view details)

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

mlsteam_model_sdk-0.4.0-cp36-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (132.2 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.0-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.0-cp311-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3d571a06e7508f6590aa649ee269cf1ad1cc606e0e4e186301c8cbb9c7ca0cb
MD5 b44a4328c740da367e8a3c779bf62518
BLAKE2b-256 5bda3fe5b85697dad115c56bdc5c04bf5ef62eb8967e520533e791922155171b

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.0-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.0-cp310-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b273d2395c4a0b6f8347ee36724d72973ffca59fe418fd74176fdb1d5ea1f724
MD5 3da299d43c617a4b124b21029b5ff8ee
BLAKE2b-256 80ee2b9180a490bdba9981bb5d64b3f459e5a2ece82d0189fbecf8e30a8a4c56

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.0-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.0-cp39-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6e4743bbdd1cb6b06323208b8d1aa60fe3e1cd3c78da7e7f0f12468b79e3ab26
MD5 3e2d9bbf05c6b08ae1648de9b975458c
BLAKE2b-256 e229d423ad4f6e841a149d3d9c55e78aa76f264236ec277076f011cd28c305f9

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.0-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.0-cp38-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fcafac71c8f596804516d451fa1c1bcd64781a6332a408ae474436a6d9d41551
MD5 e0f841f173ea27080e340317a6569798
BLAKE2b-256 eb850b5babea0d8fe2103ffafdc79db7d978f9472421a8cf603c9fd86a570de4

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.0-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.0-cp37-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95d2db9037bab5f8246439c4886ddd16bfee41e087a6c57d3627b7fc43e0c07f
MD5 3d0fe199d21ff838438f7e47e6fc15fe
BLAKE2b-256 164637c775a49379de089f1e41253d5eeb69415b45317d65be92e2183c560091

See more details on using hashes here.

File details

Details for the file mlsteam_model_sdk-0.4.0-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.0-cp36-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d9dd98c0dc8fc5b819dedcb4a7adfd8ac5c6192f2fd4854e15de471c7f58254
MD5 9e609e5c5b0ede39506491ae6817b7db
BLAKE2b-256 313d9da4c97c9dc263a251844d2fd1c70139de0744f1013b2939776af9eee539

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