gabm.io.llm.llm_service module

Base class for LLM service modules. Provides shared cache, logging, and path management utilities.

class gabm.io.llm.llm_service.LLMService(logger=None)

Bases: ABC

Abstract base class for LLM service modules. Provides shared cache management, logging, and model list utilities. Subclasses must implement the send() and list_available_models() methods.

property API_KEY_ENV_VAR

Environment variable name for the API key.

SERVICE_NAME = None
abstractmethod list_available_models(api_key)

List available models for the LLM service.

Args:

api_key (str): The API key for the LLM service.

Returns:

A list of available models.

abstractmethod send(api_key, message, model=None)

Send a prompt to the LLM and return the response object.

Args:
api_key (str):

The API key for the LLM service.

message (str):

The message to send.

model (str, optional):

The model to use for the request.

Returns:

The response object from the LLM.