def _validate_model(self, model_name: str) -> None:
        """
        Validates compatibility of the hosted model with the client.

        Args:
            model_name (str): The name of the model.

        Raises:
            ValueError: If the model is incompatible with the client.

        """
        if self._is_hosted:
            if model := determine_model(model_name):
                if not model.client:
                    warnings.warn(f"Unable to determine validity of {model.id}")
                elif model.client != self.class_name():
                    raise ValueError(
                        f"Model {model.id} is incompatible with client {self.class_name()}. "
                        f"Please check `{self.class_name()}.get_available_models`"
                    )
                if model.endpoint:
                    self.api_base = model.endpoint
            else:
                candidates = [
                    model for model in self.available_models if model.id == model_name
                ]
                assert len(candidates) <= 1, (
                    f"Multiple candidates for {model_name} "
                    f"in `available_models`: {candidates}"
                )
                if candidates:
                    model = candidates[0]
                    warnings.warn(
                        f"Found {model_name} in available_models, but type is "
                        "unknown and inference may fail."
                    )
                else:
                    if model_name.startswith("nvdev/"):  # assume valid
                        model = Model(id=model_name)
                    else:
                        raise ValueError(
                            f"Model {model_name} is unknown, check `available_models`"
                        )
        else:
            if model_name not in [model.id for model in self.available_models]:
                raise ValueError(f"No locally hosted {model_name} was found.")

        Validates compatibility of the hosted model with the client.

        Args:
            model_name (str): The name of the model.

        Raises:
            ValueError: If the model is incompatible with the client.

        
llama-index-integrations/llms/llama-index-llms-nvidia/llama_index/llms/nvidia/base.py