Skip to content

Module redlite.model.openai_model

Classes

OpenAIModel

class OpenAIModel(
    *,
    model='gpt-3.5-turbo',
    base_url=None,
    api_key=None,
    max_retries=2,
    **params
)

Model that calls OpenAI Completion API.

  • base_url (str): Alternative API endpoint. Can be used to access services that are compatible with OpenAI (e.g. NVIDIA research).
  • model (str): Name of the OpenAI model. Default is "gpt-3.5-turbo".
  • api_key (str): OpenAI API key
  • max_retries (int): How many times to retry a failed request. Default is 2.
  • params: (dict[str,Any]): Other parameters that will be passed on to the OpenAI as-is.

Ancestors (in MRO)

  • redlite._core.NamedModel