Skip to main content

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)

Release files for alloniamlops 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alloniamlops 1.0.0
File Size Uploaded
alloniamlops-1.0.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alloniamlops 1.0.0
File Interpreter ABI Platform
alloniamlops-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / alloniamlops-1.0.0.tar.gz

Download URL alloniamlops-1.0.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
48b9d76703e41840ed906842ae4930aa7cade5cad673e0eda2a6d2e302f25b6e
BLAKE2b-256 checksum
How to use checksums
52a0696abcb0eee94bbe05ffcba850ba47241e5c531897fceaa4c72d9b1f50b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.1 Linux/5.4.0-148-generic

Release files / alloniamlops-1.0.0-py3-none-any.whl

Download URL alloniamlops-1.0.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b57d0f66d1d872e06421efac584baafa908178bb4d5ca14e225f87aa47e60b09
BLAKE2b-256 checksum
How to use checksums
05623553cf78679f416f1927650f61e880ffd8f6473c5d5031137787fda408da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.1 Linux/5.4.0-148-generic

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page