fix(models): Prefix digit-leading upstream model ids#65
Merged
Conversation
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
📝 WalkthroughWalkthroughThe PR updates model identifier normalization to handle digit-leading IDs by prefixing them with ChangesDigit-leading Normalization with m- Prefix
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
|
Contributor
|
lmao jinx #67 |
mckornfield
approved these changes
May 27, 2026
Contributor
mckornfield
left a comment
There was a problem hiding this comment.
m- is probably better than md- and mine has lint failures
aray12
pushed a commit
that referenced
this pull request
May 28, 2026
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> Signed-off-by: Alex Ray <alray@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When the models controller reconciler discovers models from an external provider, it normalizes each upstream id to an internal entity name that satisfies the entity store's RFC 1035-style
NAME_PATTERN(leading[a-z], length 2-63, only[a-z0-9-]). Upstream catalogs occasionally publish digit-leading ids — e.g. NVIDIA Build's01-ai/yi-large— which the normalizer rejects because01-ai-yi-largedoesn't start with a letter. The reconciler then logsSkipped 1 model(s) with invalid names ...on every cycle (~every 5s) and the model never becomes routable.This PR teaches
normalize_model_entity_nameto prepend an internalm-prefix when the cleaned form starts with a digit, so digit-leading upstream ids become valid entity names instead of being skipped.Why this approach
model_entity_id. Theserved_model_namemapping still preserves the original id (provider_reconciler.py:707), so the IGW continues to forward01-ai/yi-large(the original) to the backend. End users keep calling the model exactly as the upstream advertises it.m-prefix is mechanical, idempotent (m-01-ai-yi-large→m-01-ai-yi-large), and preserves the source id verbatim after the prefix, so the entity name still reads like the upstream id.Considered and rejected: provider-derived prefixes (collide with the existing
workspace/nameconvention, lengthen names), spelling out leading digits (lossy/weird), dropping leading digits (collisions across ids that differ only in the digit segment), hash prefixes (ugly, inconsistent with the existing policy of hashing only on overflow).Verification
01-ai/yi-large,9model,123,2pac/rapper-model.test_entity_name_from_discovered_model_invalid_raisesand addedtest_entity_name_from_discovered_model_digit_leading_gets_prefixso the reconciler's caller-side contract is also pinned.services/core/models/tests/unitsuite: 992 passed, 1 skipped.ruff check/ruff format --checkclean.tyclean for the change (5 pre-existing diagnostics in unrelated functions in the same file).Tracking
Signed-off-by: Matthew Grossman mgrossman@nvidia.com
Summary by CodeRabbit
Bug Fixes
Tests