oci

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: EPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package oci pulls AI model artifacts from OCI registries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// HTTPClient, when set, is used instead of the registry-derived client (tests).
	HTTPClient *http.Client
	// Source, when set, skips opening a remote repository (tests).
	Source ArtifactSource
	// GenericORAS skips model-spec, ModelPack, and ModelKit detectors and unpacks as ORAS.
	// Knowledge pulls always set this so they never write a model-format layout.
	GenericORAS bool
}

Adapter pulls OCI AI artifacts into the shared model store and materializes content/.

func (*Adapter) Pull

func (a *Adapter) Pull(ctx context.Context, req modelpull.Request) (*modelpull.Result, error)

Pull fetches the artifact, writes the shared store, and materializes content/. spec.files is ignored for OCI artifacts; the full artifact is always extracted.

type ArtifactSource

type ArtifactSource interface {
	Resolve(ctx context.Context, reference string) (ocispec.Descriptor, error)
	Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)
	FetchRange(ctx context.Context, desc ocispec.Descriptor, offset int64) (io.ReadCloser, bool, error)
}

ArtifactSource resolves and fetches OCI descriptors from a registry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL