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 does this PR do?
(Used claude to solve #3715, coded with claude but tested by me)
From claude summary:
Problem: The
NVIDIAInferenceAdapter
class was missing thealias_to_provider_id_map
attribute, which caused the error:ERROR 'NVIDIAInferenceAdapter' object has no attribute 'alias_to_provider_id_map'
Root Cause: The
NVIDIAInferenceAdapter
only inherited fromOpenAIMixin
, but some parts of the system expected it to have thealias_to_provider_id_map
attribute, which is provided by theModelRegistryHelper
class.Solution:
ModelRegistryHelper
class fromllama_stack.providers.utils.inference.model_registry
OpenAIMixin
andModelRegistryHelper
__init__
method that properly initializes theModelRegistryHelper
with empty model entries (since NVIDIA uses dynamic model discovery) and the allowed models from the configurationKey Changes:
from llama_stack.providers.utils.inference.model_registry import ModelRegistryHelper
class NVIDIAInferenceAdapter(OpenAIMixin):
toclass NVIDIAInferenceAdapter(OpenAIMixin, ModelRegistryHelper):
__init__
method that callsModelRegistryHelper.__init__(self, model_entries=[], allowed_models=config.allowed_models)
The inheritance order is important -
OpenAIMixin
comes first to ensure itscheck_model_availability()
method takes precedence over theModelRegistryHelper
version, as mentioned in the class documentation.This fix ensures that the
NVIDIAInferenceAdapter
has the requiredalias_to_provider_id_map
attribute while maintaining all existing functionality.Test Plan
Launching llama-stack server successfully, see logs:
tested with curl model, it also works: