Llm_configuration

This module contains functionality related to the the llm_configuration module for augmentation.bootstrap.configuration.components.

Llm_configuration

LLMConfiguration

Bases: BaseConfigurationWithSecrets

Configuration settings for language models.

This class defines the necessary parameters for configuring and interacting with language models (LLMs) used in the system.

Source code in src/augmentation/bootstrap/configuration/components/llm_configuration.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class LLMConfiguration(BaseConfigurationWithSecrets):
    """
    Configuration settings for language models.

    This class defines the necessary parameters for configuring
    and interacting with language models (LLMs) used in the system.
    """

    name: str = Field(..., description="The name of the language model.")
    max_tokens: int = Field(
        ..., description="The maximum number of tokens for the language model."
    )
    max_retries: int = Field(
        ..., description="The maximum number of retries for the language model."
    )

LLMConfigurationRegistry

Bases: ConfigurationRegistry

Registry for language model configurations.

This registry maintains a mapping between LLM provider names and their corresponding configuration classes, allowing the system to dynamically select and instantiate the appropriate configuration based on the provider name.

Attributes:
  • _key_class (Type) –

    The enumeration class for LLM provider names.

Source code in src/augmentation/bootstrap/configuration/components/llm_configuration.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class LLMConfigurationRegistry(ConfigurationRegistry):
    """
    Registry for language model configurations.

    This registry maintains a mapping between LLM provider names and
    their corresponding configuration classes, allowing the system to
    dynamically select and instantiate the appropriate configuration
    based on the provider name.

    Attributes:
        _key_class: The enumeration class for LLM provider names.
    """

    _key_class: Type = LLMProviderName

LLMProviderName

Bases: str, Enum

Enumeration of supported language model providers.

Source code in src/augmentation/bootstrap/configuration/components/llm_configuration.py
10
11
12
13
14
15
16
class LLMProviderName(str, Enum):
    """
    Enumeration of supported language model providers.
    """

    OPENAI = "openai"
    OPENAI_LIKE = "openai-like"