vipr.plugins.registry package¶
Subpackages¶
Submodules¶
vipr.plugins.registry.controller module¶
CLI controller for local model registry operations.
- class vipr.plugins.registry.controller.RegistryController(*args: Any, **kw: Any)¶
Bases:
ArgparseControllerRegistry management commands.
- class Meta¶
Bases:
object- help = 'Model registry commands'¶
- label = 'registry'¶
- stacked_on = 'base'¶
- stacked_type = 'nested'¶
- bundle()¶
Validate and register a package directory in the local registry.
- list()¶
List package entries from the local registry backend.
- promote()¶
Assign/move an alias to a model version.
- show()¶
Resolve and inspect a registered model package.
- sync()¶
Prefetch configured HF registry packages.
Requires VIPR_HF_REPO to be set so the HF backend is available.
vipr.plugins.registry.errors module¶
Registry-specific exception types.
- exception vipr.plugins.registry.errors.PackageError¶
Bases:
RegistryErrorRaised when a model package or manifest is invalid.
- exception vipr.plugins.registry.errors.RegistryError¶
Bases:
VIPRErrorBase class for registry errors.
- exception vipr.plugins.registry.errors.RegistryUriError¶
Bases:
RegistryErrorRaised when a registry URI is malformed or unsupported.
vipr.plugins.registry.hash_utils module¶
Shared checksum helpers for the registry plugin.
vipr.plugins.registry.models module¶
Pydantic models and validation helpers for registry model packages.
- class vipr.plugins.registry.models.ArtifactEntry(*, role: Annotated[str, MinLen(min_length=1)], path: Annotated[str, MinLen(min_length=1)], format: str | None = None, sha256: str | None = None)¶
Bases:
BaseModelDescribes a package artifact file referenced by the manifest.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr.plugins.registry.models.DefaultPredictorSpec(*, handler: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], parameters: dict[str, ~typing.Any] = <factory>)¶
Bases:
BaseModelDeclares predictor defaults for a registry package.
Maps to
inference.predictionin user YAML: -default_predictor.handler->prediction.handler(injected if absent) -default_predictor.parameters->prediction.parametersdefaults(user values override per key)
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr.plugins.registry.models.FilterRequirement(*, class_: Annotated[str, MinLen(min_length=1)], hook: Annotated[str, MinLen(min_length=1)], method: str | None = None)¶
Bases:
BaseModelDeclares a required preprocessing filter contract.
Maps to
inference.filtersin user YAML: -hook-> filter hook key (for exampleINFERENCE_PREPROCESS_PRE_FILTER) -class-> must match an enabled filter entry’sclassunder that hook -method-> optional hint used for actionable error messages- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr.plugins.registry.models.ModelBuilderSpec(*, handler: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], parameters: dict[str, ~typing.Any] = <factory>)¶
Bases:
BaseModelSpecifies which model builder handler should reconstruct the model.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr.plugins.registry.models.ModelEntry(*, backend: str = 'local', domain: str, name: str, version: str, aliases: list[str] = <factory>, description: str | None = None, tags: dict[str, ~typing.Any] = <factory>)¶
Bases:
BaseModelSummarized metadata for vipr registry list output.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vipr.plugins.registry.models.ModelPackage(*, format_version: int = 1, name: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], version: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], domain: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], family: str | None = None, description: str | None = None, model_builder: ~vipr.plugins.registry.models.ModelBuilderSpec, default_predictor: ~vipr.plugins.registry.models.DefaultPredictorSpec | None = None, requires: ~vipr.plugins.registry.models.PackageRequiresSpec | None = None, artifacts: list[~vipr.plugins.registry.models.ArtifactEntry] = <factory>, metrics: dict[str, ~typing.Any] = <factory>, tags: dict[str, ~typing.Any] = <factory>, lineage: dict[str, ~typing.Any] | None = None)¶
Bases:
BaseModelCanonical registry package manifest.
- artifacts: list[ArtifactEntry]¶
- default_predictor: DefaultPredictorSpec | None¶
- classmethod from_dir(package_dir: str | Path) ModelPackage¶
Load and parse manifest.yaml from a package directory.
- get_artifact(role: str) ArtifactEntry¶
Return first artifact with the requested role.
- model_builder: ModelBuilderSpec¶
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- requires: PackageRequiresSpec | None¶
- validate(package_dir: str | Path, app=None) None¶
Validate package in one call.
Kept as convenience wrapper: runs file checks and, when provided, runtime checks that require a configured app.
- validate_files(package_dir: str | Path) None¶
Validate package structure and file integrity.
This check is environment-agnostic and safe for registry push(): - supported format version - artifact paths are relative and stay within package directory - all artifacts exist as files - optional sha256 checksums match
- class vipr.plugins.registry.models.PackageRequiresSpec(*, preprocess_filters: list[~vipr.plugins.registry.models.FilterRequirement] = <factory>)¶
Bases:
BaseModelOptional contract requirements a package expects from inference config.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- preprocess_filters: list[FilterRequirement]¶
vipr.plugins.registry.registry_loader module¶
Generic model loader that resolves model URIs via the registry service.
- class vipr.plugins.registry.registry_loader.RegistryLoaderParams(*, model_uri: str, device: str | None = None, builder_parameters: dict[str, ~typing.Any] = <factory>)¶
Bases:
BaseModelParameters for the generic registry_loader model loader.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
vipr.plugins.registry.service module¶
Registry service facade attached to the VIPR app.
- class vipr.plugins.registry.service.RegistryService(app, backends: dict[str, RegistryBackend] | None = None)¶
Bases:
objectFacade for registry operations.
Phase 1 delegates to a single local backend, but keeps a dispatch surface so additional backends can be added later without changing callers.
- get_backend(name: str) RegistryBackend¶
Return backend by name or raise an actionable URI error.
- list(domain: str | None = None, backend: str = 'local', force_refresh: bool = False) list[ModelEntry]¶
List package versions in the selected backend.
- parse_uri(uri: str) ParsedModelUri¶
Parse and validate a model URI.
vipr.plugins.registry.uri module¶
URI helpers for the VIPR model registry.
- class vipr.plugins.registry.uri.ParsedModelUri(backend: str, domain: str, name: str, ref: str)¶
Bases:
objectParsed components of a model URI.
- vipr.plugins.registry.uri.is_version_like(ref: str) bool¶
Return True when a string looks like a pinned semantic version.
- vipr.plugins.registry.uri.parse_model_uri(uri: str) ParsedModelUri¶
Parse a vipr://<backend>/<domain>/<name>@<ref> model URI.
Module contents¶
VIPR model registry plugin (Phase 1 local backend).
- vipr.plugins.registry.load(app)¶
Load registry plugin components and attach registry facade to app.