Define Repository Rules for Model Library
Define Repository Rules for Model Library
This guide explains how to define Repository Rules to control which model image repositories and tags from your connected registries appear in the AI Factory Model Library.
Repository Rules help you manage:
- Scope of image discovery
- Governance over which images are exposed
- Version control by controlling which tags are visible
Who should use this guide?
- AI platform admins integrating private registries
- DevOps engineers managing container registry integrations
- Security/compliance teams governing AI model image usage
What this enables
- You can precisely control which image repositories HCP syncs.
- You can filter which tags within each repository are exposed.
- You can govern which images are available in the Model Library for deployment.
Estimated time to complete
5–10 minutes per Repository Rule.
Prerequisites
- You must have already Integrated your Private Registry.
- Your registry must appear in AI Factory > Model Library > Manage Repositories.
Understanding Repository Rules
Repository Rules are attached to each configured registry.
They allow you to define:
- Which repositories to discover
- Which tags within those repositories to expose
This prevents accidental exposure of test images, unvetted model builds, or entire registry contents.
Repository Rules are evaluated periodically — newly pushed images matching the rule will appear in Model Library on the next sync.
How Repository Rules work
Each rule typically includes:
Field | Description |
---|---|
Repository Name | Name of the repository to include (exact match or pattern) |
Tag Filter | (Optional) Filter for tag names (exact match, prefix, regex) |
Rule Enabled | Whether this rule is currently active |
Example:
Repository Name | Tag Filter |
---|---|
my-company/llama3-models | ^release-.* |
→ Only tags starting with release-
in my-company/llama3-models
will appear.
Defining Repository Rules
1. Navigate to Repository Rules
- Go to:
AI Factory > Model Library > Manage Repositories
- Click Manage Rules for your desired registry.
2. Add a Repository Rule
Click Add Rule.
Fill in:
- Repository Name — required
- Tag Filter — optional
- Enable/Disable toggle
Click Save.
The rule will appear in the rules list.
3. Wait for next sync or trigger manual sync
HCP will apply rules on the next registry sync cycle.
If your UI supports manual sync:
- Click Sync Now after adding/updating a rule.
4. Verify Model Library content
- Go to AI Factory > Model Library.
- Use filters to browse images from your registry.
- Confirm only desired repositories/tags appear.
Example Use Cases
Basic: Restrict to a single repo
Repository Name | Tag Filter |
---|---|
my-org/nim-models | (blank — all tags) |
→ All tags in my-org/nim-models
will appear.
Advanced: Filter to production tags
Repository Name | Tag Filter |
---|---|
models/gpt4 | ^prod-.* |
→ Only tags starting with prod-
will appear.
Multi-repo governance
- Add multiple Repository Rules per registry as needed.
- Use Tag Filters to align with your model promotion pipelines (dev, staging, prod).
Tips & Best Practices
- Be explicit — add Repository Rules for only the repositories you want to expose.
- Use Tag Filters to enforce version governance and CI/CD promotion stages.
- Regularly audit Repository Rules to ensure compliance with internal image standards.
- If your registry uses structured tagging (e.g.,
prod-
,test-
), leverage Tag Filters to separate experimental from production models.
Troubleshooting
Images not appearing
- Check that Repository Rule exists for the desired repo.
- If using Tag Filter — verify tags match the filter exactly.
- Check when the last sync ran; trigger manual sync if needed.
Too many images appearing
- Refine Repository Rules.
- Add Tag Filters to narrow scope.
Repository Rule has no effect
- Confirm repository name is exact (case sensitive).
- Ensure Rule is enabled.
- Trigger manual sync and check HCP logs if issue persists.
Summary
- Repository Rules govern which image repositories and tags appear in Model Library.
- You can scope exposure by repository name and tag filters.
- This supports governance, version control, and security best practices.
- Fine-grained control helps ensure only vetted model images are deployed.
Related Links
- On this page
- Define Repository Rules for Model Library
← Prev
Model Library How-To Guides
↑ Up
Model Library How-To Guides
Next →
How to Deploy AI Models from Model Library
Could this page be better? Report a problem or suggest an addition!