> Documentation Index
> Fetch the complete documentation index at: https://docs.mobilint.com/compiler/kr/v0.12.0.0/llms.txt
> Use this file to discover all available pages before exploring further.
> Append index.md to any page URL for its Markdown.
> All Mobilint manuals: https://docs.mobilint.com/llms.txt

# qubee.configs.llm\_config

## LlmConfig

```python
class LlmConfig(ConfigABC)
```

Configuration for Large Language Model (LLM) compilation.

### Attributes

| Name | Description |
| --- | --- |
| [`optional`](<#llmconfig-optional>) |  |
| [`DEFAULTS`](<#llmconfig-defaults>) |  |
| [`py_to_cpp_name`](<#llmconfig-py-to-cpp-name>) |  |
| [`min_max_check`](<#llmconfig-min-max-check>) |  |

#### optional

```python
optional = True
```

#### DEFAULTS

```python
DEFAULTS = {
    "llm_config_apply": False,
    "max_data_length": 4096,
    "max_sequence_length": 4096,
    "max_cache_length": 4096,
    "max_core_data_length": 128,
    "random_seq_length": 80,
    "use_full_seq_length": False,
    "use_custom_mask_input": False,
    "start_dram_offset": 0,
    "use_global_core": False,
    "batch_size": 1,
    "npu_core_ids": [0],
    "dynamic_rope": False,
}
```

#### py\_to\_cpp\_name

```python
py_to_cpp_name = {
    "llm_config_apply": "apply",
    "max_data_length": "maxDataLength",
    "max_sequence_length": "maxSequenceLength",
    "max_cache_length": "maxCacheLength",
    "max_core_data_length": "maxCoreDataLength",
    "random_seq_length": "randomSeqLength",
    "use_full_seq_length": "useFullSeqLength",
    "use_custom_mask_input": "useCustomMaskInput",
    "start_dram_offset": "startDramOffset",
    "use_global_core": "useGlobalCore",
    "batch_size": "batchSize",
    "dynamic_rope": "dynamicRope",
}
```

#### min\_max\_check

```python
min_max_check = {
    "max_data_length": [0, None],
    "max_sequence_length": [0, None],
    "max_cache_length": [0, None],
    "max_core_data_length": [0, None],
    "random_seq_length": [0, None],
    "start_dram_offset": [0, None],
    "batch_size": [0, None],
}
```

### Methods

| Name | Description |
| --- | --- |
| [`__init__`](<#llmconfig-init>) | Initialize the [LlmConfig](<https://docs.mobilint.com/compiler/kr/v0.12.0.0/api/python/qubee.configs.llm_config/#llmconfig>): |
| [`default_config`](<#llmconfig-default-config>) |  |
| [`from_kwargs`](<#llmconfig-from-kwargs>) |  |
| [`from_dict`](<#llmconfig-from-dict>) | Create [LlmConfig](<https://docs.mobilint.com/compiler/kr/v0.12.0.0/api/python/qubee.configs.llm_config/#llmconfig>) from dictionary (JSON structure) |
| [`to_dict`](<#llmconfig-to-dict>) |  |

#### \_\_init\_\_

```python
def __init__(
    self,
    llm_config_apply: bool,
    max_data_length: int,
    max_sequence_length: int,
    max_cache_length: int,
    max_core_data_length: int,
    random_seq_length: int,
    use_full_seq_length: bool,
    use_custom_mask_input: bool,
    start_dram_offset: int,
    use_global_core: bool,
    batch_size: int,
    npu_core_ids: List[int],
    dynamic_rope: bool,
    optional: bool = optional,
)
```

Initialize the [LlmConfig](<https://docs.mobilint.com/compiler/kr/v0.12.0.0/api/python/qubee.configs.llm_config/#llmconfig>):

**Parameters**

- `llm_config_apply` — bool. If True, apply LLM-specific configurations.
- `max_data_length` — int. Maximum data length.
- `max_sequence_length` — int. Maximum sequence length.
- `max_cache_length` — int. Maximum cache length.
- `max_core_data_length` — int. Maximum core data length.
- `random_seq_length` — int. Random sequence length used for calibration.
- `use_full_seq_length` — bool. If True, use the full sequence length for calibration.
- `use_custom_mask_input` — bool. If True, use a custom mask input.
- `start_dram_offset` — int. Starting DRAM offset.
- `use_global_core` — bool. If True, use a global core.
- `batch_size` — int. Batch size.
- `npu_core_ids` — List\[int\]. List of NPU core IDs.
- `dynamic_rope` — bool. If True, enable dynamic RoPE.
- `optional` — bool. Indicates whether this config is optional. Use the default value defined as a class variable.

#### default\_config

```python
def default_config(cls)
```

#### from\_kwargs

```python
def from_kwargs(cls, **kwargs)
```

#### from\_dict

```python
def from_dict(cls, config_dict: dict)
```

Create [LlmConfig](<https://docs.mobilint.com/compiler/kr/v0.12.0.0/api/python/qubee.configs.llm_config/#llmconfig>) from dictionary (JSON structure)

#### to\_dict

```python
def to_dict(self)
```

## Functions

| Name | Description |
| --- | --- |
| [`get_llm_config`](<#get-llm-config>) | Create [LlmConfig](<https://docs.mobilint.com/compiler/kr/v0.12.0.0/api/python/qubee.configs.llm_config/#llmconfig>) with partial parameters merged with defaults. |

### get\_llm\_config

```python
def get_llm_config(**kwargs) -> LlmConfig
```

Create [LlmConfig](<https://docs.mobilint.com/compiler/kr/v0.12.0.0/api/python/qubee.configs.llm_config/#llmconfig>) with partial parameters merged with defaults.
