Skip to main content

OCI Artifact for ML model & metadata

Project description

OCI Artifact for ML model & metadata

Python License Build E2E testing PyPI - Version

Static Badge GitHub Repo stars YouTube Channel Subscribers

This project is a collection of blueprints, patterns and toolchain (in the form of python SDK and CLI) to leverage OCI Artifact and containers for ML model and metadata.

Documentation: https://containers.github.io/omlmd

GitHub repository: https://github.com/containers/omlmd
YouTube video playlist: https://www.youtube.com/watch?v=W4GwIRPXE8E&list=PLdbdefeRIj9SRbg6Hkr15GeyPH0qpk_ww
Pypi distribution: https://pypi.org/project/omlmd

Installation

[!TIP] We recommend checking out the Getting Started tutorial in the documentation; below instructions are provided for a quick overview.

In your Python environment, use:

pip install omlmd

Push

Store ML model file model.joblib and its metadata in the OCI repository at localhost:8080:

from omlmd.helpers import Helper

omlmd = Helper()
omlmd.push("localhost:8080/matteo/ml-artifact:latest", "model.joblib", name="Model Example", author="John Doe", license="Apache-2.0", accuracy=9.876543210)

Pull

Fetch everything in a single pull:

omlmd.pull(target="localhost:8080/matteo/ml-artifact:latest", outdir="tmp/b")

Or fetch only the ML model assets:

omlmd.pull(target="localhost:8080/matteo/ml-artifact:latest", outdir="tmp/b", media_types=["application/x-mlmodel"])

Custom Pull: just metadata

The features can be composed in order to expose higher lever capabilities, such as retrieving only the metadata informatio. Implementation intends to follow OCI-Artifact convention

md = omlmd.get_config(target="localhost:8080/matteo/ml-artifact:latest")
print(md)

Crawl

Client-side crawling of metadata.

Note: Server-side analogous coming soon/reference in blueprints.

crawl_result = omlmd.crawl([
    "localhost:8080/matteo/ml-artifact:v1",
    "localhost:8080/matteo/ml-artifact:v2",
    "localhost:8080/matteo/ml-artifact:v3"
])

Example query

Demonstrate integration of crawling results with querying (in this case using jQ)

Of the crawled ML OCI artifacts, which one exhibit the max accuracy?

import jq
jq.compile( "max_by(.config.customProperties.accuracy).reference" ).input_text(crawl_result).first()

To be continued...

Don't forget to checkout the documentation website for more information!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omlmd-0.1.5.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

omlmd-0.1.5-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file omlmd-0.1.5.tar.gz.

File metadata

  • Download URL: omlmd-0.1.5.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for omlmd-0.1.5.tar.gz
Algorithm Hash digest
SHA256 791dc2c5044f42c17470dc24e327eb54787b3129c87cd3cab5d90ba0ce6b8b38
MD5 23ea0d8ac8da6f6829ca4a8bb47d89e7
BLAKE2b-256 069cd567618ace3e3b9e827b93cd483280767700351e4eaba481dfc90fbafff2

See more details on using hashes here.

File details

Details for the file omlmd-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: omlmd-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for omlmd-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 024f9cab654499785f62aecef03a2e6e3528c376350d7e9fddeb5c93201b6fd5
MD5 dbc00ca5b46912b098d721776f8fca56
BLAKE2b-256 c365b53300c2e7d03e2004288ac0e4dbbd516eabc236e92640edcf680e6dca80

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