Skip to content

Add Support for Importing HuggingFace Models to GitLab Model Registry

Problem to Solve

Currently, there's no direct way to import models from HuggingFace Hub into GitLab's model registry using the GitLab MLOps client, a common working pattern for data scientists. This feature would streamline the process of importing pre-trained models and maintaining them within GitLab's MLOps ecosystem.

Proposal

Add functionality to the GitLab MLOps client that allows users to import models directly from HuggingFace Hub into GitLab's model registry, including metadata, model files, and documentation.

Possible API

model = client.import_from_huggingface(
    repo_id="bert-base-uncased",
    model_name="BERT Base Uncased",
    version="1.0.0"
)

Acceptance Criteria

  • Implement model downloading and verification
  • Create model registry entry creation with metadata
  • Add documentation import from model cards
  • Implement proper error handling for failed downloads or API issues
  • Documentation for feature