def _verify_optimization_hint_input(optimization_hint_input: _Optional[dict] = None) -> None:
    """
    Throws an exception if ``optimization_hint_input`` is not valid.
    """
    if optimization_hint_input is None:
        return
    if not isinstance(optimization_hint_input, dict):
        raise TypeError('"optimization_hint_input" must be a dictionary or None')

    if optimization_hint_input != {} and _macos_version() < (15, 0):
        raise ValueError('Optimization hints are only available on macOS >= 15.0')

    for k in optimization_hint_input.keys():
        if k not in ('allowLowPrecisionAccumulationOnGPU', 'reshapeFrequency', 'specializationStrategy'):
            raise ValueError(f"Unrecognized key in optimization_hint dictionary: {k}")

    if "allowLowPrecisionAccumulationOnGPU" in optimization_hint_input and not isinstance(optimization_hint_input["allowLowPrecisionAccumulationOnGPU"], bool):
        raise TypeError('"allowLowPrecisionAccumulationOnGPU" value of "optimization_hint_input" dictionary must be of type bool')

    if "specializationStrategy" in optimization_hint_input and not isinstance(optimization_hint_input["specializationStrategy"], _SpecializationStrategy):
        raise TypeError('"specializationStrategy" value of "optimization_hint_input" dictionary must be of type coremltools.SpecializationStrategy')

    if "reshapeFrequency" in optimization_hint_input and not isinstance(optimization_hint_input["reshapeFrequency"], _ReshapeFrequency):
        raise TypeError('"reshapeFrequency" value of "optimization_hint_input" dictionary must be of type coremltools.ReshapeFrequency')

    Throws an exception if ``optimization_hint_input`` is not valid.
    
coremltools/models/model.py