OCI Artifact for ML model & metadata
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
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!
Metadata
Release files for omlmd 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| omlmd-0.1.6.tar.gz | 12.4 kB | Without provenance | Details for omlmd-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| omlmd-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for omlmd-0.1.6-py3-none-any.whl |
Total release size: 25.4 kB
Release files / omlmd-0.1.6.tar.gz
| Download URL | omlmd-0.1.6.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fe58511d618ac262c2bf14d19002f4dc2dd05d768d0735319495e8822b46b7a
|
|
BLAKE2b-256 checksum How to use checksums |
1a0ba961ba322bed0811b5855c523df6456d46774381434b26e0cbc99f537bb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / omlmd-0.1.6-py3-none-any.whl
| Download URL | omlmd-0.1.6-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb7821379f3f64ea8f24e61dc956db4752cf900c35ceac4b3f19ea7f038d528d
|
|
BLAKE2b-256 checksum How to use checksums |
415e70448815cf1d0514d0d7252f31bc577acfed77714ed31c1ddd14b8f7eb0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for omlmd 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.