from typing import List
from typing import Dict


def ids_to_models(model_ids: List[str]) -> Dict[str, List[str]]:
    """
    Convert model IDs (MODEL_NAME-MODEL_VERSION) to a dictionary with its keys being
    the model names and its values being lists of the associated versions for each given model name.
    """

    models = {}
    for model_id in model_ids:
        model_name, model_version = model_id.rsplit("-", maxsplit=1)
        if model_name not in models:
            models[model_name] = [model_version]
        else:
            models[model_name].append(model_version)
    return models