Skip to main content
Version: 1.0

aixplain.utils.llm_utils

get_llm_instance

def get_llm_instance(llm_id: Text,
api_key: Optional[Text] = None,
use_cache: bool = True) -> LLM

[view_source]

Get an LLM instance with specific configuration.

Arguments:

  • llm_id Text - ID of the LLM model to use.
  • api_key Optional[Text], optional - API key to use. Defaults to None.
  • use_cache bool, optional - Whether to use caching for model retrieval. Defaults to True.

Returns:

  • LLM - Configured LLM instance.

Raises:

  • Exception - If the LLM model with the given ID is not found.