def pull(
    ctx: click.Context,
    model_tag: str | None,
    force: bool,
    bentofile: str | None,
    cloud_client: BentoCloudClient = Provide[BentoMLContainer.bentocloud_client],
):
    """Pull Model from a remote model store. If model_tag is not provided,
    it will pull models defined in bentofile.yaml.
    """
    from click.core import ParameterSource

    if model_tag is not None:
        if ctx.get_parameter_source("bentofile") != ParameterSource.DEFAULT:
            rich.print("-f bentofile is ignored when model_tag is provided")
        cloud_client.model.pull(model_tag, force=force)
        return

    if bentofile:
        try:
            bentofile = resolve_user_filepath(bentofile, None)
        except FileNotFoundError:
            raise InvalidArgument(f'file "{bentofile}" not found')
        else:
            build_config = BentoBuildConfig.from_file(bentofile)
    else:
        for filename in DEFAULT_BENTO_BUILD_FILES:
            if os.path.exists(filename):
                build_config = BentoBuildConfig.from_file(filename)
                break
        else:
            raise InvalidArgument(
                "No bentofile.yaml or pyproject.toml found, please provide a bentofile path"
            )

    if not build_config.models:
        raise InvalidArgument(
            "No model to pull, please provide a model tag or define models in bentofile.yaml"
        )
    for model_spec in build_config.models:
        cloud_client.model.pull(
            model_spec.tag,
            force=force,
            query=model_spec.filter,
        )
Pull Model from a remote model store. If model_tag is not provided,
it will pull models defined in bentofile.yaml.
src/bentoml_cli/models.py