class_docstr: Base class to implement a new Hugging Face LLM.
  
  LLM base class is extended to be used with HuggingFace LLM Modes APIs.
docstr: Setup the HuggingFace LLM
  
  Args:
      **kwargs: ["api_token", "max_retries"]
docstr_tok: ["Setup","the","HuggingFace","LLM","Args",":","*","*","kwargs",":","[","``","api_token","''",",","``","max_retries","''","]"]
code: def _setup(self, **kwargs):
      """
      Setup the HuggingFace LLM
  
      Args:
          **kwargs: ["api_token", "max_retries"]
  
      """
      self.api_token = (
          kwargs.get("api_token")
          or os.getenv("HUGGINGFACE_API_KEY")
          or None
      )
      if self.api_token is None:
          raise APIKeyNotFoundError(
              "HuggingFace Hub API key is required"
          )
  
      # Since the huggingface API only returns few tokens at a time, we need to
      # call the API multiple times to get all the tokens. This is the maximum
      # number of retries we will do.
      if kwargs.get("max_retries"):
          self._max_retries = kwargs.get("max_retries")
  
imports: import os
  import ast
  import re
  from abc import abstractmethod
  from typing import Any, Dict, Optional, Union, Mapping, Tuple
  import requests
  from ..exceptions import APIKeyNotFoundError, MethodNotImplementedError, NoCodeFoundError, LLMResponseHTTPError
  from ..helpers.openai import is_openai_v1
  from ..helpers.openai_info import openai_callback_var
  from ..prompts.base import AbstractPrompt
label_desc: Use image node_id 2 for calling the HuggingFaceLLM obj's underlying member method code with example usage: obj._setup() without return types