Problem Description
Currently, modelinfo prints rich terminal UI tables. Other scripts or CI/CD pipelines might want to consume the exact VRAM calculations and model parameters programmatically.
Proposed Solution
- Add a
--json boolean flag to the argparse configuration in src/modelinfo/cli.py.
- Before calling
print_model_info or print_compare_info, check if args.json is True.
- If it is, bypass the
rich UI rendering entirely and print the raw metadata and footprint calculation dictionaries to stdout using json.dumps(..., indent=2).
Alternatives Considered
None.
Additional Context
It touches the very end of cli.py and standard argparse functionality. It is completely isolated from the mathematical engines and binary parsers, making it an excellent first issue.
Problem Description
Currently,
modelinfoprintsrichterminal UI tables. Other scripts or CI/CD pipelines might want to consume the exact VRAM calculations and model parameters programmatically.Proposed Solution
--jsonboolean flag to theargparseconfiguration insrc/modelinfo/cli.py.print_model_infoorprint_compare_info, check ifargs.jsonisTrue.richUI rendering entirely and print the rawmetadataand footprint calculation dictionaries tostdoutusingjson.dumps(..., indent=2).Alternatives Considered
None.
Additional Context
It touches the very end of
cli.pyand standardargparsefunctionality. It is completely isolated from the mathematical engines and binary parsers, making it an excellent first issue.