def layer_architecture(model):
    """Get a Keras model config as a dictionary.

    Strip all info like layer names that are not essential to the definition of
    the model.

    Parameters
    ----------

    model : dict or keras.engine.training.Model
        A Keras model or a dict representing the config of the model (result of
        `model.get_config()`)

    Returns
    -------
    dict
        The model configuration dict stripped of useless details.
    """
    if isinstance(model, dict):
        layer_config = model['config']['layers']
    else:
        layer_config = model._updated_config()['config']['layers']
    for l in layer_config:
        l.pop('name', None)
        l.get('config', {}).pop('name', None)
    return layer_config