# qbcompiler.configs.presets

Auto-generated preset definitions from config\_schema.yaml.

## Attributes

| Name | Description |
| --- | --- |
| [`PRESETS`](<#presets>) |  |

### PRESETS

```python
PRESETS: Dict[str, dict] = {
    "classification": {
        "description": "Image classification models (ResNet, EfficientNet, ViT, etc.)",
        "config": {"calibration": {"mode": 1, "output": 0}},
    },
    "detection": {
        "description": "Object detection models (YOLO, SSD, DETR, etc.)",
        "config": {"calibration": {"mode": 1, "output": 1}},
    },
    "classification_torchvision": {
        "description": "Torchvision classification models with standard preprocessing",
        "extends": "classification",
        "config": {
            "uint8Input": {"apply": True, "inputs": []},
            "imageChannels": 3,
            "preprocessing": {
                "apply": True,
                "autoConvertFormat": True,
                "pipeline": [
                    {"op": "resize", "size": 256, "mode": "bilinear", "backend": "pil"},
                    {"op": "centerCrop", "height": 224, "width": 224},
                    {
                        "op": "normalize",
                        "mean": [0.485, 0.456, 0.406],
                        "std": [0.229, 0.224, 0.225],
                        "scaleToUint8": True,
                        "fuseIntoFirstLayer": True,
                    },
                ],
                "inputConfigs": {},
            },
        },
    },
    "yolo_640": {
        "description": "YOLO detection models with 640x640 letterbox preprocessing",
        "extends": "detection",
        "config": {
            "uint8Input": {"apply": True, "inputs": []},
            "imageChannels": 3,
            "preprocessing": {
                "apply": True,
                "autoConvertFormat": True,
                "pipeline": [
                    {
                        "op": "letterbox",
                        "height": 640,
                        "width": 640,
                        "padValue": 114,
                        "backend": "opencv",
                    }
                ],
                "inputConfigs": {},
            },
        },
    },
    "yolo_1280": {
        "description": "YOLO detection models with 1280x1280 letterbox preprocessing",
        "extends": "detection",
        "config": {
            "uint8Input": {"apply": True, "inputs": []},
            "imageChannels": 3,
            "preprocessing": {
                "apply": True,
                "autoConvertFormat": True,
                "pipeline": [
                    {
                        "op": "letterbox",
                        "height": 1280,
                        "width": 1280,
                        "padValue": 114,
                        "backend": "opencv",
                    }
                ],
                "inputConfigs": {},
            },
        },
    },
    "llm": {
        "description": "Large Language Models (LLaMA, Qwen, Gemma, etc.)",
        "config": {
            "equivalentTransformation": {
                "QK": {"apply": True},
                "UD": {"apply": True},
                "VO": {"apply": True},
                "SpinR1": {"apply": True},
                "SpinR2": {"apply": True},
                "OptimizeFFN": {"apply": True},
            },
            "llm": {
                "apply": True,
                "attributes": {
                    "maxSequenceLength": 4096,
                    "maxCacheLength": 4096,
                    "calibration": {"useFullSeqLength": True},
                },
            },
            "calibration": {"mode": 0, "output": 0},
        },
    },
    "llm_fast": {
        "description": "LLM with faster compilation (less accuracy optimization)",
        "extends": "llm",
        "config": {
            "equivalentTransformation": {
                "QK": {"apply": False},
                "UD": {"apply": False},
                "VO": {"apply": False},
                "SpinR1": {"apply": False},
                "SpinR2": {"apply": False},
                "OptimizeFFN": {"apply": False},
            },
            "llm": {
                "apply": True,
                "attributes": {"calibration": {"useFullSeqLength": False}},
            },
        },
    },
    "vision_transformer": {
        "description": "Vision Transformer models (ViT, DeiT, Swin, etc.)",
        "config": {
            "calibration": {"method": 1, "mode": 0},
            "bit": {"transformer": {"activation": {"output": 16, "ffn": 16}}},
        },
    },
    "multimodal": {
        "description": "Multimodal models (CLIP, BLIP, LLaVA, etc.)",
        "config": {"calibration": {"method": 3}, "llm": {"apply": True}},
    },
}
```

## Preset

```python
class Preset
```

[Preset](<https://docs.mobilint.com/compiler/en/v1.4/api/python/qbcompiler.configs.presets/#preset>) utility class.

### Methods

| Name | Description |
| --- | --- |
| [`list`](<#preset-list>) | List available preset names. |
| [`get`](<#preset-get>) | Get a preset by name. |
| [`describe`](<#preset-describe>) | Get preset description. |

#### list

```python
def list() -> List[str]
```

List available preset names.

#### get

```python
def get(name: str) -> CompileConfig
```

Get a preset by name.

#### describe

```python
def describe(name: str) -> str
```

Get preset description.

## Functions

| Name | Description |
| --- | --- |
| [`list_presets`](<#list-presets>) | List available preset names. |
| [`get_preset`](<#get-preset>) | Get a [CompileConfig](<https://docs.mobilint.com/compiler/en/v1.4/api/python/qbcompiler.configs.models/#compileconfig>) from a preset name. |

### list\_presets

```python
def list_presets() -> List[str]
```

List available preset names.

### get\_preset

```python
def get_preset(name: str) -> CompileConfig
```

Get a [CompileConfig](<https://docs.mobilint.com/compiler/en/v1.4/api/python/qbcompiler.configs.models/#compileconfig>) from a preset name.
