# qbcompiler.configs.models

Auto-generated Pydantic models from config\_schema.yaml.

## Attributes

| Name | Description |
| --- | --- |
| [`SCHEMA_VERSION`](<#schema-version>) |  |

### SCHEMA\_VERSION

```python
SCHEMA_VERSION = "1.0.0"
```

## Uint8InputConfig

```python
class Uint8InputConfig(BaseModel)
```

Configuration for uint8 input handling

Defines whether inputs should be treated as uint8 and which specific inputs to apply this to.

**Parameters**

- `apply` — bool. If true, treat specified inputs as uint8
- `inputs` — List\[str\]. List of input names to treat as uint8. If empty and apply is true, applies to all inputs
- `division_factor` — float. Division factor for uint8 to float conversion (e.g., 255.0 for \[0,1\], 127.5 for \[0,2\])

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#uint8inputconfig-model-config>) |  |
| [`apply`](<#uint8inputconfig-apply>) |  |
| [`inputs`](<#uint8inputconfig-inputs>) |  |
| [`division_factor`](<#uint8inputconfig-division-factor>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(
    default=False, description="If true, treat specified inputs as uint8"
)
```

#### inputs

```python
inputs: List[str] = Field(
    default=[],
    description="List of input names to treat as uint8. If empty and apply is true, applies to all inputs",
)
```

#### division\_factor

```python
division_factor: float = Field(
    default=255.0,
    alias="divisionFactor",
    description="Division factor for uint8 to float conversion (e.g., 255.0 for [0,1], 127.5 for [0,2])",
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#uint8inputconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "Uint8InputConfig"
```

Return a copy with updated fields.

## PreprocessingConfig

```python
class PreprocessingConfig(BaseModel)
```

Configuration for input preprocessing pipeline

Defines preprocessing operations to be applied to model inputs, including operations like resize, normalize, color conversion, etc. Each pipeline entry is {"op": \<name\>, ...op keys}; unknown keys are rejected. resize/letterbox take "backend": "torch" (default, float interpolate), "pil" (Pillow, bit-exact, bilinear/bicubic) or "opencv" (cv2 INTER\_LINEAR, bit-exact), so calibration sees the same pixels as an evaluator built on that library. letterbox "alignType" is 0 (default: center, padding split around the image) or 1 (top-left: padding only at the bottom and right, as YOLOX and DAMO-YOLO use). letterbox "roundType" is 0 (default: each backend's rounding of the resized size) or 1 (floor: upstream YOLOX and DAMO-YOLO's int(w \* r)); a fuseIntoFirstLayer letterbox ignores it, since its exact odd decimation has no fraction to round.

**Parameters**

- `apply` — bool. If true, apply preprocessing pipeline
- `auto_convert_format` — bool. If true, automatically convert input format
- `pipeline` — List\[Dict\[str, Any\]\]. List of preprocessing operations to apply globally
- `input_configs` — Dict\[str, Any\]. Per-input preprocessing configurations. Keys are input names

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#preprocessingconfig-model-config>) |  |
| [`apply`](<#preprocessingconfig-apply>) |  |
| [`auto_convert_format`](<#preprocessingconfig-auto-convert-format>) |  |
| [`pipeline`](<#preprocessingconfig-pipeline>) |  |
| [`input_configs`](<#preprocessingconfig-input-configs>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(
    default=False, description="If true, apply preprocessing pipeline"
)
```

#### auto\_convert\_format

```python
auto_convert_format: bool = Field(
    default=False,
    alias="autoConvertFormat",
    description="If true, automatically convert input format",
)
```

#### pipeline

```python
pipeline: Any = Field(
    default=[], description="List of preprocessing operations to apply globally"
)
```

#### input\_configs

```python
input_configs: Any = Field(
    default={},
    alias="inputConfigs",
    description="Per-input preprocessing configurations. Keys are input names",
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#preprocessingconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "PreprocessingConfig"
```

Return a copy with updated fields.

## ResourceManagementConfig

```python
class ResourceManagementConfig(BaseModel)
```

Configuration for resource management during model compilation

Controls GPU and memory management settings during the compilation process.

**Parameters**

- `weight_dtype` — str. Weight data type for calibration (e.g., 'float32', 'float16')
- `gpu_memory_budget_mb` — int. [Device](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.enums/#device>) memory budget for weight quantization in MiB; 0 = unlimited, -1 = auto
- `weight_memory` — [WeightMemory](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#resourcemanagementconfig-weightmemory>). Weight memory management configuration

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#resourcemanagementconfig-model-config>) |  |
| [`weight_dtype`](<#resourcemanagementconfig-weight-dtype>) |  |
| [`gpu_memory_budget_mb`](<#resourcemanagementconfig-gpu-memory-budget-mb>) |  |
| [`weight_memory`](<#resourcemanagementconfig-weight-memory>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### weight\_dtype

```python
weight_dtype: str = Field(
    default="float32",
    alias="weightDtype",
    description="Weight data type for calibration (e.g., 'float32', 'float16')",
)
```

#### gpu\_memory\_budget\_mb

```python
gpu_memory_budget_mb: int = Field(
    default=-1,
    alias="gpuMemoryBudgetMB",
    description="Device memory budget for weight quantization in MiB; 0 = unlimited, -1 = auto",
)
```

#### weight\_memory

```python
weight_memory: WeightMemory = Field(
    default_factory=WeightMemory, alias="weightMemory"
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#resourcemanagementconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "ResourceManagementConfig"
```

Return a copy with updated fields.

## ResourceManagementConfig.WeightMemory

```python
class WeightMemory(BaseModel)
```

Weight memory management configuration

**Parameters**

- `method` — int. Weight memory management method index:  
  0: DeleteFloat - Delete float weights after quantization.  
  1: SaveFloat - Save float weights to disk.  
  2: MoveFloat - Move float weights to CPU.  
  3: KeepFloat - Keep float weights in memory.  
  4: KeepAll - Keep all weights in memory.

### Attributes

| Name | Description |
| --- | --- |
| [`method_list`](<#resourcemanagementconfig-weightmemory-method-list>) |  |
| [`method`](<#resourcemanagementconfig-weightmemory-method>) |  |

#### method\_list

```python
method_list: List[str] = Field(
    default=["DeleteFloat", "SaveFloat", "MoveFloat", "KeepFloat", "KeepAll"],
    alias="methodList",
)
```

#### method

```python
method: int = Field(default=0, alias="method")
```

## CalibrationConfig

```python
class CalibrationConfig(BaseModel)
```

Configuration for calibration during quantization

Defines calibration and quantization parameterization used to derive activation/weight scales and related statistics during quantized compilation.

**Parameters**

- `method` — int. Calibration method index:  
  0: WChALayer - Weight per-channel, Activation per-layer.  
  1: WChAMulti - Weight per-channel, Activation multi-layer.  
  2: WChALayerZeropoint - Weight per-channel, Activation per-layer with zeropoint.  
  3: WChAMultiZeropoint - Weight per-channel, Activation multi-layer with zeropoint.
- `output` — int. Output quantization type index:  
  0: Layer - Per-layer quantization.  
  1: Ch - Per-channel quantization.  
  2: Sigmoid - Sigmoid-based quantization.
- `mode` — int. Quantization mode index:  
  0: Max - Maximum value calibration.  
  1: [MaxPercentile](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-maxpercentile>) - Maximum percentile calibration.  
  2: [Histogram](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-histogram>) - [Histogram](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-histogram>)-based calibration.  
  3: [GeometricSketch](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-geometricsketch>) - Geometric-bin relative-error sketch (DDSketch family).
- `act_scale_min` — float. Minimum allowed activation scale (lower bound clamp)
- `act16_scale_min` — float. Minimum 16-bit activation scale (actScaleMin / 256)
- `weight_scale_min` — float. Minimum allowed weight scale (lower bound clamp)
- `weight16_scale_min` — float. Minimum 16-bit weight scale (weightScaleMin / 256)
- `min_clip_ratio` — float. Minimum clip ratio constraint applied during calibration
- `max_calib_data_size` — int. Maximum number of calibration samples kept after loading or generation
- `max_sample_size_for_quant_scheme` — int. Maximum number of calibration samples used per quant scheme stage
- `max_percentile` — [MaxPercentile](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-maxpercentile>). [MaxPercentile](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-maxpercentile>) mode configuration
- `fast_dist` — [FastDist](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-fastdist>). Fast distribution calibration configuration
- `histogram` — [Histogram](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-histogram>). [Histogram](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-histogram>)-based calibration configuration
- `geometric_sketch` — [GeometricSketch](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-geometricsketch>). [GeometricSketch](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-geometricsketch>) mode configuration
- `layer_overrides` — [LayerOverrides](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-layeroverrides>). Layer-specific override settings for calibration
- `statistics` — [Statistics](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-statistics>). [Statistics](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-statistics>) save/load configuration with percentile selection
- `group_lut` — [GroupLut](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#calibrationconfig-grouplut>). LUT grouping algorithm configuration

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#calibrationconfig-model-config>) |  |
| [`method_list`](<#calibrationconfig-method-list>) |  |
| [`method`](<#calibrationconfig-method>) |  |
| [`output_list`](<#calibrationconfig-output-list>) |  |
| [`output`](<#calibrationconfig-output>) |  |
| [`mode_list`](<#calibrationconfig-mode-list>) |  |
| [`mode`](<#calibrationconfig-mode>) |  |
| [`act_scale_min`](<#calibrationconfig-act-scale-min>) |  |
| [`act16_scale_min`](<#calibrationconfig-act16-scale-min>) |  |
| [`weight_scale_min`](<#calibrationconfig-weight-scale-min>) |  |
| [`weight16_scale_min`](<#calibrationconfig-weight16-scale-min>) |  |
| [`min_clip_ratio`](<#calibrationconfig-min-clip-ratio>) |  |
| [`max_calib_data_size`](<#calibrationconfig-max-calib-data-size>) |  |
| [`max_sample_size_for_quant_scheme`](<#calibrationconfig-max-sample-size-for-quant-scheme>) |  |
| [`max_percentile`](<#calibrationconfig-max-percentile>) |  |
| [`fast_dist`](<#calibrationconfig-fast-dist>) |  |
| [`histogram`](<#calibrationconfig-histogram>) |  |
| [`geometric_sketch`](<#calibrationconfig-geometric-sketch>) |  |
| [`layer_overrides`](<#calibrationconfig-layer-overrides>) |  |
| [`statistics`](<#calibrationconfig-statistics>) |  |
| [`group_lut`](<#calibrationconfig-group-lut>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### method\_list

```python
method_list: List[str] = Field(
    default=["WChALayer", "WChAMulti", "WChALayerZeropoint", "WChAMultiZeropoint"],
    alias="methodList",
)
```

#### method

```python
method: int = Field(default=1, alias="method")
```

#### output\_list

```python
output_list: List[str] = Field(
    default=["Layer", "Ch", "Sigmoid"], alias="outputList"
)
```

#### output

```python
output: int = Field(default=0, alias="output")
```

#### mode\_list

```python
mode_list: List[str] = Field(
    default=["Max", "MaxPercentile", "Histogram", "GeometricSketch"],
    alias="modeList",
)
```

#### mode

```python
mode: int = Field(default=1, alias="mode")
```

#### act\_scale\_min

```python
act_scale_min: float = Field(
    default=0.0005,
    alias="actScaleMin",
    description="Minimum allowed activation scale (lower bound clamp)",
    ge=0,
    le=1,
)
```

#### act16\_scale\_min

```python
act16_scale_min: float = Field(
    default=1.953125e-06,
    alias="act16ScaleMin",
    description="Minimum 16-bit activation scale (actScaleMin / 256)",
)
```

#### weight\_scale\_min

```python
weight_scale_min: float = Field(
    default=1e-06,
    alias="weightScaleMin",
    description="Minimum allowed weight scale (lower bound clamp)",
    ge=0,
    le=1,
)
```

#### weight16\_scale\_min

```python
weight16_scale_min: float = Field(
    default=3.90625e-09,
    alias="weight16ScaleMin",
    description="Minimum 16-bit weight scale (weightScaleMin / 256)",
)
```

#### min\_clip\_ratio

```python
min_clip_ratio: float = Field(
    default=-1,
    alias="minClipRatio",
    description="Minimum clip ratio constraint applied during calibration",
    ge=-1,
    le=1,
)
```

#### max\_calib\_data\_size

```python
max_calib_data_size: int = Field(
    default=-1,
    alias="maxCalibDataSize",
    description="Maximum number of calibration samples kept after loading or generation",
    ge=-1,
)
```

#### max\_sample\_size\_for\_quant\_scheme

```python
max_sample_size_for_quant_scheme: int = Field(
    default=16,
    alias="maxSampleSizeForQuantScheme",
    description="Maximum number of calibration samples used per quant scheme stage",
    ge=1,
)
```

#### max\_percentile

```python
max_percentile: MaxPercentile = Field(
    default_factory=MaxPercentile, alias="maxPercentile"
)
```

#### fast\_dist

```python
fast_dist: FastDist = Field(default_factory=FastDist, alias="fastDist")
```

#### histogram

```python
histogram: Histogram = Field(default_factory=Histogram, alias="histogram")
```

#### geometric\_sketch

```python
geometric_sketch: GeometricSketch = Field(
    default_factory=GeometricSketch, alias="geometricSketch"
)
```

#### layer\_overrides

```python
layer_overrides: LayerOverrides = Field(
    default_factory=LayerOverrides, alias="layerOverrides"
)
```

#### statistics

```python
statistics: Statistics = Field(default_factory=Statistics, alias="statistics")
```

#### group\_lut

```python
group_lut: GroupLut = Field(default_factory=GroupLut, alias="groupLut")
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#calibrationconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "CalibrationConfig"
```

Return a copy with updated fields.

## CalibrationConfig.MaxPercentile

```python
class MaxPercentile(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#calibrationconfig-maxpercentile-model-config>) | MaxPercentile mode configuration |
| [`percentile`](<#calibrationconfig-maxpercentile-percentile>) |  |
| [`topk_ratio`](<#calibrationconfig-maxpercentile-topk-ratio>) |  |
| [`max_each`](<#calibrationconfig-maxpercentile-max-each>) |  |
| [`max_total`](<#calibrationconfig-maxpercentile-max-total>) |  |
| [`per_ch_divisor`](<#calibrationconfig-maxpercentile-per-ch-divisor>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

MaxPercentile mode configuration

**Parameters**

- `percentile` — float. Percentile value for maxPercentile mode
- `topk_ratio` — float. Top-k ratio used in maxPercentile mode
- `max_each` — int. Maximum number of samples processed per iteration
- `max_total` — int. Total maximum number of samples
- `per_ch_divisor` — int. Divisor for per-channel buffer capacity (bufferCap = max(maxTotal / perChDivisor, maxEach))

#### percentile

```python
percentile: float = Field(
    default=0.9999, description="Percentile value for maxPercentile mode"
)
```

#### topk\_ratio

```python
topk_ratio: float = Field(
    default=0.01,
    alias="topKRatio",
    description="Top-k ratio used in maxPercentile mode",
)
```

#### max\_each

```python
max_each: int = Field(
    default=128,
    alias="maxEach",
    description="Maximum number of samples processed per iteration",
)
```

#### max\_total

```python
max_total: int = Field(
    default=65536,
    alias="maxTotal",
    description="Total maximum number of samples",
)
```

#### per\_ch\_divisor

```python
per_ch_divisor: int = Field(
    default=16,
    alias="perChDivisor",
    description="Divisor for per-channel buffer capacity (bufferCap = max(maxTotal / perChDivisor, maxEach))",
    ge=1,
)
```

## CalibrationConfig.FastDist

```python
class FastDist(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#calibrationconfig-fastdist-model-config>) | Fast distribution calibration configuration |
| [`size_cali`](<#calibrationconfig-fastdist-size-cali>) |  |
| [`kernel_size`](<#calibrationconfig-fastdist-kernel-size>) |  |
| [`stack_size`](<#calibrationconfig-fastdist-stack-size>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Fast distribution calibration configuration

**Parameters**

- `size_cali` — int.
- `kernel_size` — int.
- `stack_size` — int.

#### size\_cali

```python
size_cali: int = Field(default=100, alias="sizeCali")
```

#### kernel\_size

```python
kernel_size: int = Field(default=9, alias="kernelSize")
```

#### stack\_size

```python
stack_size: int = Field(default=32768, alias="stackSize")
```

## CalibrationConfig.Histogram

```python
class Histogram(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#calibrationconfig-histogram-model-config>) | Histogram-based calibration configuration |
| [`search_type_list`](<#calibrationconfig-histogram-search-type-list>) |  |
| [`search_type`](<#calibrationconfig-histogram-search-type>) |  |
| [`percentile`](<#calibrationconfig-histogram-percentile>) |  |
| [`use_gpu`](<#calibrationconfig-histogram-use-gpu>) |  |
| [`num_bins`](<#calibrationconfig-histogram-num-bins>) |  |
| [`num_samples`](<#calibrationconfig-histogram-num-samples>) |  |
| [`buffer_size`](<#calibrationconfig-histogram-buffer-size>) |  |
| [`min_bin_width`](<#calibrationconfig-histogram-min-bin-width>) |  |
| [`search_percentile_min`](<#calibrationconfig-histogram-search-percentile-min>) |  |
| [`search_percentile_max`](<#calibrationconfig-histogram-search-percentile-max>) |  |
| [`num_search`](<#calibrationconfig-histogram-num-search>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Histogram-based calibration configuration

**Parameters**

- `search_type` — int. Search type for histogram calibration:  
  0: Percentile.  
  1: MSE.  
  2: KL.
- `percentile` — float. Percentile value for histogram calibration
- `use_gpu` — bool. Use GPU for histogram computation
- `num_bins` — int. Number of bins for histogram
- `num_samples` — int. Number of samples for histogram calibration
- `buffer_size` — int. Buffer size for histogram computation (-1 for auto)
- `min_bin_width` — float. Minimum bin width for histogram
- `search_percentile_min` — float. Minimum search percentile
- `search_percentile_max` — float. Maximum search percentile
- `num_search` — int. Number of search iterations

#### search\_type\_list

```python
search_type_list: List[str] = Field(
    default=["Percentile", "MSE", "KL"], alias="searchTypeList"
)
```

#### search\_type

```python
search_type: int = Field(default=0, alias="searchType")
```

#### percentile

```python
percentile: float = Field(
    default=0.9999, description="Percentile value for histogram calibration"
)
```

#### use\_gpu

```python
use_gpu: bool = Field(
    default=True,
    alias="useGPU",
    description="Use GPU for histogram computation",
)
```

#### num\_bins

```python
num_bins: int = Field(
    default=256, alias="numBins", description="Number of bins for histogram"
)
```

#### num\_samples

```python
num_samples: int = Field(
    default=128,
    alias="numSamples",
    description="Number of samples for histogram calibration",
)
```

#### buffer\_size

```python
buffer_size: int = Field(
    default=-1,
    alias="bufferSize",
    description="Buffer size for histogram computation (-1 for auto)",
)
```

#### min\_bin\_width

```python
min_bin_width: float = Field(
    default=1e-06,
    alias="minBinWidth",
    description="Minimum bin width for histogram",
)
```

#### search\_percentile\_min

```python
search_percentile_min: float = Field(
    default=0.9999,
    alias="searchPercentileMin",
    description="Minimum search percentile",
)
```

#### search\_percentile\_max

```python
search_percentile_max: float = Field(
    default=1.0,
    alias="searchPercentileMax",
    description="Maximum search percentile",
)
```

#### num\_search

```python
num_search: int = Field(
    default=128, alias="numSearch", description="Number of search iterations"
)
```

## CalibrationConfig.GeometricSketch

```python
class GeometricSketch(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#calibrationconfig-geometricsketch-model-config>) | GeometricSketch mode configuration |
| [`clip_ratio8`](<#calibrationconfig-geometricsketch-clip-ratio8>) |  |
| [`clip_ratio16`](<#calibrationconfig-geometricsketch-clip-ratio16>) |  |
| [`relative_error`](<#calibrationconfig-geometricsketch-relative-error>) |  |
| [`exp_min`](<#calibrationconfig-geometricsketch-exp-min>) |  |
| [`exp_max`](<#calibrationconfig-geometricsketch-exp-max>) |  |
| [`bin_budget`](<#calibrationconfig-geometricsketch-bin-budget>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

GeometricSketch mode configuration

**Parameters**

- `clip_ratio8` — float. Fraction clipped from each tail for INT8; must be \>= 0 and \< 0.5
- `clip_ratio16` — float. Fraction clipped from each tail for INT16; must be \>= 0 and \< 0.5
- `relative_error` — float. Geometric bin relative error; bin k holds magnitudes in ((1+r)^(k-1), (1+r)^k\]
- `exp_min` — int. Smallest power-of-two exponent the magnitude grid covers; values below clamp to the end bin
- `exp_max` — int. Largest power-of-two exponent the magnitude grid covers; values above clamp to the end bin
- `bin_budget` — int. Stored bins per sign ladder and channel; magnitudes more than that many bins below the channel's largest fall into one floor bin

#### clip\_ratio8

```python
clip_ratio8: float = Field(
    default=5e-06,
    alias="clipRatio8",
    description="Fraction clipped from each tail for INT8; must be >= 0 and < 0.5",
    ge=0,
    lt=0.5,
)
```

#### clip\_ratio16

```python
clip_ratio16: float = Field(
    default=1e-06,
    alias="clipRatio16",
    description="Fraction clipped from each tail for INT16; must be >= 0 and < 0.5",
    ge=0,
    lt=0.5,
)
```

#### relative\_error

```python
relative_error: float = Field(
    default=0.05,
    alias="relativeError",
    description="Geometric bin relative error; bin k holds magnitudes in ((1+r)^(k-1), (1+r)^k]",
    gt=0,
    lt=1,
)
```

#### exp\_min

```python
exp_min: int = Field(
    default=-14,
    alias="expMin",
    description="Smallest power-of-two exponent the magnitude grid covers; values below clamp to the end bin",
)
```

#### exp\_max

```python
exp_max: int = Field(
    default=24,
    alias="expMax",
    description="Largest power-of-two exponent the magnitude grid covers; values above clamp to the end bin",
)
```

#### bin\_budget

```python
bin_budget: int = Field(
    default=256,
    alias="binBudget",
    description="Stored bins per sign ladder and channel; magnitudes more than that many bins below the channel's largest fall into one floor bin",
    ge=8,
)
```

## CalibrationConfig.LayerOverrides

```python
class LayerOverrides(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#calibrationconfig-layeroverrides-model-config>) | Layer-specific override settings for calibration |
| [`act_scale_min`](<#calibrationconfig-layeroverrides-act-scale-min>) |  |
| [`percentile`](<#calibrationconfig-layeroverrides-percentile>) |  |
| [`method`](<#calibrationconfig-layeroverrides-method>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Layer-specific override settings for calibration

**Parameters**

- `act_scale_min` — dict. Per-layer activation scale minimum overrides. Keys are actScaleMin values (e.g. '0.0005'), values are lists of layer names to apply that override. (e.g. {'0.0005' : \['layer1', 'layer2'\]})
- `percentile` — dict. Per-layer maxPercentile percentile overrides. Keys are layer names, values are percentile floats. (e.g. {'/model/layer0/conv': 0.999, '/model/layer5/attn': 0.99})
- `method` — dict. Per-layer calibration method overrides. Keys are layer names, values are method ints (0=WChALayer, 1=WChAMulti, 2=WChALayerZeropoint, 3=WChAMultiZeropoint). (e.g. {'/model/layer0/conv': 1, '/model/layer5/attn': 3})

#### act\_scale\_min

```python
act_scale_min: Any = Field(
    default={},
    alias="actScaleMin",
    description="Per-layer activation scale minimum overrides. Keys are actScaleMin values (e.g. '0.0005'), values are lists of layer names to apply that override. (e.g. {'0.0005' : ['layer1', 'layer2']})",
)
```

#### percentile

```python
percentile: Any = Field(
    default={},
    description="Per-layer maxPercentile percentile overrides. Keys are layer names, values are percentile floats. (e.g. {'/model/layer0/conv': 0.999, '/model/layer5/attn': 0.99})",
)
```

#### method

```python
method: Any = Field(
    default={},
    description="Per-layer calibration method overrides. Keys are layer names, values are method ints (0=WChALayer, 1=WChAMulti, 2=WChALayerZeropoint, 3=WChAMultiZeropoint). (e.g. {'/model/layer0/conv': 1, '/model/layer5/attn': 3})",
)
```

## CalibrationConfig.Statistics

```python
class Statistics(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#calibrationconfig-statistics-model-config>) | Statistics save/load configuration with percentile selection |
| [`apply`](<#calibrationconfig-statistics-apply>) |  |
| [`save_path`](<#calibrationconfig-statistics-save-path>) |  |
| [`load_path`](<#calibrationconfig-statistics-load-path>) |  |
| [`percentiles`](<#calibrationconfig-statistics-percentiles>) |  |
| [`percentile_index`](<#calibrationconfig-statistics-percentile-index>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Statistics save/load configuration with percentile selection

**Parameters**

- `apply` — bool. Enable statistics save/load
- `save_path` — str. Path to save statistics. If empty, not saved
- `load_path` — str. Path to load statistics. If empty, not loaded
- `percentiles` — List\[float\]. List of percentile candidates
- `percentile_index` — int. Index into percentiles list to select active percentile

#### apply

```python
apply: bool = Field(default=False, description="Enable statistics save/load")
```

#### save\_path

```python
save_path: str = Field(
    default="",
    alias="savePath",
    description="Path to save statistics. If empty, not saved",
)
```

#### load\_path

```python
load_path: str = Field(
    default="",
    alias="loadPath",
    description="Path to load statistics. If empty, not loaded",
)
```

#### percentiles

```python
percentiles: List[float] = Field(
    default=[0.9999, 0.999, 0.99, 0.9],
    description="List of percentile candidates",
)
```

#### percentile\_index

```python
percentile_index: int = Field(
    default=0,
    alias="percentileIndex",
    description="Index into percentiles list to select active percentile",
)
```

## CalibrationConfig.GroupLut

```python
class GroupLut(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#calibrationconfig-grouplut-model-config>) | LUT grouping algorithm configuration |
| [`irls_iter`](<#calibrationconfig-grouplut-irls-iter>) |  |
| [`dro_eps`](<#calibrationconfig-grouplut-dro-eps>) |  |
| [`cover_floor`](<#calibrationconfig-grouplut-cover-floor>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

LUT grouping algorithm configuration

**Parameters**

- `irls_iter` — int. Number of IRLS iterations for optimal scale computation (1 = single WLS)
- `dro_eps` — float. DRO worst-point coefficient; larger = more conservative clipping (0 = disable)
- `cover_floor` — float. LUTAM cluster scale lower bound as fraction of coverage

#### irls\_iter

```python
irls_iter: int = Field(
    default=3,
    alias="irlsIter",
    description="Number of IRLS iterations for optimal scale computation (1 = single WLS)",
    ge=1,
)
```

#### dro\_eps

```python
dro_eps: float = Field(
    default=0,
    alias="droEps",
    description="DRO worst-point coefficient; larger = more conservative clipping (0 = disable)",
    ge=0,
)
```

#### cover\_floor

```python
cover_floor: float = Field(
    default=0.85,
    alias="coverFloor",
    description="LUTAM cluster scale lower bound as fraction of coverage",
    ge=0,
    le=1,
)
```

## BitConfig

```python
class BitConfig(BaseModel)
```

Configuration for bit precision

Defines bit-width parameterization for activations and weights used in mixed-precision quantization (e.g., attention and FFN components).

**Parameters**

- `transformer` — [Transformer](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer>). [Transformer](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer>)-specific bit-width configuration
- `save_info` — [SaveInfo](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-saveinfo>). Bit allocation save/load configuration
- `layer_overrides` — [LayerOverrides](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-layeroverrides>). Layer-specific bit-width override settings

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-model-config>) |  |
| [`transformer`](<#bitconfig-transformer>) |  |
| [`save_info`](<#bitconfig-save-info>) |  |
| [`layer_overrides`](<#bitconfig-layer-overrides>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### transformer

```python
transformer: Transformer = Field(default_factory=Transformer, alias="transformer")
```

#### save\_info

```python
save_info: SaveInfo = Field(default_factory=SaveInfo, alias="saveInfo")
```

#### layer\_overrides

```python
layer_overrides: LayerOverrides = Field(
    default_factory=LayerOverrides, alias="layerOverrides"
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#bitconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "BitConfig"
```

Return a copy with updated fields.

## BitConfig.Transformer

```python
class Transformer(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-transformer-model-config>) | Transformer-specific bit-width configuration |
| [`activation`](<#bitconfig-transformer-activation>) |  |
| [`weight`](<#bitconfig-transformer-weight>) |  |
| [`mixed_precision`](<#bitconfig-transformer-mixed-precision>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Transformer-specific bit-width configuration

**Parameters**

- `activation` — [Activation](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-activation>). [Activation](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-activation>) bit-widths for transformer components
- `weight` — [Weight](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-weight>). [Weight](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-weight>) bit-widths for transformer components
- `mixed_precision` — [MixedPrecision](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-mixedprecision>). Mixed precision configuration

#### activation

```python
activation: Activation = Field(default_factory=Activation, alias="activation")
```

#### weight

```python
weight: Weight = Field(default_factory=Weight, alias="weight")
```

#### mixed\_precision

```python
mixed_precision: MixedPrecision = Field(
    default_factory=MixedPrecision, alias="mixedPrecision"
)
```

## BitConfig.Transformer.Activation

```python
class Activation(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-transformer-activation-model-config>) | Activation bit-widths for transformer components |
| [`query`](<#bitconfig-transformer-activation-query>) |  |
| [`key`](<#bitconfig-transformer-activation-key>) |  |
| [`value`](<#bitconfig-transformer-activation-value>) |  |
| [`output`](<#bitconfig-transformer-activation-output>) |  |
| [`head`](<#bitconfig-transformer-activation-head>) |  |
| [`router`](<#bitconfig-transformer-activation-router>) |  |
| [`ffn`](<#bitconfig-transformer-activation-ffn>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Activation bit-widths for transformer components

**Parameters**

- `query` — int. Query activation bit-width
- `key` — int. Key activation bit-width
- `value` — int. Value activation bit-width
- `output` — int. Output activation bit-width
- `head` — int. Head activation bit-width
- `router` — int. MoE router gate activation bit-width
- `ffn` — [Ffn](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-activation-ffn>). FFN activation bit-widths (int shorthand sets all sublayers)

#### query

```python
query: int = Field(default=8, description="Query activation bit-width")
```

#### key

```python
key: int = Field(default=8, description="Key activation bit-width")
```

#### value

```python
value: int = Field(default=8, description="Value activation bit-width")
```

#### output

```python
output: int = Field(default=16, description="Output activation bit-width")
```

#### head

```python
head: int = Field(default=8, description="Head activation bit-width")
```

#### router

```python
router: int = Field(
    default=8, description="MoE router gate activation bit-width"
)
```

#### ffn

```python
ffn: Ffn = Field(default_factory=Ffn, alias="ffn")
```

## BitConfig.Transformer.Activation.Ffn

```python
class Ffn(BaseModel)
```

FFN activation bit-widths (int shorthand sets all sublayers)

**Parameters**

- `up` — int. FFN up-projection activation bit-width
- `gate` — int. FFN gate (SwiGLU) activation bit-width
- `down` — int. FFN down-projection activation bit-width

### Attributes

| Name | Description |
| --- | --- |
| [`up`](<#bitconfig-transformer-activation-ffn-up>) |  |
| [`gate`](<#bitconfig-transformer-activation-ffn-gate>) |  |
| [`down`](<#bitconfig-transformer-activation-ffn-down>) |  |

#### up

```python
up: int = Field(
    default=16, description="FFN up-projection activation bit-width"
)
```

#### gate

```python
gate: int = Field(
    default=16, description="FFN gate (SwiGLU) activation bit-width"
)
```

#### down

```python
down: int = Field(
    default=16, description="FFN down-projection activation bit-width"
)
```

### Methods

| Name | Description |
| --- | --- |
| [`expand_int_shorthand`](<#bitconfig-transformer-activation-ffn-expand-int-shorthand>) |  |

#### expand\_int\_shorthand

```python
def expand_int_shorthand(cls, v)
```

## BitConfig.Transformer.Weight

```python
class Weight(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-transformer-weight-model-config>) | Weight bit-widths for transformer components |
| [`query`](<#bitconfig-transformer-weight-query>) |  |
| [`key`](<#bitconfig-transformer-weight-key>) |  |
| [`value`](<#bitconfig-transformer-weight-value>) |  |
| [`output`](<#bitconfig-transformer-weight-output>) |  |
| [`head`](<#bitconfig-transformer-weight-head>) |  |
| [`router`](<#bitconfig-transformer-weight-router>) |  |
| [`ffn`](<#bitconfig-transformer-weight-ffn>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Weight bit-widths for transformer components

**Parameters**

- `query` — int. Query weight bit-width
- `key` — int. Key weight bit-width
- `value` — int. Value weight bit-width
- `output` — int. Output weight bit-width
- `head` — int. Head weight bit-width
- `router` — int. MoE router gate weight bit-width
- `ffn` — [Ffn](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-weight-ffn>). FFN weight bit-widths (int shorthand sets all sublayers)

#### query

```python
query: int = Field(default=8, description="Query weight bit-width")
```

#### key

```python
key: int = Field(default=8, description="Key weight bit-width")
```

#### value

```python
value: int = Field(default=8, description="Value weight bit-width")
```

#### output

```python
output: int = Field(default=8, description="Output weight bit-width")
```

#### head

```python
head: int = Field(default=8, description="Head weight bit-width")
```

#### router

```python
router: int = Field(
    default=8, description="MoE router gate weight bit-width"
)
```

#### ffn

```python
ffn: Ffn = Field(default_factory=Ffn, alias="ffn")
```

## BitConfig.Transformer.Weight.Ffn

```python
class Ffn(BaseModel)
```

FFN weight bit-widths (int shorthand sets all sublayers)

**Parameters**

- `up` — int. FFN up-projection weight bit-width
- `gate` — int. FFN gate (SwiGLU) weight bit-width
- `down` — int. FFN down-projection weight bit-width

### Attributes

| Name | Description |
| --- | --- |
| [`up`](<#bitconfig-transformer-weight-ffn-up>) |  |
| [`gate`](<#bitconfig-transformer-weight-ffn-gate>) |  |
| [`down`](<#bitconfig-transformer-weight-ffn-down>) |  |

#### up

```python
up: int = Field(
    default=8, description="FFN up-projection weight bit-width"
)
```

#### gate

```python
gate: int = Field(
    default=8, description="FFN gate (SwiGLU) weight bit-width"
)
```

#### down

```python
down: int = Field(
    default=8, description="FFN down-projection weight bit-width"
)
```

### Methods

| Name | Description |
| --- | --- |
| [`expand_int_shorthand`](<#bitconfig-transformer-weight-ffn-expand-int-shorthand>) |  |

#### expand\_int\_shorthand

```python
def expand_int_shorthand(cls, v)
```

## BitConfig.Transformer.MixedPrecision

```python
class MixedPrecision(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-transformer-mixedprecision-model-config>) | Mixed precision configuration |
| [`weight`](<#bitconfig-transformer-mixedprecision-weight>) |  |
| [`activation`](<#bitconfig-transformer-mixedprecision-activation>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Mixed precision configuration

**Parameters**

- `weight` — [Weight](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-mixedprecision-weight>). Mixed precision configuration for weights
- `activation` — [Activation](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#bitconfig-transformer-mixedprecision-activation>). Per-layer activation mixed precision configuration

#### weight

```python
weight: Weight = Field(default_factory=Weight, alias="weight")
```

#### activation

```python
activation: Activation = Field(
    default_factory=Activation, alias="activation"
)
```

## BitConfig.Transformer.MixedPrecision.Weight

```python
class Weight(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-transformer-mixedprecision-weight-model-config>) | Mixed precision configuration for weights |
| [`apply`](<#bitconfig-transformer-mixedprecision-weight-apply>) |  |
| [`type_wise`](<#bitconfig-transformer-mixedprecision-weight-type-wise>) |  |
| [`prune`](<#bitconfig-transformer-mixedprecision-weight-prune>) |  |
| [`bit_2`](<#bitconfig-transformer-mixedprecision-weight-bit-2>) |  |
| [`bit_4`](<#bitconfig-transformer-mixedprecision-weight-bit-4>) |  |
| [`bit_8`](<#bitconfig-transformer-mixedprecision-weight-bit-8>) |  |
| [`importance_threshold_low`](<#bitconfig-transformer-mixedprecision-weight-importance-threshold-low>) |  |
| [`importance_threshold_high`](<#bitconfig-transformer-mixedprecision-weight-importance-threshold-high>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Mixed precision configuration for weights

**Parameters**

- `apply` — bool. If true, apply mixed-precision according to the specified bit-widths
- `type_wise` — bool. Apply type-wise mixed precision
- `prune` — float. Pruning ratio
- `bit_2` — float. Ratio of 2-bit quantization
- `bit_4` — float. Ratio of 4-bit quantization
- `bit_8` — float. Ratio of 8-bit quantization
- `importance_threshold_low` — float. Low importance threshold
- `importance_threshold_high` — float. High importance threshold

#### apply

```python
apply: bool = Field(
    default=False,
    description="If true, apply mixed-precision according to the specified bit-widths",
)
```

#### type\_wise

```python
type_wise: bool = Field(
    default=True,
    alias="typeWise",
    description="Apply type-wise mixed precision",
)
```

#### prune

```python
prune: float = Field(default=0, description="Pruning ratio")
```

#### bit\_2

```python
bit_2: float = Field(
    default=0,
    validation_alias=AliasChoices("bit_2", "bit2"),
    description="Ratio of 2-bit quantization",
)
```

#### bit\_4

```python
bit_4: float = Field(
    default=0,
    validation_alias=AliasChoices("bit_4", "bit4"),
    description="Ratio of 4-bit quantization",
)
```

#### bit\_8

```python
bit_8: float = Field(
    default=1,
    validation_alias=AliasChoices("bit_8", "bit8"),
    description="Ratio of 8-bit quantization",
)
```

#### importance\_threshold\_low

```python
importance_threshold_low: float = Field(
    default=-1,
    alias="importanceThreshold_low",
    description="Low importance threshold",
)
```

#### importance\_threshold\_high

```python
importance_threshold_high: float = Field(
    default=-1,
    alias="importanceThreshold_high",
    description="High importance threshold",
)
```

## BitConfig.Transformer.MixedPrecision.Activation

```python
class Activation(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-transformer-mixedprecision-activation-model-config>) | Per-layer activation mixed precision configuration |
| [`apply`](<#bitconfig-transformer-mixedprecision-activation-apply>) |  |
| [`ratio_16bit`](<#bitconfig-transformer-mixedprecision-activation-ratio-16bit>) |  |
| [`importance_threshold`](<#bitconfig-transformer-mixedprecision-activation-importance-threshold>) |  |
| [`search_range`](<#bitconfig-transformer-mixedprecision-activation-search-range>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Per-layer activation mixed precision configuration

**Parameters**

- `apply` — bool. If true, apply per-layer activation mixed precision
- `ratio_16bit` — float. Ratio of layers assigned 16-bit (used when importanceThreshold \< 0)
- `importance_threshold` — float. Normalized importance threshold for 16-bit assignment (negative = use ratio\_16bit)
- `search_range` — int. Target layer range: -1=all layers, N=first N layers

#### apply

```python
apply: bool = Field(
    default=False,
    description="If true, apply per-layer activation mixed precision",
)
```

#### ratio\_16bit

```python
ratio_16bit: float = Field(
    default=0.45,
    alias="ratio16Bit",
    description="Ratio of layers assigned 16-bit (used when importanceThreshold < 0)",
)
```

#### importance\_threshold

```python
importance_threshold: float = Field(
    default=-1,
    alias="importanceThreshold",
    description="Normalized importance threshold for 16-bit assignment (negative = use ratio_16bit)",
)
```

#### search\_range

```python
search_range: int = Field(
    default=-1,
    alias="searchRange",
    description="Target layer range: -1=all layers, N=first N layers",
)
```

## BitConfig.SaveInfo

```python
class SaveInfo(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-saveinfo-model-config>) | Bit allocation save/load configuration |
| [`save_path`](<#bitconfig-saveinfo-save-path>) |  |
| [`load_path`](<#bitconfig-saveinfo-load-path>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Bit allocation save/load configuration

**Parameters**

- `save_path` — str. Path to save the bit allocation. If empty, not saved
- `load_path` — str. Path to load the bit allocation. If empty, not loaded

#### save\_path

```python
save_path: str = Field(
    default="",
    alias="savePath",
    description="Path to save the bit allocation. If empty, not saved",
)
```

#### load\_path

```python
load_path: str = Field(
    default="",
    alias="loadPath",
    description="Path to load the bit allocation. If empty, not loaded",
)
```

## BitConfig.LayerOverrides

```python
class LayerOverrides(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#bitconfig-layeroverrides-model-config>) | Layer-specific bit-width override settings |
| [`activation_16bits`](<#bitconfig-layeroverrides-activation-16bits>) |  |
| [`weight_16bits`](<#bitconfig-layeroverrides-weight-16bits>) |  |
| [`weight_8bits`](<#bitconfig-layeroverrides-weight-8bits>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Layer-specific bit-width override settings

**Parameters**

- `activation_16bits` — list\[string\]. Layer names to force 16-bit activations
- `weight_16bits` — list\[string\]. Layer names to force 16-bit weights
- `weight_8bits` — list\[string\]. Layer names to force 8-bit weights

#### activation\_16bits

```python
activation_16bits: List[str] = Field(
    default=[],
    alias="activation16Bits",
    description="Layer names to force 16-bit activations",
)
```

#### weight\_16bits

```python
weight_16bits: List[str] = Field(
    default=[],
    alias="weight16Bits",
    description="Layer names to force 16-bit weights",
)
```

#### weight\_8bits

```python
weight_8bits: List[str] = Field(
    default=[],
    alias="weight8Bits",
    description="Layer names to force 8-bit weights",
)
```

## HessianQuantConfig

```python
class HessianQuantConfig(BaseModel)
```

Configuration for HessianQuant algorithm

Defines parameters controlling whether and how HessianQuant is applied during quantization, including layer-level inclusion/exclusion lists.

**Parameters**

- `apply` — bool. If true, apply HessianQuant
- `hessian_dtype` — str. Storage dtype for the accumulated HessianQuant Hessian. bf16 halves its memory footprint (host RAM when the Hessian lives on CPU, VRAM when on GPU) — critical for large models such as MoE with thousands of expert FFN Hessians. Compute stays float32 regardless: the per-batch matmul and accumulation run in float32 and the solve upcasts back to float32; only the persistent accumulator is bfloat16. Accepted values:  
  "fp32" - Store the Hessian in float32. The default.  
  "bf16" - Store the Hessian in bfloat16 (half the memory).
- `solver` — str. HessianQuant solve algorithm used to compute per-layer integer weights. symmetric targets the output on the quantized input; the asymmetric solvers target the original-weight float output and differ in how they absorb the input mismatch. Accepted values:  
  "symmetric" - The default. min ||(W - Q) X\_q||^2: sequential greedy rounding via a Cholesky-based Hessian solve.  
  "asymmetric\_causal" - min ||W X\_fp - Q X\_q||^2: each column's input-mismatch residual is fed only to the columns after it, scaled by alpha.  
  "asymmetric\_refit" - min ||W X\_fp - Q X\_q||^2: least-squares refit W*^T = H^-1 G W^T of every column, then a symmetric solve around W*.
- `rescomp` — bool. Enable residual-compensation correction. When true, each solver additionally applies an R correction term that compensates for accumulated weight drift from inter-block error propagation. Requires crossGram collection even for solver=symmetric.
- `attributes` — [Attributes](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#hessianquantconfig-attributes>). HessianQuant algorithm attributes

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#hessianquantconfig-model-config>) |  |
| [`apply`](<#hessianquantconfig-apply>) |  |
| [`hessian_dtype`](<#hessianquantconfig-hessian-dtype>) |  |
| [`solver`](<#hessianquantconfig-solver>) |  |
| [`rescomp`](<#hessianquantconfig-rescomp>) |  |
| [`attributes`](<#hessianquantconfig-attributes>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(default=False, description="If true, apply HessianQuant")
```

#### hessian\_dtype

```python
hessian_dtype: str = Field(
    default="fp32",
    alias="hessianDtype",
    description="Storage dtype for the accumulated HessianQuant Hessian. bf16 halves its memory footprint (host RAM when the Hessian lives on CPU, VRAM when on GPU) — critical for large models such as MoE with thousands of expert FFN Hessians. Compute stays float32 regardless: the per-batch matmul and accumulation run in float32 and the solve upcasts back to float32; only the persistent accumulator is bfloat16.",
)
```

#### solver

```python
solver: str = Field(
    default="symmetric",
    description="HessianQuant solve algorithm used to compute per-layer integer weights. symmetric targets the output on the quantized input; the asymmetric solvers target the original-weight float output and differ in how they absorb the input mismatch.",
)
```

#### rescomp

```python
rescomp: bool = Field(
    default=False,
    description="Enable residual-compensation correction. When true, each solver additionally applies an R correction term that compensates for accumulated weight drift from inter-block error propagation. Requires crossGram collection even for solver=symmetric.",
)
```

#### attributes

```python
attributes: Attributes = Field(default_factory=Attributes, alias="attributes")
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#hessianquantconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "HessianQuantConfig"
```

Return a copy with updated fields.

## HessianQuantConfig.Attributes

```python
class Attributes(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#hessianquantconfig-attributes-model-config>) | HessianQuant algorithm attributes |
| [`act_order`](<#hessianquantconfig-attributes-act-order>) |  |
| [`block_size`](<#hessianquantconfig-attributes-block-size>) |  |
| [`perc_damp`](<#hessianquantconfig-attributes-perc-damp>) |  |
| [`apply_layers`](<#hessianquantconfig-attributes-apply-layers>) |  |
| [`exclude_layers`](<#hessianquantconfig-attributes-exclude-layers>) |  |
| [`alpha`](<#hessianquantconfig-attributes-alpha>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

HessianQuant algorithm attributes

**Parameters**

- `act_order` — bool. If true, use activation order
- `block_size` — int. Block size used for HessianQuant
- `perc_damp` — float. Percentage dampening factor
- `apply_layers` — List\[str\]. Layer names to apply HessianQuant. If empty, applies to all eligible layers
- `exclude_layers` — List\[str\]. Layer names to exclude from HessianQuant
- `alpha` — float. Scale of the secondary correction terms: the asymmetric\_causal P term and the rescomp R term. symmetric and asymmetric\_refit use it only through rescomp.

#### act\_order

```python
act_order: bool = Field(
    default=True, alias="actOrder", description="If true, use activation order"
)
```

#### block\_size

```python
block_size: int = Field(
    default=256,
    alias="blockSize",
    description="Block size used for HessianQuant",
)
```

#### perc\_damp

```python
perc_damp: float = Field(
    default=0.01, alias="percDamp", description="Percentage dampening factor"
)
```

#### apply\_layers

```python
apply_layers: List[str] = Field(
    default=[],
    alias="applyLayers",
    description="Layer names to apply HessianQuant. If empty, applies to all eligible layers",
)
```

#### exclude\_layers

```python
exclude_layers: List[str] = Field(
    default=[],
    alias="excludeLayers",
    description="Layer names to exclude from HessianQuant",
)
```

#### alpha

```python
alpha: float = Field(
    default=0.25,
    description="Scale of the secondary correction terms: the asymmetric_causal P term and the rescomp R term. symmetric and asymmetric_refit use it only through rescomp.",
)
```

## BiasCorrectionConfig

```python
class BiasCorrectionConfig(BaseModel)
```

Configuration for in-schedule integer bias correction

During weight quantization, measures the per-channel activation error of each quantized convolution (plain, depthwise or transposed; not grouped) against the original-weight float path over every calibration sample, folds the correction into the integer bias within its range, skipping a channel whose slope is too flat to invert, and patches the already-produced integer activations so downstream layers quantize against corrected outputs. Corrections propagate layer by layer in one pass; there is no damping rate and no iteration count. Under group-wise quantization both streams start each group from the float boundary batch, so the correction covers the error the group itself adds. A run the engine cannot drive leaf by leaf (expert aggregation, an external input narrower than its per-channel qparam) keeps the calibrated bias. A layer whose LUT window is re-chosen is measured on its accumulator, ahead of the window; any other layer on its requantized codes.

**Parameters**

- `apply` — bool. If true, correct systematic per-layer quantization bias
- `attributes` — [Attributes](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#biascorrectionconfig-attributes>). Bias correction attributes

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#biascorrectionconfig-model-config>) |  |
| [`apply`](<#biascorrectionconfig-apply>) |  |
| [`attributes`](<#biascorrectionconfig-attributes>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(
    default=True,
    description="If true, correct systematic per-layer quantization bias",
)
```

#### attributes

```python
attributes: Attributes = Field(default_factory=Attributes, alias="attributes")
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#biascorrectionconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "BiasCorrectionConfig"
```

Return a copy with updated fields.

## BiasCorrectionConfig.Attributes

```python
class Attributes(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#biascorrectionconfig-attributes-model-config>) | Bias correction attributes |
| [`apply_layers`](<#biascorrectionconfig-attributes-apply-layers>) |  |
| [`exclude_layers`](<#biascorrectionconfig-attributes-exclude-layers>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Bias correction attributes

**Parameters**

- `apply_layers` — List\[str\]. Layer names to apply bias correction. If empty, applies to all eligible layers
- `exclude_layers` — List\[str\]. Layer names to exclude from bias correction

#### apply\_layers

```python
apply_layers: List[str] = Field(
    default=[],
    alias="applyLayers",
    description="Layer names to apply bias correction. If empty, applies to all eligible layers",
)
```

#### exclude\_layers

```python
exclude_layers: List[str] = Field(
    default=[],
    alias="excludeLayers",
    description="Layer names to exclude from bias correction",
)
```

## ModConfig

```python
class ModConfig(BaseModel)
```

Configuration for Minimum Output Difference algorithm

Defines parameters controlling whether and how MOD is applied during quantization, including layer-level inclusion/exclusion lists.

**Parameters**

- `apply` — bool. If true, apply MOD
- `attributes` — [Attributes](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#modconfig-attributes>). MOD algorithm attributes

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#modconfig-model-config>) |  |
| [`apply`](<#modconfig-apply>) |  |
| [`attributes`](<#modconfig-attributes>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(default=False, description="If true, apply MOD")
```

#### attributes

```python
attributes: Attributes = Field(default_factory=Attributes, alias="attributes")
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#modconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "ModConfig"
```

Return a copy with updated fields.

## ModConfig.Attributes

```python
class Attributes(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#modconfig-attributes-model-config>) | MOD algorithm attributes |
| [`epochs`](<#modconfig-attributes-epochs>) |  |
| [`warmup_epochs`](<#modconfig-attributes-warmup-epochs>) |  |
| [`lr_min_ratio`](<#modconfig-attributes-lr-min-ratio>) |  |
| [`save_dir`](<#modconfig-attributes-save-dir>) |  |
| [`seed`](<#modconfig-attributes-seed>) |  |
| [`apply_layers`](<#modconfig-attributes-apply-layers>) |  |
| [`exclude_layers`](<#modconfig-attributes-exclude-layers>) |  |
| [`mod_after_layer_name`](<#modconfig-attributes-mod-after-layer-name>) |  |
| [`anchors`](<#modconfig-attributes-anchors>) |  |
| [`use_xyxy`](<#modconfig-attributes-use-xyxy>) |  |
| [`learning_rates`](<#modconfig-attributes-learning-rates>) |  |
| [`training`](<#modconfig-attributes-training>) |  |
| [`loss`](<#modconfig-attributes-loss>) |  |
| [`post_processing`](<#modconfig-attributes-post-processing>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

MOD algorithm attributes

**Parameters**

- `epochs` — int. Number of training epochs
- `warmup_epochs` — int. Number of warmup epochs
- `lr_min_ratio` — float. Minimum learning rate ratio
- `save_dir` — str. Directory to save MOD results
- `seed` — int. Random seed for MOD
- `apply_layers` — List\[str\]. Layer names to apply MOD. If empty, applies to all eligible layers
- `exclude_layers` — List\[str\]. Layer names to exclude from MOD
- `mod_after_layer_name` — str. Apply MOD after this layer
- `anchors` — List. Anchor configurations for detection models. Nested list of anchor box sizes for detection models. Structure: List\[List\[List\[int\]\]\] where outer list is per detection head (e.g. small/medium/large), middle list is anchors per head, inner list is \[width, height\]. Example: \[\[\[12,16\],\[19,36\],\[40,28\]\], \[\[36,75\],\[76,55\],\[72,146\]\], \[\[142,110\],\[192,243\],\[459,401\]\]\]
- `use_xyxy` — bool. Use XYXY format for bounding boxes
- `learning_rates` — [LearningRates](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#modconfig-attributes-learningrates>). Learning rate configuration for MOD
- `training` — [Training](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#modconfig-attributes-training>). MOD training configuration
- `loss` — [Loss](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#modconfig-attributes-loss>). MOD loss configuration
- `post_processing` — [PostProcessing](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#modconfig-attributes-postprocessing>). Post-processing configuration for detection models

#### epochs

```python
epochs: int = Field(default=4, description="Number of training epochs")
```

#### warmup\_epochs

```python
warmup_epochs: int = Field(
    default=1, alias="warmupEpochs", description="Number of warmup epochs"
)
```

#### lr\_min\_ratio

```python
lr_min_ratio: float = Field(
    default=0.0001,
    alias="lrMinRatio",
    description="Minimum learning rate ratio",
)
```

#### save\_dir

```python
save_dir: str = Field(
    default="", alias="saveDir", description="Directory to save MOD results"
)
```

#### seed

```python
seed: int = Field(default=0, description="Random seed for MOD")
```

#### apply\_layers

```python
apply_layers: List[str] = Field(
    default=[],
    alias="applyLayers",
    description="Layer names to apply MOD. If empty, applies to all eligible layers",
)
```

#### exclude\_layers

```python
exclude_layers: List[str] = Field(
    default=[],
    alias="excludeLayers",
    description="Layer names to exclude from MOD",
)
```

#### mod\_after\_layer\_name

```python
mod_after_layer_name: str = Field(
    default="",
    alias="modAfterLayerName",
    description="Apply MOD after this layer",
)
```

#### anchors

```python
anchors: Any = Field(
    default=[],
    description="Anchor configurations for detection models. Nested list of anchor box sizes for detection models. Structure: List[List[List[int]]] where outer list is per detection head (e.g. small/medium/large), middle list is anchors per head, inner list is [width, height]. Example: [[[12,16],[19,36],[40,28]], [[36,75],[76,55],[72,146]], [[142,110],[192,243],[459,401]]]",
)
```

#### use\_xyxy

```python
use_xyxy: bool = Field(
    default=False,
    alias="useXYXY",
    description="Use XYXY format for bounding boxes",
)
```

#### learning\_rates

```python
learning_rates: LearningRates = Field(
    default_factory=LearningRates, alias="learningRates"
)
```

#### training

```python
training: Training = Field(default_factory=Training, alias="training")
```

#### loss

```python
loss: Loss = Field(default_factory=Loss, alias="loss")
```

#### post\_processing

```python
post_processing: PostProcessing = Field(
    default_factory=PostProcessing, alias="postProcessing"
)
```

## ModConfig.Attributes.LearningRates

```python
class LearningRates(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#modconfig-attributes-learningrates-model-config>) | Learning rate configuration for MOD |
| [`act_scale`](<#modconfig-attributes-learningrates-act-scale>) |  |
| [`zeropoint`](<#modconfig-attributes-learningrates-zeropoint>) |  |
| [`weight_scale`](<#modconfig-attributes-learningrates-weight-scale>) |  |
| [`weight`](<#modconfig-attributes-learningrates-weight>) |  |
| [`bias`](<#modconfig-attributes-learningrates-bias>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Learning rate configuration for MOD

**Parameters**

- `act_scale` — float. Learning rate for activation scale
- `zeropoint` — float. Learning rate for zeropoint
- `weight_scale` — float. Learning rate for weight scale
- `weight` — float. Learning rate for weight
- `bias` — float. Learning rate for bias

#### act\_scale

```python
act_scale: float = Field(
    default=0.0,
    alias="actScale",
    description="Learning rate for activation scale",
)
```

#### zeropoint

```python
zeropoint: float = Field(
    default=0.0, description="Learning rate for zeropoint"
)
```

#### weight\_scale

```python
weight_scale: float = Field(
    default=0.0,
    alias="weightScale",
    description="Learning rate for weight scale",
)
```

#### weight

```python
weight: float = Field(default=4e-06, description="Learning rate for weight")
```

#### bias

```python
bias: float = Field(default=4e-06, description="Learning rate for bias")
```

## ModConfig.Attributes.Training

```python
class Training(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#modconfig-attributes-training-model-config>) | MOD training configuration |
| [`batch_size`](<#modconfig-attributes-training-batch-size>) |  |
| [`q_drop`](<#modconfig-attributes-training-q-drop>) |  |
| [`quantize_weight`](<#modconfig-attributes-training-quantize-weight>) |  |
| [`weight_scale_init`](<#modconfig-attributes-training-weight-scale-init>) |  |
| [`downresol_mode`](<#modconfig-attributes-training-downresol-mode>) |  |
| [`scheduler_type`](<#modconfig-attributes-training-scheduler-type>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

MOD training configuration

**Parameters**

- `batch_size` — int. Batch size for MOD training
- `q_drop` — float. Quantization drop probability
- `quantize_weight` — bool. Whether to quantize weights
- `weight_scale_init` — str. Weight scale initialization method
- `downresol_mode` — str. Downresolution mode
- `scheduler_type` — str. LR scheduler type

#### batch\_size

```python
batch_size: int = Field(
    default=1, alias="batchSize", description="Batch size for MOD training"
)
```

#### q\_drop

```python
q_drop: float = Field(
    default=0.0, alias="qDrop", description="Quantization drop probability"
)
```

#### quantize\_weight

```python
quantize_weight: bool = Field(
    default=True,
    alias="quantizeWeight",
    description="Whether to quantize weights",
)
```

#### weight\_scale\_init

```python
weight_scale_init: str = Field(
    default="MinMax",
    alias="weightScaleInit",
    description="Weight scale initialization method",
)
```

#### downresol\_mode

```python
downresol_mode: str = Field(
    default="STE", alias="downresolMode", description="Downresolution mode"
)
```

#### scheduler\_type

```python
scheduler_type: str = Field(
    default="Cosine", alias="schedulerType", description="LR scheduler type"
)
```

## ModConfig.Attributes.Loss

```python
class Loss(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#modconfig-attributes-loss-model-config>) | MOD loss configuration |
| [`type`](<#modconfig-attributes-loss-type>) |  |
| [`use_outputs`](<#modconfig-attributes-loss-use-outputs>) |  |
| [`kl_temperature`](<#modconfig-attributes-loss-kl-temperature>) |  |
| [`recon_prob`](<#modconfig-attributes-loss-recon-prob>) |  |
| [`recon_coeff`](<#modconfig-attributes-loss-recon-coeff>) |  |
| [`lambda_0`](<#modconfig-attributes-loss-lambda-0>) |  |
| [`lambda_1`](<#modconfig-attributes-loss-lambda-1>) |  |
| [`lambda_2`](<#modconfig-attributes-loss-lambda-2>) |  |
| [`lambda_3`](<#modconfig-attributes-loss-lambda-3>) |  |
| [`custom_loss_jit_path`](<#modconfig-attributes-loss-custom-loss-jit-path>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

MOD loss configuration

**Parameters**

- `type` — str. Loss type (MSE, KL, etc.)
- `use_outputs` — bool. Use model outputs for loss computation
- `kl_temperature` — float. KL divergence temperature
- `recon_prob` — float. Reconstruction probability
- `recon_coeff` — float. Reconstruction coefficient
- `lambda_0` — float. Loss weight lambda\_0
- `lambda_1` — float. Loss weight lambda\_1
- `lambda_2` — float. Loss weight lambda\_2
- `lambda_3` — float. Loss weight lambda\_3
- `custom_loss_jit_path` — str. Path to custom JIT-compiled loss function. Refer to /workspace/quantizer/pyutils/mel.pt

#### type

```python
type: str = Field(default="MSE", description="Loss type (MSE, KL, etc.)")
```

#### use\_outputs

```python
use_outputs: bool = Field(
    default=False,
    alias="useOutputs",
    description="Use model outputs for loss computation",
)
```

#### kl\_temperature

```python
kl_temperature: float = Field(
    default=1.0,
    alias="KLTemperature",
    description="KL divergence temperature",
)
```

#### recon\_prob

```python
recon_prob: float = Field(
    default=1.0, alias="reconProb", description="Reconstruction probability"
)
```

#### recon\_coeff

```python
recon_coeff: float = Field(
    default=1.0,
    alias="reconCoeff",
    description="Reconstruction coefficient",
)
```

#### lambda\_0

```python
lambda_0: float = Field(
    default=1.0,
    validation_alias=AliasChoices("lambda_0", "lambda0"),
    description="Loss weight lambda_0",
)
```

#### lambda\_1

```python
lambda_1: float = Field(
    default=1.0,
    validation_alias=AliasChoices("lambda_1", "lambda1"),
    description="Loss weight lambda_1",
)
```

#### lambda\_2

```python
lambda_2: float = Field(
    default=1.0,
    validation_alias=AliasChoices("lambda_2", "lambda2"),
    description="Loss weight lambda_2",
)
```

#### lambda\_3

```python
lambda_3: float = Field(
    default=1.0,
    validation_alias=AliasChoices("lambda_3", "lambda3"),
    description="Loss weight lambda_3",
)
```

#### custom\_loss\_jit\_path

```python
custom_loss_jit_path: str = Field(
    default="",
    alias="customLossJITPath",
    description="Path to custom JIT-compiled loss function. Refer to /workspace/quantizer/pyutils/mel.pt",
)
```

## ModConfig.Attributes.PostProcessing

```python
class PostProcessing(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#modconfig-attributes-postprocessing-model-config>) | Post-processing configuration for detection models |
| [`post`](<#modconfig-attributes-postprocessing-post>) |  |
| [`box_conf_thres`](<#modconfig-attributes-postprocessing-box-conf-thres>) |  |
| [`box_iou_thres`](<#modconfig-attributes-postprocessing-box-iou-thres>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Post-processing configuration for detection models

**Parameters**

- `post` — str. Post-processing type
- `box_conf_thres` — float. Box confidence threshold
- `box_iou_thres` — float. Box IoU threshold

#### post

```python
post: str = Field(default="", description="Post-processing type")
```

#### box\_conf\_thres

```python
box_conf_thres: float = Field(
    default=0, alias="boxConfThres", description="Box confidence threshold"
)
```

#### box\_iou\_thres

```python
box_iou_thres: float = Field(
    default=0, alias="boxIoUThres", description="Box IoU threshold"
)
```

## LlmConfig

```python
class LlmConfig(BaseModel)
```

Configuration for Large Language Model (LLM) compilation

Defines LLM-specific settings including sequence lengths, cache configurations, and runtime parameters for efficient LLM inference.

**Parameters**

- `apply` — bool. If True, apply LLM-specific configurations
- `npu_parallel_degree` — int. Number of NPU partitions for FFN tensor parallelism (1 = disabled). Applied before OptimizeFFN if both active.
- `attributes` — [Attributes](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#llmconfig-attributes>). LLM attributes configuration

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#llmconfig-model-config>) |  |
| [`apply`](<#llmconfig-apply>) |  |
| [`npu_parallel_degree`](<#llmconfig-npu-parallel-degree>) |  |
| [`attributes`](<#llmconfig-attributes>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(
    default=False, description="If True, apply LLM-specific configurations"
)
```

#### npu\_parallel\_degree

```python
npu_parallel_degree: int = Field(
    default=1,
    alias="npuParallelDegree",
    description="Number of NPU partitions for FFN tensor parallelism (1 = disabled). Applied before OptimizeFFN if both active.",
)
```

#### attributes

```python
attributes: Attributes = Field(default_factory=Attributes, alias="attributes")
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#llmconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "LlmConfig"
```

Return a copy with updated fields.

## LlmConfig.Attributes

```python
class Attributes(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#llmconfig-attributes-model-config>) | LLM attributes configuration |
| [`max_data_length`](<#llmconfig-attributes-max-data-length>) |  |
| [`max_sequence_length`](<#llmconfig-attributes-max-sequence-length>) |  |
| [`max_cache_length`](<#llmconfig-attributes-max-cache-length>) |  |
| [`max_core_data_length`](<#llmconfig-attributes-max-core-data-length>) |  |
| [`calibration`](<#llmconfig-attributes-calibration>) |  |
| [`runtime`](<#llmconfig-attributes-runtime>) |  |
| [`debug`](<#llmconfig-attributes-debug>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

LLM attributes configuration

**Parameters**

- `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
- `calibration` — [Calibration](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#llmconfig-attributes-calibration>). LLM calibration settings
- `runtime` — [Runtime](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#llmconfig-attributes-runtime>). LLM runtime settings
- `debug` — [Debug](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#llmconfig-attributes-debug>). LLM debug settings

#### max\_data\_length

```python
max_data_length: int = Field(
    default=4096, alias="maxDataLength", description="Maximum data length"
)
```

#### max\_sequence\_length

```python
max_sequence_length: int = Field(
    default=4096,
    alias="maxSequenceLength",
    description="Maximum sequence length",
)
```

#### max\_cache\_length

```python
max_cache_length: int = Field(
    default=4096, alias="maxCacheLength", description="Maximum cache length"
)
```

#### max\_core\_data\_length

```python
max_core_data_length: int = Field(
    default=128,
    alias="maxCoreDataLength",
    description="Maximum core data length",
)
```

#### calibration

```python
calibration: Calibration = Field(
    default_factory=Calibration, alias="calibration"
)
```

#### runtime

```python
runtime: Runtime = Field(default_factory=Runtime, alias="runtime")
```

#### debug

```python
debug: Debug = Field(default_factory=Debug, alias="debug")
```

## LlmConfig.Attributes.Calibration

```python
class Calibration(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#llmconfig-attributes-calibration-model-config>) | LLM calibration settings |
| [`random_seq_length`](<#llmconfig-attributes-calibration-random-seq-length>) |  |
| [`use_full_seq_length`](<#llmconfig-attributes-calibration-use-full-seq-length>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

LLM calibration settings

**Parameters**

- `random_seq_length` — int. Random sequence length used for calibration
- `use_full_seq_length` — bool. If True, use the full sequence length for calibration

#### random\_seq\_length

```python
random_seq_length: int = Field(
    default=80,
    alias="randomSeqLength",
    description="Random sequence length used for calibration",
)
```

#### use\_full\_seq\_length

```python
use_full_seq_length: bool = Field(
    default=False,
    alias="useFullSeqLength",
    description="If True, use the full sequence length for calibration",
)
```

## LlmConfig.Attributes.Runtime

```python
class Runtime(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#llmconfig-attributes-runtime-model-config>) | LLM runtime settings |
| [`use_global_core`](<#llmconfig-attributes-runtime-use-global-core>) |  |
| [`batch_size`](<#llmconfig-attributes-runtime-batch-size>) |  |
| [`npu_core_ids`](<#llmconfig-attributes-runtime-npu-core-ids>) |  |
| [`dynamic_rope`](<#llmconfig-attributes-runtime-dynamic-rope>) |  |
| [`dynamic_mask`](<#llmconfig-attributes-runtime-dynamic-mask>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

LLM runtime settings

**Parameters**

- `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 (rotary position embedding)
- `dynamic_mask` — bool. If True, enable dynamic mask (attention mask as runtime input)

#### use\_global\_core

```python
use_global_core: bool = Field(
    default=False,
    alias="useGlobalCore",
    description="If True, use a global core",
)
```

#### batch\_size

```python
batch_size: int = Field(
    default=1, alias="batchSize", description="Batch size"
)
```

#### npu\_core\_ids

```python
npu_core_ids: List[int] = Field(
    default=[0], alias="npuCoreIds", description="List of NPU core IDs"
)
```

#### dynamic\_rope

```python
dynamic_rope: bool = Field(
    default=False,
    alias="dynamicRope",
    description="If True, enable dynamic RoPE (rotary position embedding)",
)
```

#### dynamic\_mask

```python
dynamic_mask: bool = Field(
    default=False,
    alias="dynamicMask",
    description="If True, enable dynamic mask (attention mask as runtime input)",
)
```

## LlmConfig.Attributes.Debug

```python
class Debug(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#llmconfig-attributes-debug-model-config>) | LLM debug settings |
| [`apply`](<#llmconfig-attributes-debug-apply>) |  |
| [`batch_debug_bundle_size`](<#llmconfig-attributes-debug-batch-debug-bundle-size>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

LLM debug settings

**Parameters**

- `apply` — bool. Enable LLM debug mode
- `batch_debug_bundle_size` — int. Batch debug bundle size

#### apply

```python
apply: bool = Field(default=False, description="Enable LLM debug mode")
```

#### batch\_debug\_bundle\_size

```python
batch_debug_bundle_size: int = Field(
    default=0,
    alias="batchDebugBundleSize",
    description="Batch debug bundle size",
)
```

## MoeConfig

```python
class MoeConfig(BaseModel)
```

Sparse MoE expert-selection configuration (calibration only)

Controls which experts are calibrated inside SparseMoe modules. selectionMode is a calibration-only knob: it picks which experts collect statistics (and, for TopK, on which tokens). It does NOT change inference routing — the forward path always routes the router's top-K experts regardless of this setting. scoreThreshold is only used when selectionMode is Threshold.

**Parameters**

- `selection_mode` — int. Expert selection mode index (calibration only; inference is always top-K):  
  0: TopK - Calibrate only the router's top-K experts per token (matches inference routing).  
  1: All - Calibrate every expert on the full sequence.  
  2: Threshold - Calibrate all experts whose routing score exceeds scoreThreshold.
- `score_threshold` — float. Routing score threshold used when selectionMode is Threshold (calibration only)

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#moeconfig-model-config>) |  |
| [`selection_mode_list`](<#moeconfig-selection-mode-list>) |  |
| [`selection_mode`](<#moeconfig-selection-mode>) |  |
| [`score_threshold`](<#moeconfig-score-threshold>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### selection\_mode\_list

```python
selection_mode_list: List[str] = Field(
    default=["TopK", "All", "Threshold"], alias="selectionModeList"
)
```

#### selection\_mode

```python
selection_mode: int = Field(default=0, alias="selectionMode")
```

#### score\_threshold

```python
score_threshold: float = Field(
    default=0.0,
    alias="scoreThreshold",
    description="Routing score threshold used when selectionMode is Threshold (calibration only)",
    ge=0,
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#moeconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "MoeConfig"
```

Return a copy with updated fields.

## EquivalentTransformationConfig

```python
class EquivalentTransformationConfig(BaseModel)
```

Configuration for equivalent transformation techniques

Defines parameters for various equivalent transformation methods including [NormConv](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-normconv>), QK smoothing, and rotation matrices for improved quantization.

**Parameters**

- `seed` — int. Random seed for transformation
- `apply_hadamard_rotation_matrix` — bool. Apply Hadamard rotation matrix
- `norm_conv` — [NormConv](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-normconv>). [NormConv](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-normconv>) equivalent transformation
- `qk` — [Qk](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-qk>). QK smoothing transformation
- `ud` — [Ud](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-ud>). UD transformation
- `vo` — [Vo](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-vo>). VO transformation
- `feed_forward_multi_lut` — [FeedForwardMultiLut](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-feedforwardmultilut>). Feed-forward multi-LUT transformation
- `spin_r1` — [SpinR1](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-spinr1>). [SpinR1](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-spinr1>) rotation transformation
- `head_out_ch_rotation` — [HeadOutChRotation](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-headoutchrotation>). Head output channel rotation transformation
- `in_rotation` — [InRotation](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-inrotation>). Input rotation transformation
- `spin_r2` — [SpinR2](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-spinr2>). [SpinR2](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-spinr2>) rotation transformation
- `qk_rotation` — [QkRotation](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-qkrotation>). QK rotation transformation
- `flatten_quant` — [FlattenQuant](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-flattenquant>). Flatten quantization transformation
- `optimize_ffn` — [OptimizeFfn](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#equivalenttransformationconfig-optimizeffn>). FFN optimization

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-model-config>) |  |
| [`seed`](<#equivalenttransformationconfig-seed>) |  |
| [`apply_hadamard_rotation_matrix`](<#equivalenttransformationconfig-apply-hadamard-rotation-matrix>) |  |
| [`norm_conv`](<#equivalenttransformationconfig-norm-conv>) |  |
| [`qk`](<#equivalenttransformationconfig-qk>) |  |
| [`ud`](<#equivalenttransformationconfig-ud>) |  |
| [`vo`](<#equivalenttransformationconfig-vo>) |  |
| [`feed_forward_multi_lut`](<#equivalenttransformationconfig-feed-forward-multi-lut>) |  |
| [`spin_r1`](<#equivalenttransformationconfig-spin-r1>) |  |
| [`head_out_ch_rotation`](<#equivalenttransformationconfig-head-out-ch-rotation>) |  |
| [`in_rotation`](<#equivalenttransformationconfig-in-rotation>) |  |
| [`spin_r2`](<#equivalenttransformationconfig-spin-r2>) |  |
| [`qk_rotation`](<#equivalenttransformationconfig-qk-rotation>) |  |
| [`flatten_quant`](<#equivalenttransformationconfig-flatten-quant>) |  |
| [`optimize_ffn`](<#equivalenttransformationconfig-optimize-ffn>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### seed

```python
seed: int = Field(default=0, description="Random seed for transformation")
```

#### apply\_hadamard\_rotation\_matrix

```python
apply_hadamard_rotation_matrix: bool = Field(
    default=True,
    alias="applyHadamardRotationMatrix",
    description="Apply Hadamard rotation matrix",
)
```

#### norm\_conv

```python
norm_conv: NormConv = Field(default_factory=NormConv, alias="NormConv")
```

#### qk

```python
qk: Qk = Field(default_factory=Qk, alias="QK")
```

#### ud

```python
ud: Ud = Field(default_factory=Ud, alias="UD")
```

#### vo

```python
vo: Vo = Field(default_factory=Vo, alias="VO")
```

#### feed\_forward\_multi\_lut

```python
feed_forward_multi_lut: FeedForwardMultiLut = Field(
    default_factory=FeedForwardMultiLut, alias="FeedForwardMultiLUT"
)
```

#### spin\_r1

```python
spin_r1: SpinR1 = Field(default_factory=SpinR1, alias="SpinR1")
```

#### head\_out\_ch\_rotation

```python
head_out_ch_rotation: HeadOutChRotation = Field(
    default_factory=HeadOutChRotation, alias="HeadOutChRotation"
)
```

#### in\_rotation

```python
in_rotation: InRotation = Field(default_factory=InRotation, alias="InRotation")
```

#### spin\_r2

```python
spin_r2: SpinR2 = Field(default_factory=SpinR2, alias="SpinR2")
```

#### qk\_rotation

```python
qk_rotation: QkRotation = Field(default_factory=QkRotation, alias="QKRotation")
```

#### flatten\_quant

```python
flatten_quant: FlattenQuant = Field(
    default_factory=FlattenQuant, alias="FlattenQuant"
)
```

#### optimize\_ffn

```python
optimize_ffn: OptimizeFfn = Field(default_factory=OptimizeFfn, alias="OptimizeFFN")
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#equivalenttransformationconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "EquivalentTransformationConfig"
```

Return a copy with updated fields.

## EquivalentTransformationConfig.NormConv

```python
class NormConv(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-normconv-model-config>) | NormConv equivalent transformation |
| [`apply`](<#equivalenttransformationconfig-normconv-apply>) |  |
| [`learn`](<#equivalenttransformationconfig-normconv-learn>) |  |
| [`smoothing_factor`](<#equivalenttransformationconfig-normconv-smoothing-factor>) |  |
| [`min_gamma`](<#equivalenttransformationconfig-normconv-min-gamma>) |  |
| [`max_gamma`](<#equivalenttransformationconfig-normconv-max-gamma>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

NormConv equivalent transformation

**Parameters**

- `apply` — bool. Apply NormConv transformation
- `learn` — bool. Learn transformation parameters
- `smoothing_factor` — float. Smoothing factor
- `min_gamma` — float. Minimum gamma value
- `max_gamma` — float. Maximum gamma value

#### apply

```python
apply: bool = Field(default=False, description="Apply NormConv transformation")
```

#### learn

```python
learn: bool = Field(
    default=False, description="Learn transformation parameters"
)
```

#### smoothing\_factor

```python
smoothing_factor: float = Field(
    default=0.5, alias="smoothingFactor", description="Smoothing factor"
)
```

#### min\_gamma

```python
min_gamma: float = Field(
    default=0.0001, alias="minGamma", description="Minimum gamma value"
)
```

#### max\_gamma

```python
max_gamma: float = Field(
    default=10000.0, alias="maxGamma", description="Maximum gamma value"
)
```

## EquivalentTransformationConfig.Qk

```python
class Qk(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-qk-model-config>) | QK smoothing transformation |
| [`apply`](<#equivalenttransformationconfig-qk-apply>) |  |
| [`smoothing_factor`](<#equivalenttransformationconfig-qk-smoothing-factor>) |  |
| [`min_gamma`](<#equivalenttransformationconfig-qk-min-gamma>) |  |
| [`max_gamma`](<#equivalenttransformationconfig-qk-max-gamma>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

QK smoothing transformation

**Parameters**

- `apply` — bool. Apply QK transformation
- `smoothing_factor` — float. Smoothing factor
- `min_gamma` — float. Minimum gamma value
- `max_gamma` — float. Maximum gamma value

#### apply

```python
apply: bool = Field(default=False, description="Apply QK transformation")
```

#### smoothing\_factor

```python
smoothing_factor: float = Field(
    default=0.5, alias="smoothingFactor", description="Smoothing factor"
)
```

#### min\_gamma

```python
min_gamma: float = Field(
    default=0.0001, alias="minGamma", description="Minimum gamma value"
)
```

#### max\_gamma

```python
max_gamma: float = Field(
    default=10000.0, alias="maxGamma", description="Maximum gamma value"
)
```

## EquivalentTransformationConfig.Ud

```python
class Ud(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-ud-model-config>) | UD transformation |
| [`apply`](<#equivalenttransformationconfig-ud-apply>) |  |
| [`learn`](<#equivalenttransformationconfig-ud-learn>) |  |
| [`smoothing_factor`](<#equivalenttransformationconfig-ud-smoothing-factor>) |  |
| [`min_gamma`](<#equivalenttransformationconfig-ud-min-gamma>) |  |
| [`max_gamma`](<#equivalenttransformationconfig-ud-max-gamma>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

UD transformation

**Parameters**

- `apply` — bool. Apply UD transformation
- `learn` — bool. Learn transformation parameters
- `smoothing_factor` — float. Smoothing factor
- `min_gamma` — float. Minimum gamma value
- `max_gamma` — float. Maximum gamma value

#### apply

```python
apply: bool = Field(default=False, description="Apply UD transformation")
```

#### learn

```python
learn: bool = Field(
    default=False, description="Learn transformation parameters"
)
```

#### smoothing\_factor

```python
smoothing_factor: float = Field(
    default=0.5, alias="smoothingFactor", description="Smoothing factor"
)
```

#### min\_gamma

```python
min_gamma: float = Field(
    default=0.0001, alias="minGamma", description="Minimum gamma value"
)
```

#### max\_gamma

```python
max_gamma: float = Field(
    default=10000.0, alias="maxGamma", description="Maximum gamma value"
)
```

## EquivalentTransformationConfig.Vo

```python
class Vo(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-vo-model-config>) | VO transformation |
| [`apply`](<#equivalenttransformationconfig-vo-apply>) |  |
| [`smoothing_factor`](<#equivalenttransformationconfig-vo-smoothing-factor>) |  |
| [`min_gamma`](<#equivalenttransformationconfig-vo-min-gamma>) |  |
| [`max_gamma`](<#equivalenttransformationconfig-vo-max-gamma>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

VO transformation

**Parameters**

- `apply` — bool. Apply VO transformation
- `smoothing_factor` — float. Smoothing factor
- `min_gamma` — float. Minimum gamma value
- `max_gamma` — float. Maximum gamma value

#### apply

```python
apply: bool = Field(default=False, description="Apply VO transformation")
```

#### smoothing\_factor

```python
smoothing_factor: float = Field(
    default=0.5, alias="smoothingFactor", description="Smoothing factor"
)
```

#### min\_gamma

```python
min_gamma: float = Field(
    default=0.0001, alias="minGamma", description="Minimum gamma value"
)
```

#### max\_gamma

```python
max_gamma: float = Field(
    default=10000.0, alias="maxGamma", description="Maximum gamma value"
)
```

## EquivalentTransformationConfig.FeedForwardMultiLut

```python
class FeedForwardMultiLut(BaseModel)
```

Feed-forward multi-LUT transformation

**Parameters**

- `apply` — bool. Apply feed-forward multi-LUT transformation
- `breakpoints` — List\[float\]. Breakpoints for multi-LUT

### Attributes

| Name | Description |
| --- | --- |
| [`apply`](<#equivalenttransformationconfig-feedforwardmultilut-apply>) |  |
| [`breakpoints`](<#equivalenttransformationconfig-feedforwardmultilut-breakpoints>) |  |

#### apply

```python
apply: bool = Field(
    default=False, description="Apply feed-forward multi-LUT transformation"
)
```

#### breakpoints

```python
breakpoints: List[float] = Field(
    default=[-8.0, -4.0, 0], description="Breakpoints for multi-LUT"
)
```

## EquivalentTransformationConfig.SpinR1

```python
class SpinR1(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-spinr1-model-config>) | SpinR1 rotation transformation |
| [`apply`](<#equivalenttransformationconfig-spinr1-apply>) |  |
| [`matrix_path`](<#equivalenttransformationconfig-spinr1-matrix-path>) |  |
| [`insert_output_conv`](<#equivalenttransformationconfig-spinr1-insert-output-conv>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

SpinR1 rotation transformation

**Parameters**

- `apply` — bool. Apply SpinR1 transformation
- `matrix_path` — str. Path to rotation matrix file
- `insert_output_conv` — bool. Insert an identity output conv when the residual stream ends without a head conv

#### apply

```python
apply: bool = Field(default=False, description="Apply SpinR1 transformation")
```

#### matrix\_path

```python
matrix_path: str = Field(
    default="", alias="matrixPath", description="Path to rotation matrix file"
)
```

#### insert\_output\_conv

```python
insert_output_conv: bool = Field(
    default=False,
    alias="insertOutputConv",
    description="Insert an identity output conv when the residual stream ends without a head conv",
)
```

## EquivalentTransformationConfig.HeadOutChRotation

```python
class HeadOutChRotation(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-headoutchrotation-model-config>) | Head output channel rotation transformation |
| [`apply`](<#equivalenttransformationconfig-headoutchrotation-apply>) |  |
| [`matrix_path`](<#equivalenttransformationconfig-headoutchrotation-matrix-path>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Head output channel rotation transformation

**Parameters**

- `apply` — bool. Apply head output channel rotation
- `matrix_path` — str. Path to rotation matrix file

#### apply

```python
apply: bool = Field(
    default=False, description="Apply head output channel rotation"
)
```

#### matrix\_path

```python
matrix_path: str = Field(
    default="", alias="matrixPath", description="Path to rotation matrix file"
)
```

## EquivalentTransformationConfig.InRotation

```python
class InRotation(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-inrotation-model-config>) | Input rotation transformation |
| [`apply`](<#equivalenttransformationconfig-inrotation-apply>) |  |
| [`matrix_path`](<#equivalenttransformationconfig-inrotation-matrix-path>) |  |
| [`input_names`](<#equivalenttransformationconfig-inrotation-input-names>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Input rotation transformation

**Parameters**

- `apply` — bool. Apply input rotation
- `matrix_path` — str. Path to rotation matrix file
- `input_names` — List\[str\]. Names of the input layers to rotate

#### apply

```python
apply: bool = Field(default=False, description="Apply input rotation")
```

#### matrix\_path

```python
matrix_path: str = Field(
    default="", alias="matrixPath", description="Path to rotation matrix file"
)
```

#### input\_names

```python
input_names: List[str] = Field(
    default=[],
    alias="inputNames",
    description="Names of the input layers to rotate",
)
```

## EquivalentTransformationConfig.SpinR2

```python
class SpinR2(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-spinr2-model-config>) | SpinR2 rotation transformation |
| [`apply`](<#equivalenttransformationconfig-spinr2-apply>) |  |
| [`learn`](<#equivalenttransformationconfig-spinr2-learn>) |  |
| [`matrix_path`](<#equivalenttransformationconfig-spinr2-matrix-path>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

SpinR2 rotation transformation

**Parameters**

- `apply` — bool. Apply SpinR2 transformation
- `learn` — bool. Learn rotation matrix
- `matrix_path` — str. Path to rotation matrix file

#### apply

```python
apply: bool = Field(default=False, description="Apply SpinR2 transformation")
```

#### learn

```python
learn: bool = Field(default=False, description="Learn rotation matrix")
```

#### matrix\_path

```python
matrix_path: str = Field(
    default="", alias="matrixPath", description="Path to rotation matrix file"
)
```

## EquivalentTransformationConfig.QkRotation

```python
class QkRotation(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-qkrotation-model-config>) | QK rotation transformation |
| [`apply`](<#equivalenttransformationconfig-qkrotation-apply>) |  |
| [`matrix_path`](<#equivalenttransformationconfig-qkrotation-matrix-path>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

QK rotation transformation

**Parameters**

- `apply` — bool. Apply QK rotation transformation
- `matrix_path` — str. Path to rotation matrix file

#### apply

```python
apply: bool = Field(
    default=False, description="Apply QK rotation transformation"
)
```

#### matrix\_path

```python
matrix_path: str = Field(
    default="", alias="matrixPath", description="Path to rotation matrix file"
)
```

## EquivalentTransformationConfig.FlattenQuant

```python
class FlattenQuant(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-flattenquant-model-config>) | Flatten quantization transformation |
| [`apply`](<#equivalenttransformationconfig-flattenquant-apply>) |  |
| [`learn`](<#equivalenttransformationconfig-flattenquant-learn>) |  |
| [`apply_threshold`](<#equivalenttransformationconfig-flattenquant-apply-threshold>) |  |
| [`max_overhead`](<#equivalenttransformationconfig-flattenquant-max-overhead>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

Flatten quantization transformation

**Parameters**

- `apply` — bool. Apply flatten quantization
- `learn` — bool. Learn flattening parameters
- `apply_threshold` — float. Threshold for applying flatten quantization
- `max_overhead` — float. Maximum overhead allowed for flattening

#### apply

```python
apply: bool = Field(default=False, description="Apply flatten quantization")
```

#### learn

```python
learn: bool = Field(default=False, description="Learn flattening parameters")
```

#### apply\_threshold

```python
apply_threshold: float = Field(
    default=0.33,
    alias="applyThreshold",
    description="Threshold for applying flatten quantization",
)
```

#### max\_overhead

```python
max_overhead: float = Field(
    default=0.02,
    alias="maxOverhead",
    description="Maximum overhead allowed for flattening",
)
```

## EquivalentTransformationConfig.OptimizeFfn

```python
class OptimizeFfn(BaseModel)
```

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#equivalenttransformationconfig-optimizeffn-model-config>) | FFN optimization |
| [`apply`](<#equivalenttransformationconfig-optimizeffn-apply>) |  |
| [`ch_per_ffn`](<#equivalenttransformationconfig-optimizeffn-ch-per-ffn>) |  |

#### model\_config

```python
model_config = ConfigDict(populate_by_name=True)
```

FFN optimization

**Parameters**

- `apply` — bool. Apply FFN optimization
- `ch_per_ffn` — int. Optimize FFN split (-1 for auto)

#### apply

```python
apply: bool = Field(default=False, description="Apply FFN optimization")
```

#### ch\_per\_ffn

```python
ch_per_ffn: int = Field(
    default=-1, alias="chPerFFN", description="Optimize FFN split (-1 for auto)"
)
```

## SearchWeightScaleConfig

```python
class SearchWeightScaleConfig(BaseModel)
```

Configuration for weight scale search

Defines which transformer components should have their weight scales searched for optimal quantization.

**Parameters**

- `apply` — bool. If true, apply weight scale search
- `transformer` — [Transformer](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#searchweightscaleconfig-transformer>). [Transformer](<https://docs.mobilint.com/compiler/kr/v1.4/api/python/qbcompiler.configs.models/#searchweightscaleconfig-transformer>) components for weight scale search

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#searchweightscaleconfig-model-config>) |  |
| [`apply`](<#searchweightscaleconfig-apply>) |  |
| [`transformer`](<#searchweightscaleconfig-transformer>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(default=False, description="If true, apply weight scale search")
```

#### transformer

```python
transformer: Transformer = Field(default_factory=Transformer, alias="transformer")
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#searchweightscaleconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "SearchWeightScaleConfig"
```

Return a copy with updated fields.

## SearchWeightScaleConfig.Transformer

```python
class Transformer(BaseModel)
```

Transformer components for weight scale search

**Parameters**

- `query` — bool. Search weight scale for query
- `key` — bool. Search weight scale for key
- `value` — bool. Search weight scale for value
- `out` — bool. Search weight scale for output
- `ffn` — bool. Search weight scale for FFN

### Attributes

| Name | Description |
| --- | --- |
| [`query`](<#searchweightscaleconfig-transformer-query>) |  |
| [`key`](<#searchweightscaleconfig-transformer-key>) |  |
| [`value`](<#searchweightscaleconfig-transformer-value>) |  |
| [`out`](<#searchweightscaleconfig-transformer-out>) |  |
| [`ffn`](<#searchweightscaleconfig-transformer-ffn>) |  |

#### query

```python
query: bool = Field(default=False, description="Search weight scale for query")
```

#### key

```python
key: bool = Field(default=False, description="Search weight scale for key")
```

#### value

```python
value: bool = Field(default=False, description="Search weight scale for value")
```

#### out

```python
out: bool = Field(default=False, description="Search weight scale for output")
```

#### ffn

```python
ffn: bool = Field(default=False, description="Search weight scale for FFN")
```

## LoadScaleConfig

```python
class LoadScaleConfig(BaseModel)
```

QAT activation scale loading configuration

Loads activation scales from .safetensors, torch.save tensor dictionaries, or libtorch OutputArchive .pt/.pth files. Scalars select per-layer quantization; channel vectors select per-channel quantization. Invalid imports fail compilation. Sigmoid/Compare imports must match the hardware-fixed scale and zero-point (within 1e-6 relative scale tolerance). actScaleMin and enabled minClipRatio clipping take precedence over imported values; applied scales and clipping adjustments are logged, with quantization ranges updated to match. NOTE: entries is stored as raw JSON (type: list) because the generator does not support list\[CustomStruct\]. The schema records the field shape; parsing is done manually in activation\_scale\_loader::read.

**Parameters**

- `apply` — bool. If true, load and apply QAT activation scales; invalid imports are errors
- `entries` — List. List of file entries. Each entry is a dict: { path: str, scales: \[ { key: str, layers: \[str\], zeropointKey?: str } \] } path: .safetensors or .pt/.pth file; key: floating scalar or channel vector. zeropointKey: optional I32/I64 tensor; .actScale keys automatically use a sibling .zeropoint if present, otherwise zero. Scalar zeropoints broadcast. layers: compiler layer names whose independent activation scales are overridden.

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#loadscaleconfig-model-config>) |  |
| [`apply`](<#loadscaleconfig-apply>) |  |
| [`entries`](<#loadscaleconfig-entries>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(
    default=False,
    description="If true, load and apply QAT activation scales; invalid imports are errors",
)
```

#### entries

```python
entries: Any = Field(
    default=[],
    description="List of file entries. Each entry is a dict: { path: str, scales: [ { key: str, layers: [str], zeropointKey?: str } ] } path: .safetensors or .pt/.pth file; key: floating scalar or channel vector. zeropointKey: optional I32/I64 tensor; .actScale keys automatically use a sibling .zeropoint if present, otherwise zero. Scalar zeropoints broadcast. layers: compiler layer names whose independent activation scales are overridden.",
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#loadscaleconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "LoadScaleConfig"
```

Return a copy with updated fields.

## RuntimeOptions

```python
class RuntimeOptions(BaseModel)
```

Runtime options for compilation

Contains runtime-specific settings like version info and cache options.

**Parameters**

- `version` — str. Compiler version string (e.g., 0.0.0)
- `deterministic_algorithms` — bool. Run LUT grouping, the only compile stage found to vary between runs on one GPU, with PyTorch deterministic algorithms; false gives a faster grouping whose result can differ between runs

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#runtimeoptions-model-config>) |  |
| [`version`](<#runtimeoptions-version>) |  |
| [`deterministic_algorithms`](<#runtimeoptions-deterministic-algorithms>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### version

```python
version: str = Field(
    default="0.0.0", description="Compiler version string (e.g., 0.0.0)"
)
```

#### deterministic\_algorithms

```python
deterministic_algorithms: bool = Field(
    default=True,
    alias="deterministicAlgorithms",
    description="Run LUT grouping, the only compile stage found to vary between runs on one GPU, with PyTorch deterministic algorithms; false gives a faster grouping whose result can differ between runs",
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#runtimeoptions-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "RuntimeOptions"
```

Return a copy with updated fields.

## SaveSampleConfig

```python
class SaveSampleConfig(BaseModel)
```

Sample data generation and saving configuration

**Parameters**

- `apply` — bool. Enable sample data saving
- `mode` — str. Inference mode: infer (standard) or inferWithCache (LLM cache models)
- `batch_size` — int. Number of inference batches to generate
- `batch_seq_lens` — List. Per-batch step-wise sequence lengths for inferWithCache mode. e.g. \[\[80, 1\], \[240, 10\]\]
- `save_folder` — str. Output folder for sample data
- `dtype` — str. Data type for saved samples: float or int8

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#savesampleconfig-model-config>) |  |
| [`apply`](<#savesampleconfig-apply>) |  |
| [`mode`](<#savesampleconfig-mode>) |  |
| [`batch_size`](<#savesampleconfig-batch-size>) |  |
| [`batch_seq_lens`](<#savesampleconfig-batch-seq-lens>) |  |
| [`save_folder`](<#savesampleconfig-save-folder>) |  |
| [`dtype`](<#savesampleconfig-dtype>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(default=False, description="Enable sample data saving")
```

#### mode

```python
mode: str = Field(
    default="infer",
    description="Inference mode: infer (standard) or inferWithCache (LLM cache models)",
)
```

#### batch\_size

```python
batch_size: int = Field(
    default=1,
    alias="batchSize",
    description="Number of inference batches to generate",
)
```

#### batch\_seq\_lens

```python
batch_seq_lens: Any = Field(
    default=[],
    alias="batchSeqLens",
    description="Per-batch step-wise sequence lengths for inferWithCache mode. e.g. [[80, 1], [240, 10]]",
)
```

#### save\_folder

```python
save_folder: str = Field(
    default="sampleInout",
    alias="saveFolder",
    description="Output folder for sample data",
)
```

#### dtype

```python
dtype: str = Field(
    default="float", description="Data type for saved samples: float or int8"
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#savesampleconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "SaveSampleConfig"
```

Return a copy with updated fields.

## ExtraOutputConfig

```python
class ExtraOutputConfig(BaseModel)
```

Promote named intermediate layers to additional model outputs

Applied after quantization, so the rest of the bundle is unchanged. Names are matched against the post-fusion graph, and an unknown one is an error.

**Parameters**

- `apply` — bool. Promote the named layers. Off by default: promotion is an explicit opt-in.
- `layers` — List\[str\]. Layer names to promote; one that is already an output is left alone

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#extraoutputconfig-model-config>) |  |
| [`apply`](<#extraoutputconfig-apply>) |  |
| [`layers`](<#extraoutputconfig-layers>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(
    default=False,
    description="Promote the named layers. Off by default: promotion is an explicit opt-in.",
)
```

#### layers

```python
layers: List[str] = Field(
    default=[],
    description="Layer names to promote; one that is already an output is left alone",
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#extraoutputconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "ExtraOutputConfig"
```

Return a copy with updated fields.

## GroupWiseConfig

```python
class GroupWiseConfig(BaseModel)
```

Group-wise streaming quantization configuration for large LLMs

Configuration for the group-wise (streaming) quantization pipeline used for LLMs that do not fit fully on GPU. Partitions the model into groups of transformer blocks and quantizes each group independently.

**Parameters**

- `apply` — bool. Enable group-wise streaming quantization pipeline
- `group_size` — int. Group size in number of transformer blocks (0 = auto)
- `gpu_budget_gb` — float. GPU memory budget in GiB for group-wise execution (0 = auto-detect)
- `gpu_safety_margin_gb` — float. Safety margin in GiB subtracted from detected GPU budget
- `cache_dir` — str. Directory for group-wise activation/state cache (empty = system temp)
- `keep_cache` — bool. Retain group-wise cache after run completes (for debugging)
- `partition_policy` — str. Partitioning policy (e.g. transformer\_block, moe\_expert\_subgroup)
- `expert_groups` — List\[List\[int\]\]. MoE fallback partitioner: list of expert-index lists (List\[List\[int\]\]).
- `retain_topology_weights` — bool. Keep inflated FP weights across groups (false = release after each group for tight memory budgets).
- `checkpoint` — bool. Save per-group checkpoint so quantization can resume from the last completed group after a crash.

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#groupwiseconfig-model-config>) |  |
| [`apply`](<#groupwiseconfig-apply>) |  |
| [`group_size`](<#groupwiseconfig-group-size>) |  |
| [`gpu_budget_gb`](<#groupwiseconfig-gpu-budget-gb>) |  |
| [`gpu_safety_margin_gb`](<#groupwiseconfig-gpu-safety-margin-gb>) |  |
| [`cache_dir`](<#groupwiseconfig-cache-dir>) |  |
| [`keep_cache`](<#groupwiseconfig-keep-cache>) |  |
| [`partition_policy`](<#groupwiseconfig-partition-policy>) |  |
| [`expert_groups`](<#groupwiseconfig-expert-groups>) |  |
| [`retain_topology_weights`](<#groupwiseconfig-retain-topology-weights>) |  |
| [`checkpoint`](<#groupwiseconfig-checkpoint>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### apply

```python
apply: bool = Field(
    default=False, description="Enable group-wise streaming quantization pipeline"
)
```

#### group\_size

```python
group_size: int = Field(
    default=0,
    alias="groupSize",
    description="Group size in number of transformer blocks (0 = auto)",
)
```

#### gpu\_budget\_gb

```python
gpu_budget_gb: float = Field(
    default=0,
    alias="gpuBudgetGb",
    description="GPU memory budget in GiB for group-wise execution (0 = auto-detect)",
)
```

#### gpu\_safety\_margin\_gb

```python
gpu_safety_margin_gb: float = Field(
    default=4,
    alias="gpuSafetyMarginGb",
    description="Safety margin in GiB subtracted from detected GPU budget",
)
```

#### cache\_dir

```python
cache_dir: str = Field(
    default="",
    alias="cacheDir",
    description="Directory for group-wise activation/state cache (empty = system temp)",
)
```

#### keep\_cache

```python
keep_cache: bool = Field(
    default=False,
    alias="keepCache",
    description="Retain group-wise cache after run completes (for debugging)",
)
```

#### partition\_policy

```python
partition_policy: str = Field(
    default="transformer_block",
    alias="partitionPolicy",
    description="Partitioning policy (e.g. transformer_block, moe_expert_subgroup)",
)
```

#### expert\_groups

```python
expert_groups: Any = Field(
    default=[],
    alias="expertGroups",
    description="MoE fallback partitioner: list of expert-index lists (List[List[int]]).",
)
```

#### retain\_topology\_weights

```python
retain_topology_weights: bool = Field(
    default=True,
    alias="retainTopologyWeights",
    description="Keep inflated FP weights across groups (false = release after each group for tight memory budgets).",
)
```

#### checkpoint

```python
checkpoint: bool = Field(
    default=False,
    description="Save per-group checkpoint so quantization can resume from the last completed group after a crash.",
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_updates`](<#groupwiseconfig-with-updates>) | Return a copy with updated fields. |

#### with\_updates

```python
def with_updates(self, **kwargs) -> "GroupWiseConfig"
```

Return a copy with updated fields.

## CompileConfig

```python
class CompileConfig(BaseModel)
```

Unified compilation configuration for Mobilint MXQ compilation.

### Attributes

| Name | Description |
| --- | --- |
| [`model_config`](<#compileconfig-model-config>) |  |
| [`model_paths`](<#compileconfig-model-paths>) |  |
| [`calib_data_path`](<#compileconfig-calib-data-path>) |  |
| [`save_paths`](<#compileconfig-save-paths>) |  |
| [`use_random_calib`](<#compileconfig-use-random-calib>) |  |
| [`inference_scheme`](<#compileconfig-inference-scheme>) |  |
| [`cpu_offload`](<#compileconfig-cpu-offload>) |  |
| [`force_npu_input_reposition`](<#compileconfig-force-npu-input-reposition>) |  |
| [`force_npu_output_reposition`](<#compileconfig-force-npu-output-reposition>) |  |
| [`optimize_option`](<#compileconfig-optimize-option>) |  |
| [`buffer_mode`](<#compileconfig-buffer-mode>) |  |
| [`device`](<#compileconfig-device>) |  |
| [`dtype`](<#compileconfig-dtype>) |  |
| [`debug`](<#compileconfig-debug>) |  |
| [`trace`](<#compileconfig-trace>) |  |
| [`image_channels`](<#compileconfig-image-channels>) |  |
| [`config_version`](<#compileconfig-config-version>) |  |
| [`split_blocks`](<#compileconfig-split-blocks>) |  |
| [`split_parts`](<#compileconfig-split-parts>) |  |
| [`uint8_input`](<#compileconfig-uint8-input>) |  |
| [`preprocessing`](<#compileconfig-preprocessing>) |  |
| [`resource_management`](<#compileconfig-resource-management>) |  |
| [`calibration`](<#compileconfig-calibration>) |  |
| [`bit`](<#compileconfig-bit>) |  |
| [`hessian_quant`](<#compileconfig-hessian-quant>) |  |
| [`bias_correction`](<#compileconfig-bias-correction>) |  |
| [`mod`](<#compileconfig-mod>) |  |
| [`llm`](<#compileconfig-llm>) |  |
| [`moe`](<#compileconfig-moe>) |  |
| [`equivalent_transformation`](<#compileconfig-equivalent-transformation>) |  |
| [`search_weight_scale`](<#compileconfig-search-weight-scale>) |  |
| [`load_scale`](<#compileconfig-load-scale>) |  |
| [`runtime_options`](<#compileconfig-runtime-options>) |  |
| [`save_sample`](<#compileconfig-save-sample>) |  |
| [`extra_output`](<#compileconfig-extra-output>) |  |
| [`group_wise`](<#compileconfig-group-wise>) |  |

#### model\_config

```python
model_config = ConfigDict(
    populate_by_name=True,
    extra="forbid",
)
```

#### model\_paths

```python
model_paths: List[str] = Field(
    default=[], alias="modelPaths", description="Paths to model files"
)
```

#### calib\_data\_path

```python
calib_data_path: List[str] = Field(
    default=[], alias="calibDataPaths", description="Paths to calibration datasets"
)
```

#### save\_paths

```python
save_paths: List[str] = Field(
    default=["./tmp.mxq"],
    alias="savePaths",
    description="Output MXQ filename/paths",
)
```

#### use\_random\_calib

```python
use_random_calib: bool = Field(
    default=False, alias="useRandomCalib", description="Use random calibration"
)
```

#### inference\_scheme

```python
inference_scheme: str = Field(
    default="single", alias="inferenceScheme", description="NPU inference scheme"
)
```

#### cpu\_offload

```python
cpu_offload: bool = Field(
    default=False,
    alias="cpuOffload",
    description="Enable CPU offload for unsupported operators",
)
```

#### force\_npu\_input\_reposition

```python
force_npu_input_reposition: bool = Field(
    default=False,
    alias="forceNpuInputReposition",
    description="Force input reposition operations to run on NPU instead of CPU",
)
```

#### force\_npu\_output\_reposition

```python
force_npu_output_reposition: bool = Field(
    default=False,
    alias="forceNpuOutputReposition",
    description="Force output reposition operations to run on NPU instead of CPU",
)
```

#### optimize\_option

```python
optimize_option: int = Field(
    default=1,
    alias="optimizeOption",
    description="Compiler optimization selector",
    ge=0,
)
```

#### buffer\_mode

```python
buffer_mode: int = Field(
    default=1, alias="bufferMode", description="Buffer serialization mode"
)
```

#### device

```python
device: str = Field(default="gpu", description="Device for computation")
```

#### dtype

```python
dtype: str = Field(default="float", description="Data type for computation")
```

#### debug

```python
debug: bool = Field(default=False, description="Enable debug mode")
```

#### trace

```python
trace: bool = Field(default=False, description="Enable trace mode")
```

#### image\_channels

```python
image_channels: int = Field(
    default=0,
    alias="imageChannels",
    description="Number of image channels (0 for auto-detect)",
)
```

#### config\_version

```python
config_version: str = Field(
    default="1.0.0", alias="configVersion", description="Config schema version"
)
```

#### split\_blocks

```python
split_blocks: List[int] = Field(
    default=[],
    alias="splitBlocks",
    description="Multi-MXQ split points by transformer block index",
)
```

#### split\_parts

```python
split_parts: int = Field(
    default=0,
    alias="splitParts",
    description="Evenly split transformer blocks into N MXQ parts",
)
```

#### uint8\_input

```python
uint8_input: Uint8InputConfig = Field(
    default_factory=Uint8InputConfig, alias="uint8Input"
)
```

#### preprocessing

```python
preprocessing: PreprocessingConfig = Field(default_factory=PreprocessingConfig)
```

#### resource\_management

```python
resource_management: ResourceManagementConfig = Field(
    default_factory=ResourceManagementConfig, alias="resourceManagement"
)
```

#### calibration

```python
calibration: CalibrationConfig = Field(default_factory=CalibrationConfig)
```

#### bit

```python
bit: BitConfig = Field(default_factory=BitConfig)
```

#### hessian\_quant

```python
hessian_quant: HessianQuantConfig = Field(
    default_factory=HessianQuantConfig, alias="hessianQuant"
)
```

#### bias\_correction

```python
bias_correction: BiasCorrectionConfig = Field(
    default_factory=BiasCorrectionConfig, alias="biasCorrection"
)
```

#### mod

```python
mod: ModConfig = Field(default_factory=ModConfig)
```

#### llm

```python
llm: LlmConfig = Field(default_factory=LlmConfig)
```

#### moe

```python
moe: MoeConfig = Field(default_factory=MoeConfig)
```

#### equivalent\_transformation

```python
equivalent_transformation: EquivalentTransformationConfig = Field(
    default_factory=EquivalentTransformationConfig, alias="equivalentTransformation"
)
```

#### search\_weight\_scale

```python
search_weight_scale: SearchWeightScaleConfig = Field(
    default_factory=SearchWeightScaleConfig, alias="searchWeightScale"
)
```

#### load\_scale

```python
load_scale: LoadScaleConfig = Field(
    default_factory=LoadScaleConfig, alias="loadScale"
)
```

#### runtime\_options

```python
runtime_options: RuntimeOptions = Field(
    default_factory=RuntimeOptions, alias="runtimeOptions"
)
```

#### save\_sample

```python
save_sample: SaveSampleConfig = Field(
    default_factory=SaveSampleConfig, alias="saveSample"
)
```

#### extra\_output

```python
extra_output: ExtraOutputConfig = Field(
    default_factory=ExtraOutputConfig, alias="extraOutput"
)
```

#### group\_wise

```python
group_wise: GroupWiseConfig = Field(
    default_factory=GroupWiseConfig, alias="groupWise"
)
```

### Methods

| Name | Description |
| --- | --- |
| [`with_uint8_input`](<#compileconfig-with-uint8-input>) | Return a copy with uint8\_input settings enabled. |
| [`with_preprocessing`](<#compileconfig-with-preprocessing>) | Return a copy with preprocessing settings enabled. |
| [`with_hessian_quant`](<#compileconfig-with-hessian-quant>) | Return a copy with hessian\_quant settings enabled. |
| [`with_bias_correction`](<#compileconfig-with-bias-correction>) | Return a copy with bias\_correction settings enabled. |
| [`with_mod`](<#compileconfig-with-mod>) | Return a copy with mod settings enabled. |
| [`with_llm`](<#compileconfig-with-llm>) | Return a copy with llm settings enabled. |
| [`with_search_weight_scale`](<#compileconfig-with-search-weight-scale>) | Return a copy with search\_weight\_scale settings enabled. |
| [`with_load_scale`](<#compileconfig-with-load-scale>) | Return a copy with load\_scale settings enabled. |
| [`with_save_sample`](<#compileconfig-with-save-sample>) | Return a copy with save\_sample settings enabled. |
| [`with_extra_output`](<#compileconfig-with-extra-output>) | Return a copy with extra\_output settings enabled. |
| [`with_group_wise`](<#compileconfig-with-group-wise>) | Return a copy with group\_wise settings enabled. |
| [`from_file`](<#compileconfig-from-file>) | Load config from YAML or JSON file. |
| [`from_preset`](<#compileconfig-from-preset>) | Load config from a preset. |
| [`to_file`](<#compileconfig-to-file>) | Save config to YAML or JSON file. |

#### with\_uint8\_input

```python
def with_uint8_input(self, **kwargs) -> "CompileConfig"
```

Return a copy with uint8\_input settings enabled.

#### with\_preprocessing

```python
def with_preprocessing(self, **kwargs) -> "CompileConfig"
```

Return a copy with preprocessing settings enabled.

#### with\_hessian\_quant

```python
def with_hessian_quant(self, **kwargs) -> "CompileConfig"
```

Return a copy with hessian\_quant settings enabled.

#### with\_bias\_correction

```python
def with_bias_correction(self, **kwargs) -> "CompileConfig"
```

Return a copy with bias\_correction settings enabled.

#### with\_mod

```python
def with_mod(self, **kwargs) -> "CompileConfig"
```

Return a copy with mod settings enabled.

#### with\_llm

```python
def with_llm(self, **kwargs) -> "CompileConfig"
```

Return a copy with llm settings enabled.

#### with\_search\_weight\_scale

```python
def with_search_weight_scale(self, **kwargs) -> "CompileConfig"
```

Return a copy with search\_weight\_scale settings enabled.

#### with\_load\_scale

```python
def with_load_scale(self, **kwargs) -> "CompileConfig"
```

Return a copy with load\_scale settings enabled.

#### with\_save\_sample

```python
def with_save_sample(self, **kwargs) -> "CompileConfig"
```

Return a copy with save\_sample settings enabled.

#### with\_extra\_output

```python
def with_extra_output(self, **kwargs) -> "CompileConfig"
```

Return a copy with extra\_output settings enabled.

#### with\_group\_wise

```python
def with_group_wise(self, **kwargs) -> "CompileConfig"
```

Return a copy with group\_wise settings enabled.

#### from\_file

```python
def from_file(cls, path: Union[str, Path]) -> "CompileConfig"
```

Load config from YAML or JSON file.

#### from\_preset

```python
def from_preset(cls, name: str) -> "CompileConfig"
```

Load config from a preset.

#### to\_file

```python
def to_file(self, path: Union[str, Path]) -> None
```

Save config to YAML or JSON file.
