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

Uploaded Source

Built Distribution

omlmd-0.1.3-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omlmd-0.1.3.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for omlmd-0.1.3.tar.gz
Algorithm Hash digest
SHA256 87fc35fb810068a2794ac4fce4cd4804d64653d24ad6524b54015cf81a428207
MD5 ef74880a0a0a046fd30c6958e212f698
BLAKE2b-256 74db3ec3fb9ade840aa1e327fc980b60f2cd66b592ee5a1a4d5a6a86e714cdbf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omlmd-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for omlmd-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fc3f2da58590cd29aa992a3492beb0e7bdd59825af0195ed24d9cc751ea1f8d7
MD5 9dc6411311210d0e5f32100f345a8efb
BLAKE2b-256 623215af7eac5fb8d1880bb2ac5b6761ff9d062e45ea88a4b150176db78fd8f6

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