Class to deploy AllOnIAModel instances using Seldon
Project description
AllOnIAMLOps Library
This module is designed to make model serving on the Aleia platform as seamless as possible.
Seldon
We provide an encapsulation of the Seldon MLOps framework to easily deploy and interact with AI models, either off-the-shelf or trained using the aleia_model module.
Example: after having trained a model called titanic, the user wants to deploy it and be able to make predictions through a REST endpoint.
import alloniamlops
ret = alloniamlops.seldon.deploy_model(
"model_titanic", # model name
1, # revision number
)
This snippet will deploy the model using Seldon and return its URL.
The user can also list the currently deployed models:
import alloniamlops
aleiamlops.seldon.list_model()
Using the URL of a deployed model, it is easy to perform a prediction:
from allonias3 import S3Path
import alloniamlops
df = S3Path("dataset/dataset.csv").read()
df.drop("Gender", axis=1, inplace=True)
alloniamlops.seldon.model_predict(
seldon_deployment_url,
names=df.columns.values,
data=df.to_numpy(),
payload_type="ndarray",
debug=True,
)
If the results are unexpected, logs can be examined as follow:
import alloniamlops
aleiamlops.seldon.tail(seldon_deployment_id, last_lines=20)
Finally, the user may want to shutdown the instance running the model:
import alloniamlops
aleiamlops.seldon.delete_model_deployment(seldon_deployment_id)
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 Distribution
Built Distribution
File details
Details for the file alloniamlops-1.0.0.tar.gz
.
File metadata
- Download URL: alloniamlops-1.0.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/5.4.0-148-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48b9d76703e41840ed906842ae4930aa7cade5cad673e0eda2a6d2e302f25b6e |
|
MD5 | ef0f53ce6b2f43330276405d851d365d |
|
BLAKE2b-256 | 52a0696abcb0eee94bbe05ffcba850ba47241e5c531897fceaa4c72d9b1f50b4 |
File details
Details for the file alloniamlops-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: alloniamlops-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/5.4.0-148-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b57d0f66d1d872e06421efac584baafa908178bb4d5ca14e225f87aa47e60b09 |
|
MD5 | a90b95e49039d2586534f863d3f6c996 |
|
BLAKE2b-256 | 05623553cf78679f416f1927650f61e880ffd8f6473c5d5031137787fda408da |