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 asudo
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:
- model version package (required)
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for mlsteam_model_sdk-0.4.4-cp311-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9bcb50853ebe854c1433ccd12e85d04af2610969e751c5843901919b9138aa |
|
MD5 | 26589db26846d86bf02e531fdf3642c2 |
|
BLAKE2b-256 | 3b0646ad7bdd0ebc3ebcd4882992f9383753574a4bbf618c622b4bccf070817e |
Hashes for mlsteam_model_sdk-0.4.4-cp310-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1227caafdc38abdd57ea94a1817305e36da4e9c316e036e9b00c4987fa5f1d02 |
|
MD5 | 7fe4d18218dc613293d7342d66fda270 |
|
BLAKE2b-256 | cfa1e16406668ead50c110c73d4a6cd898d4149a84d6244da2cc10c90282f4ff |
Hashes for mlsteam_model_sdk-0.4.4-cp39-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 348f8488bfd26c147efe1b620623c995d45a9de6f413b1baff5da10b63e09e68 |
|
MD5 | a6d5daee246bfe6c4b107ce22f0e2f10 |
|
BLAKE2b-256 | 1716907359a51ea9d986d30c094dd1843e9c37382ed74abce174853b1950a006 |
Hashes for mlsteam_model_sdk-0.4.4-cp38-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9c88a906d2c923d67c746e3c3c6e529a015a76b436608928468901780b7a6e1 |
|
MD5 | 7d3f9077ce6063e57febae689ffd210f |
|
BLAKE2b-256 | 5bc8fc1dd4578e9bb6834950ba34c526090ff76401f394d13a66dfa9d627c2d5 |
Hashes for mlsteam_model_sdk-0.4.4-cp37-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e65bf2b8d43e202a0c2b51ef99cfadda51a2c0a5071387cba5c1d7c0f1faf14a |
|
MD5 | ff3ad1eaef5bb47c79e7599cef0c4868 |
|
BLAKE2b-256 | 672a04f96fa1a2e09e9b2a78fb888e69aa2a885609a35348966875c784b06546 |
Hashes for mlsteam_model_sdk-0.4.4-cp36-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ddae83eb0112e4b559ba6bb9160cbd13f436fc3c64b075c7a4f8e6599d6afcc |
|
MD5 | f31af5cb11e56b85e9cbe1a8570b7369 |
|
BLAKE2b-256 | 5d6a637308d7783bc1c30f6fb2e0658b1062f72da6743ea3d903dad092cd648d |