Model Repository
The core definition of the model repository feature is to provide a Git-based version-controlled storage system for machine learning models, enabling teams to manage model files, track versions, and collaborate across tenants. It leverages Git LFS for large file storage and integrates with MLOps workflows to bridge model development and deployment.
TOC
Advantages
Git-native Version Control
- Track model changes via commits/branches/tags, ensuring reproducibility.
High-Speed Transfers
- CLI/Notebook uploads leverage internal network bandwidth.
Cross-Tenant Sharing
- Shared models can be accessed across namespaces (e.g.,
publicas a model marketplace).
Seamless Integration
- Directly deploy models from the repository to inference services.
Core Features
Model Repository Creation & Deletion
- Create an empty Git-backed repository with metadata (name/description/visibility).
- Delete models after dependency checks (e.g., ensure no active inference services).
File Management
- CLI/Git LFS
- Use
git lfs trackfor large files (e.g.,*.bin,*.h5). - Example:
- Use
Version Control
- Branching
- Maintain parallel versions (e.g.,
experimentalvsmainbranches).
- Maintain parallel versions (e.g.,
- Tagging
- Mark releases via UI/CLI (e.g.,
git tag -a v2.0 -m "Stable release").
- Mark releases via UI/CLI (e.g.,
- Metadata Sync
- Auto-read
README.mdfrom the default branch for model descriptions.
- Auto-read
Cross-Tenant Sharing
- Shared Models
- Set visibility to "Shared" during creation for inter-tenant access.
- Public Marketplace
- Use
publicnamespace to publish open-source models (e.g., HuggingFace conversions).
- Use
Integration with MLOps
- Deployment Ready
- One-click inference service launch from tagged model versions.
- Notebook Integration
- Pull models directly into AML Notebooks for testing:
- Pull models directly into AML Notebooks for testing:
Technical Notes
- Git LFS Requirement
- Must include
.gitattributesto specify LFS-tracked files (e.g.,*.zip filter=lfs diff=lfs merge=lfs).
- Must include
- Default Branch Rules
- Misconfigured
README.mdmetadata may block inference deployment.
- Misconfigured
Create Model Repository
Before you begin, make sure you have Git and Git LFS installed on your system.
$ git lfs version
Step 1: Clone or initialize a repository
If you already have a remote repository, clone it. Otherwise, you can initialize a new Git repository locally.
Step 2: Initializing Git LFS
Initializing Git LFS
Step 3: Copy the model file to the repository directory (optional)
Step 4: Configure Git LFS tracking mode (choose one of the two)
-
You can choose to proactively create a
.gitattributesfile to specify the file types to track. -
Alternatively, use the git lfs migrate command to automatically check and migrate large files.
-
Option 1: Active tracking via
.gitattributes(recommended for new projects)TIPIf you already have files in your repository that you want to be tracked by Git LFS, you may want to run the following command after committing your
.gitattributeschanges to ensure Git reprocesses those files and converts them to LFS pointers:git add --renormalize .
-
Option 2: Use git lfs migrate to check and migrate (recommended for existing repositories or historical files)
The
git lfs migratecommand can find and migrate large files that already exist in your Git history (but are not tracked by LFS). This rewrites history—coordinate with collaborators. When pushing rewritten history, prefer--force-with-lease.TIPFor shared repositories: notify collaborators before migration, and when pushing rewritten history use:
git push --force-with-lease
Step 5: Add, commit, and push
Once you have configured LFS, add your files to the staging area, commit them, and push them to the remote repository.