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.6.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

omlmd-0.1.6-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omlmd-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 0fe58511d618ac262c2bf14d19002f4dc2dd05d768d0735319495e8822b46b7a
MD5 e39c24cec3fd9ad31676e4ec064fc990
BLAKE2b-256 1a0ba961ba322bed0811b5855c523df6456d46774381434b26e0cbc99f537bb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omlmd-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 13.1 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cb7821379f3f64ea8f24e61dc956db4752cf900c35ceac4b3f19ea7f038d528d
MD5 220e3fb097493bb429d39f791c31209b
BLAKE2b-256 415e70448815cf1d0514d0d7252f31bc577acfed77714ed31c1ddd14b8f7eb0d

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