vipr.plugins.registry.backends package

Submodules

vipr.plugins.registry.backends.hf module

HuggingFace-backed remote backend for the VIPR model registry.

class vipr.plugins.registry.backends.hf.HFIndex(*, format_version: int = 1, packages: list[~vipr.plugins.registry.backends.hf.HFIndexEntry] = <factory>)

Bases: BaseModel

Schema for HuggingFace-hosted registry index.yaml.

format_version: int
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

packages: list[HFIndexEntry]
class vipr.plugins.registry.backends.hf.HFIndexEntry(*, domain: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], name: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], version: ~typing.Annotated[str, _PydanticGeneralMetadata(pattern='^(?:v)?\\d+\\.\\d+\\.\\d+$')], description: str | None = None, tags: dict[str, ~typing.Any] = <factory>)

Bases: BaseModel

One registry package entry declared in remote index.yaml.

description: str | None
domain: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
tags: dict[str, Any]
version: str
class vipr.plugins.registry.backends.hf.HFRegistryBackend(repo_id: str, repo_type: str = 'model')

Bases: RegistryBackend

HuggingFace-backed registry backend with local cache resolution.

is_cached(uri: str) bool

Return True when a package snapshot is already present in local HF cache.

list(domain: str | None = None, force_refresh: bool = False) list[ModelEntry]

List package versions from remote index.yaml.

prefetch(uri: str) tuple[Path, str]

Ensure package is available in local HF cache and return path + status.

Returns:

tuple[path, status], where status is either “cached” or “downloaded”.

promote(uri: str, alias: str) None
push(package_dir: Path) str
resolve(uri: str) Path

Resolve vipr://hf/… URI to a cached local package directory.

vipr.plugins.registry.backends.local module

Filesystem-backed local backend for the VIPR model registry.

class vipr.plugins.registry.backends.local.LocalRegistryBackend(root_dir: Path | None = None)

Bases: RegistryBackend

Filesystem-backed local registry backend.

list(domain: str | None = None, force_refresh: bool = False) list[ModelEntry]

List local registry model versions with alias and metadata context.

promote(uri: str, alias: str) None

Assign or move a mutable alias to a concrete immutable version.

push(package_dir: Path) str

Validate and store a package at an immutable version path.

resolve(uri: str) Path

Resolve a pinned version or alias URI to a package directory path.

vipr.plugins.registry.backends.protocol module

Protocol definitions for registry backend implementations.

class vipr.plugins.registry.backends.protocol.RegistryBackend(*args, **kwargs)

Bases: Protocol

Backend interface for model package storage and resolution.

list(domain: str | None = None, force_refresh: bool = False) list[ModelEntry]
promote(uri: str, alias: str) None
push(package_dir: Path) str
resolve(uri: str) Path

Module contents

Registry backend implementations and backend-facing protocols.

class vipr.plugins.registry.backends.LocalRegistryBackend(root_dir: Path | None = None)

Bases: RegistryBackend

Filesystem-backed local registry backend.

list(domain: str | None = None, force_refresh: bool = False) list[ModelEntry]

List local registry model versions with alias and metadata context.

promote(uri: str, alias: str) None

Assign or move a mutable alias to a concrete immutable version.

push(package_dir: Path) str

Validate and store a package at an immutable version path.

resolve(uri: str) Path

Resolve a pinned version or alias URI to a package directory path.

class vipr.plugins.registry.backends.RegistryBackend(*args, **kwargs)

Bases: Protocol

Backend interface for model package storage and resolution.

list(domain: str | None = None, force_refresh: bool = False) list[ModelEntry]
promote(uri: str, alias: str) None
push(package_dir: Path) str
resolve(uri: str) Path