Skip to main content

Module metadata_registry

Module metadata_registry 

Source
Expand description

Worker-side index from a model metadata file’s identity to its on-disk path. When a worker self-hosts metadata, it registers each file here and rewrites the MDC’s CheckedFile.path to a /v1/metadata/{namespace}/{component}/{endpoint}/{slug}/{suffix}/{filename} URL on its own system_status_server. The route handler reads paths back out by the same key and streams the bytes to the frontend, which blake3-verifies them against the MDC.

The endpoint triple in the key disambiguates multiple LocalModel instances coexisting on one DRT (e.g. different roles attaching the same base model). suffix is the LoRA slug (or "_base" for non-LoRA), scoping each registration so detaching a LoRA doesn’t unregister the base model’s files.

Each entry also stores its Owner = (instance_id, lora_slug) so unregister_for_owner can clean up on detach without the caller threading the model slug. register returns Err(CollisionError) on conflict — the caller propagates and the worker fails to start.

Structs§

CollisionError
Registration collided with a different owner — programmer error.
MetadataArtifactRegistry
Cloning shares the underlying map.

Constants§

BASE_SUFFIX
Sentinel suffix for non-LoRA registrations. LoRA suffixes are Slug::slugify outputs ([a-z0-9_-]+); a name that slugifies to _base would collide with this sentinel and is not supported.

Type Aliases§

Owner
(instance_id, lora_slug). None lora_slug = base model.