Skip to content

Module redlite.model.gemini_model

Classes

GeminiModel

class GeminiModel(
    *,
    model: str = 'gemini-1.5-pro',
    api_key: Optional[str] = None,
    vertexai: Optional[bool] = None,
    project: Optional[str] = None,
    location: Optional[str] = None,
    thinking_budget: Optional[int] = None
)

Model that talks to Google Gemini family of models.

  • model (str): Name of the Gemini model. Default is "gemini-2.5-flash".
  • api_key (str): Google API key (see Google Cloud Console https://aistudio.google.com/u/1/apikey). This key is required to authenticate with the Gemini API. Alternatively, api key can be speciafied with environment variable GEMINI_API_KEY.
  • vertexai (bool): Set this to True if using Vertex AI. Alternative way to force use of Vertex AI is to set environment variable GOOGLE_GEMINI_USE_VERTEXAI=true.
  • project: (str): Only required for Vertex AI. The name of your Google Cloud project. Can alternatively be set as environment variable GOOGLE_CLOUD_PROJECT.
  • location: (str): Only required for Vertex AI. The location of the Vertex AI instance. Can alternatively be set as environment variable GOOGLE_CLOUD_LOCATION.
  • thinking_budget (int): Optional thinking budget in tokens. Not every model supports thinking. Set to 0 to disable thinking (if supported by the model). Set to -1 to enable dynamic thinking (if supported by the model). See https://ai.google.dev/gemini-api/docs/thinking for more details.

Ancestors (in MRO)

  • redlite._core.NamedModel