def add_model(parser: argparse.ArgumentParser, model: BaseConfigModel):
        """Adds fields from pydantic model to the parser."""
        for name, field in model.model_fields.items():
            field_type = field.annotation

            # Get information about number of arguments expected
            nargs = None
            if getattr(field.annotation, "_name", "") == "List":
                nargs = "+"
                field_type = field.annotation.__args__[0]

            # Add field to parser
            parser.add_argument(
                f"--{name}",
                dest=name,
                nargs=nargs,
                type=field_type,
                required=getattr(field, "required", False),
                default=getattr(field, "default", None),
                help=getattr(field, "description", ""),
            )
Adds fields from pydantic model to the parser.
benchmarks/inference/deepspeedometer/src/deepspeedometer/arg_parsing.py