def list_models(
    model_name: str,
    output: str,
    model_store: ModelStore = Provide[BentoMLContainer.model_store],
) -> None:  # type: ignore (not accessed)
    """List Models in local store

    \b
    # show all models saved
    $ bentoml models list

    \b
    # show all versions of bento with the name FraudDetector
    $ bentoml models list FraudDetector
    """

    models = model_store.list(model_name)
    res = [
        {
            "tag": str(model.tag),
            "module": model.info.module,
            "size": human_readable_size(calc_dir_size(model.path)),
            "creation_time": model.info.creation_time.astimezone().strftime(
                "%Y-%m-%d %H:%M:%S"
            ),
        }
        for model in sorted(models, key=lambda x: x.info.creation_time, reverse=True)
    ]
    if output == "json":
        info = json.dumps(res, indent=2)
        rich.print_json(info)
    elif output == "yaml":
        info = yaml.safe_dump(res, indent=2)
        rich.print(Syntax(info, "yaml"))
    else:
        table = Table(box=None)
        table.add_column("Tag")
        table.add_column("Module")
        table.add_column("Size")
        table.add_column("Creation Time")
        for model in res:
            table.add_row(
                model["tag"],
                model["module"],
                model["size"],
                model["creation_time"],
            )
        rich.print(table)
List Models in local store

\b
# show all models saved
$ bentoml models list

\b
# show all versions of bento with the name FraudDetector
$ bentoml models list FraudDetector
src/bentoml_cli/models.py