Skip to content

[Core] Add shared Hugging Face artifact identity and state repository - #734

Open
op109lvb wants to merge 1 commit into
mainfrom
hf-identity
Open

[Core] Add shared Hugging Face artifact identity and state repository#734
op109lvb wants to merge 1 commit into
mainfrom
hf-identity

Conversation

@op109lvb

@op109lvb op109lvb commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Adds the foundation for shared Hugging Face artifact tracking in model-agent.

This includes HF artifact identity parsing from model annotations, canonical artifact key/path generation, shared parent artifact state in the node ConfigMap, and a repository for lock-safe parent/child reference updates.

Why we need it

HF-origin models can resolve to the same immutable artifact by hf-model-id + hf-model-sha. A durable node-local state model lets model-agent track the shared parent artifact and its child model references safely.

This also provides a migration path for the existing direct HF reuse and the foundation for HF-origin OCI Object Storage reuse.

This PR does not change model download behavior yet.

PR Plan

This is the first PR in the staged model-agent work:

  1. Shared HF artifact identity and state repository.
  2. Shared artifact lifecycle planning.
  3. HF-origin OCI Object Storage artifact reuse.
  4. Model agent startup recovery, shared parent validation and incomplete-state hardening.
  5. Direct HF source reuse cleanup.

Changes Made

  • Added HF artifact identity and shared artifact ConfigMap entry types.
  • Added metadata validation and canonical key/path helpers.
  • Added repository operations for artifact lock, status, reference, and delete updates.
  • Added HfArtifactKey on model entries for child-to-parent lookup.
  • Added unit coverage for identity validation and repository state transitions.

How to test

go test ./pkg/modelagent ./pkg/constants -count=1
go test -race ./pkg/modelagent -count=1
go vet ./pkg/modelagent

Checklist

  • Tests added/updated (if applicable)
  • Docs updated (if applicable)
  • make test passes locally

@github-actions github-actions Bot added model-agent Model agent changes tests Test changes labels Aug 11, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Pre-commit checks failed

Please run the following locally and commit the fixes:

pre-commit run --all-files
git add -u && git commit

See CONTRIBUTING.md for setup instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model-agent Model agent changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant