```python:inference/models/qwen3vl/qwen3vl_inference_models.py
from inference.core.env import (
    ALLOW_INFERENCE_MODELS_DIRECTLY_ACCESS_LOCAL_PACKAGES,
    ALLOW_INFERENCE_MODELS_UNTRUSTED_PACKAGES, API_KEY,
    DISABLED_INFERENCE_MODELS_BACKENDS, VALID_INFERENCE_MODELS_BACKENDS)
from inference.core.models.base import Model
from inference.core.roboflow_api import get_extra_weights_provider_headers
from inference_models import AutoModel, PreProcessingOverrides
from inference_models.models.qwen3vl.qwen3vl_hf import Qwen3VLHF

# Cache for common PreProcessingOverrides instances
_PREPROCESSING_OVERRIDES_CACHE = {}

def _get_cached_preprocessing_overrides(disable_contrast: bool, disable_grayscale: bool, disable_static_crop: bool) -> PreProcessingOverrides:
    """Get or create a cached PreProcessingOverrides instance."""
    cache_key = (disable_contrast, disable_grayscale, disable_static_crop)
    if cache_key not in _PREPROCESSING_OVERRIDES_CACHE:
        _PREPROCESSING_OVERRIDES_CACHE[cache_key] = PreProcessingOverrides(
            disable_contrast_enhancement=disable_contrast,
            disable_grayscale=disable_grayscale,
            disable_static_crop=disable_static_crop,
        )
    return _PREPROCESSING_OVERRIDES_CACHE[cache_key]

class InferenceModelsQwen3VLAdapter(Model):
    def __init__(self, model_id: str, api_key: str = None, **kwargs):
        super().__init__()

        self.metrics = {"num_inferences": 0, "avg_inference_time": 0.0}

        self.api_key = api_key if api_key else API_KEY

        self.task_type = "lmm"

        extra_weights_provider_headers = get_extra_weights_provider_headers(
            countinference=kwargs.get("countinference"),
            service_secret=kwargs.get("service_secret"),
        )
        backend = list(
            VALID_INFERENCE_MODELS_BACKENDS.difference(
                DISABLED_INFERENCE_MODELS_BACKENDS
            )
        )
        self._model: Qwen3VLHF = AutoModel.from_pretrained(
            model_id_or_path=model_id,
            api_key=self.api_key,
            allow_untrusted_packages=ALLOW_INFERENCE_MODELS_UNTRUSTED_PACKAGES,
            allow_direct_local_storage_loading=ALLOW_INFERENCE_MODELS_DIRECTLY_ACCESS_LOCAL_PACKAGES,
            weights_provider_extra_headers=extra_weights_provider_headers,
            backend=backend,
            **kwargs,
        )

    def map_inference_kwargs(self, kwargs: dict) -> dict:
        pre_processing_overrides = _get_cached_preprocessing_overrides(
            kwargs.get("disable_preproc_contrast", False),
            kwargs.get("disable_preproc_grayscale", False),
            kwargs.get("disable_preproc_static_crop", False),
        )
        kwargs["pre_processing_overrides"] = pre_processing_overrides
        return kwargs
```