Normalize provider model IDs before capability resolution#215
Merged
Conversation
…y resolution (#204) Model capability detection relied on exact model ID matches, which broke for local/runtime-specific identifiers like GGUF filenames, quantized variants, and Ollama tags. Enhance ModelIdNormalizer with a multi-step pipeline that strips .gguf extensions, quantization suffixes (-Q5_K_M, -IQ2_XXS, etc.), lowercases PascalCase names, and removes trailing build variant segments (-UD, -BPW4). Add dynamic suffix scan to OpenRouterOracleResolver so unprefixed candidates match catalog entries without maintaining a static prefix map for every model family. Update HuggingFaceCapabilityResolver to use the normalizer instead of ad-hoc Ollama tag stripping. Add GetDisplayName() for human-friendly model names in status output, stripping file-format noise while preserving original casing.
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.
Summary
Closes #204
ModelIdNormalizerto strip.ggufextensions, GGML quantization suffixes (-Q5_K_M,-IQ2_XXS,-Q4_K_XL), lowercase PascalCase names, and remove trailing build-variant segments (-UD,-BPW4)OpenRouterOracleResolver— when exact lookup misses, scan catalog for entries ending with/{candidate}, eliminating the need to maintain a static prefix map for every model familyHuggingFaceCapabilityResolverto useModelIdNormalizer.GetCandidates()instead of ad-hoc Ollama tag strippingGetDisplayName()for clean model names in status output (e.g.,Qwen3.5-35B-A3B-UDinstead ofQwen3.5-35B-A3B-UD-Q4_K_XL.gguf)Verified locally
Before (stock daemon):
After (test build):
Test plan
dotnet slopwatch analyze: 0 violations