def extract_model_meta(base_meta: dict, extra_meta: dict, model_url: str) -> dict:
    """
    Merge the metadata from the backend and the extra metadata into a dict which is suitable for \
    `index.json`.

    :param base_meta: tree["meta"] :class:`dict` containing data from the backend.
    :param extra_meta: dict containing data from the user, similar to `template_meta.json`.
    :param model_url: public URL of the model.
    :return: converted dict.
    """
    meta = {"default": {"default": base_meta["uuid"],
                        "description": base_meta["description"],
                        "code": extra_meta["code"]}}
    del base_meta["model"]
    del base_meta["uuid"]
    meta["model"] = base_meta
    meta["model"].update({k: extra_meta[k] for k in ("code", "datasets", "references", "tags",
                                                     "extra")})
    response = requests.get(model_url, stream=True)
    meta["model"]["size"] = humanize.naturalsize(int(response.headers["content-length"]))
    meta["model"]["url"] = model_url
    meta["model"]["created_at"] = format_datetime(meta["model"]["created_at"])
    return meta
Merge the metadata from the backend and the extra metadata into a dict which is suitable for \
    `index.json`.

    :param base_meta: tree["meta"] :class:`dict` containing data from the backend.
    :param extra_meta: dict containing data from the user, similar to `template_meta.json`.
    :param model_url: public URL of the model.
    :return: converted dict.