def save_overrides(pipette_id: str,
                   overrides: TypeOverrides,
                   model: PipetteModel):
    """
    Save overrides for the pipette.

    :param pipette_id: The pipette id
    :param overrides: The incoming values
    :param model: The model of pipette
    :return: None
    """
    override_dir = config.CONFIG['pipette_config_overrides_dir']
    model_configs = configs[model]
    model_configs_quirks = {key: True for key in model_configs['quirks']}
    try:
        existing = load_overrides(pipette_id)
        # Add quirks setting for pipettes already with a pipette id file
        if 'quirks' not in existing.keys():
            existing['quirks'] = model_configs_quirks
    except FileNotFoundError:
        existing = model_configs_quirks  # type: ignore

    for key, value in overrides.items():
        # If an existing override is saved as null from endpoint, remove from
        # overrides file
        if value is None:
            if existing.get(key):
                del existing[key]
        elif isinstance(value, bool):
            existing, model_configs = change_quirks(
                {key: value}, existing, model_configs)
        else:
            # type ignores are here because mypy needs typed dict accesses to
            # be string literals sadly enough
            model_config_value = model_configs[key]  # type: ignore
            if not model_config_value.get('default'):
                model_config_value['default']\
                    = model_config_value['value']
            model_config_value['value'] = value
            existing[key] = model_config_value
    assert model in config_models
    existing['model'] = model
    json.dump(existing, (override_dir/f'{pipette_id}.json').open('w'))