def _get_model_meta(service, project, model='demo_model', version=None):
    """
    Helper function to gather the model meta information. Depending on
    the type of the model (default/other), we have to hit different
    service endpoints.

    Args:
        service: Google API Service object
        project: GCP project id (str)
        model: AI Platform model name (str, default: 'demo_model')
        version: AI Platform model version identifier (str, default: None)
    Returns:
        dictionary with the meta information
        model identifier (name)
    """
    url = f'projects/{project}/models/{model}'

    if version:
        url += f'/versions/{version}'
        response = service.projects().models().versions().get(name=url).execute()
        meta = response
    else:
        response = service.projects().models().get(name=url).execute()
        meta = response['defaultVersion']

    model_id = meta['name']
    return meta, model_id