def _llm_config_to_client(self, llm_config: LLMConfig | str) -> LLM:
        """
        For the selected LLMConfig dynamically create an LLM instance. NotDiamondSelector will
        assign this to self._llm to help select the best index.
        """
        if isinstance(llm_config, str):
            llm_config = LLMConfig.from_string(llm_config)
        provider, model = llm_config.provider, llm_config.model

        output = None
        if provider == "openai":
            from llama_index.llms.openai import OpenAI

            output = OpenAI(model=model, api_key=os.getenv("OPENAI_API_KEY"))
        elif provider == "anthropic":
            from llama_index.llms.anthropic import Anthropic

            output = Anthropic(model=model, api_key=os.getenv("ANTHROPIC_API_KEY"))
        elif provider == "cohere":
            from llama_index.llms.cohere import Cohere

            output = Cohere(model=model, api_key=os.getenv("COHERE_API_KEY"))
        elif provider == "mistral":
            from llama_index.llms.mistralai import MistralAI

            output = MistralAI(model=model, api_key=os.getenv("MISTRALAI_API_KEY"))
        elif provider == "togetherai":
            from llama_index.llms.together import TogetherLLM

            output = TogetherLLM(model=model, api_key=os.getenv("TOGETHERAI_API_KEY"))
        else:
            raise ValueError(f"Unsupported provider for NotDiamondSelector: {provider}")

        return output

        For the selected LLMConfig dynamically create an LLM instance. NotDiamondSelector will
        assign this to self._llm to help select the best index.
        
llama-index-integrations/selectors/llama-index-selectors-notdiamond/llama_index/selectors/notdiamond/base.py