def log_eval_analytics(
    mosaicml_logger: MosaicMLLogger,
    model_configs: list[dict[str, Any]],
    icl_tasks: Union[str, list[dict[str, Any]]],
    eval_gauntlet_config: Optional[Union[str, dict[str, Any]]],
):
    """Logs analytics for runs using the `eval.py` script."""
    metrics: dict[str, Any] = {
        'llmfoundry/script': 'eval',
    }

    metrics['llmfoundry/gauntlet_configured'] = eval_gauntlet_config is not None
    metrics['llmfoundry/icl_configured'] = isinstance(
        icl_tasks,
        str,
    ) or len(icl_tasks) > 0

    metrics['llmfoundry/model_configs'] = []
    for model_config in model_configs:
        nested_model_config = model_config.get('model', {})
        model_config_data = {}
        for key in _MODEL_KEYS_TO_LOG:
            if nested_model_config.get(key, None) is not None:
                model_config_data[key] = nested_model_config.get(key)

        if len(model_config_data) > 0:
            metrics['llmfoundry/model_configs'].append(
                json.dumps(model_config_data, sort_keys=True),
            )

    mosaicml_logger.log_metrics(metrics)
    mosaicml_logger._flush_metadata(force_flush=True)
Logs analytics for runs using the `eval.py` script.
llmfoundry/utils/mosaicml_logger_utils.py