gen_ai_hub.orchestration.models.llm module¶
- class gen_ai_hub.orchestration.models.llm.LLM(name: str, version: str = 'latest', parameters: Dict | None = None)¶
Bases:
JSONSerializableRepresents a Large Language Model (LLM) configuration.
This class encapsulates the details required to specify and configure a particular LLM for use in natural language processing tasks. It includes the model’s name, version, and any additional parameters needed for its operation.
- __init__(name: str, version: str = 'latest', parameters: Dict | None = None)¶
Initializes the LLM with specified name, version, and parameters.
- Parameters:
name (str) – Name of the LLM.
version (str, optional) – Version of the LLM, defaults to “latest”
parameters (Optional[Dict], optional) –
Additional parameters for the LLM, defaults to None
Common parameters include:
’temperature’: Controls randomness in output. Lower values (e.g., 0.2) make output more focused and deterministic, while higher values (e.g., 0.8) make output more diverse and creative.
’max_tokens’: Sets the maximum number of tokens to generate in the response. This can help control the length of the model’s output.
- to_dict()¶
Converts the LLM instance to a dictionary representation.
- Returns:
Dictionary representation of the LLM.
- Return type:
dict