Skip to content

feat: add model card packaging#180

Merged
marcellodebernardi merged 3 commits into
mainfrom
codex/model-card-packaging
Feb 27, 2026
Merged

feat: add model card packaging#180
marcellodebernardi merged 3 commits into
mainfrom
codex/model-card-packaging

Conversation

@marcellodebernardi

Copy link
Copy Markdown
Contributor

This PR adds automatic model card generation during packaging, producing a MODEL_CARD.md artifact with summary, dataset details, feature usage, evaluation highlights, hyperparameters, limitations, and reproducibility metadata. The aim is to make packaged models self-documenting and easier to review and deploy. It also adds unit tests covering both full-context and minimal-context generation flows.

Testing

  • poetry run pytest tests/unit/workflow/test_model_card.py
  • poetry run pytest tests/unit/test_imports.py

Copilot AI review requested due to automatic review settings February 27, 2026 15:00
@greptile-apps

greptile-apps Bot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds automatic model card generation during the packaging phase, producing a comprehensive MODEL_CARD.md artifact with model metadata, dataset details, feature usage, performance metrics, and reproducibility information.

Key changes:

  • Implemented generate_model_card() function with robust error handling, fallbacks for missing data, and support for various input formats
  • Integrated model card generation into the packaging workflow (Phase 6) to retrieve evaluation report from context.scratch and write MODEL_CARD.md
  • Added comprehensive unit tests covering both full-context and minimal-context generation flows
  • Version bumped to 1.3.3

Code quality:

  • Defensive programming with comprehensive None checking and exception handling for file I/O
  • Proper use of yaml.safe_load() for security
  • Type hints throughout
  • Clean integration following existing workflow patterns

Confidence Score: 5/5

  • This PR is safe to merge with no critical issues
  • The implementation is well-designed with comprehensive error handling, proper security practices, and thorough test coverage. No logical errors, security vulnerabilities, or critical bugs were found. The code follows defensive programming principles with fallbacks for missing data and uses safe YAML loading. Integration into the existing workflow is clean and follows established patterns.
  • No files require special attention

Important Files Changed

Filename Overview
plexe/templates/packaging/model_card_template.py added comprehensive model card generator with robust error handling and fallbacks
plexe/workflow.py integrated model card generation into packaging phase with proper data flow
tests/unit/workflow/test_model_card.py added comprehensive tests covering full-context and minimal-context scenarios

Last reviewed commit: 7109c9a

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread plexe/templates/packaging/model_card_template.py
@marcellodebernardi

Copy link
Copy Markdown
Contributor Author

@greptileai review again with latest changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces automatic generation of a MODEL_CARD.md artifact during the model packaging workflow, aiming to make packaged models self-documenting and easier to review/deploy.

Changes:

  • Add a model card generator that composes Markdown from packaged artifacts (model.yaml, input schema, hyperparameters) plus optional evaluation outputs.
  • Integrate model card generation into package_final_model() so MODEL_CARD.md is written into the packaged model directory.
  • Add unit tests covering full-context vs minimal-context model card generation paths, and update test/code index docs.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
plexe/workflow.py Calls the model card generator during packaging and writes MODEL_CARD.md into the package.
plexe/templates/packaging/model_card_template.py Implements the Markdown model card generator and supporting helpers.
tests/unit/workflow/test_model_card.py Adds unit tests validating headers/sections and minimal fallback behavior.
tests/unit/workflow/__init__.py Adds workflow unit test package marker/docstring.
tests/CODE_INDEX.md Regenerates test code index to include new workflow test module.
plexe/CODE_INDEX.md Regenerates plexe code index to include the new packaging template module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plexe/templates/packaging/model_card_template.py
Comment thread plexe/templates/packaging/model_card_template.py
Comment thread plexe/templates/packaging/model_card_template.py Outdated
Comment thread plexe/templates/packaging/model_card_template.py Outdated
@marcellodebernardi

Copy link
Copy Markdown
Contributor Author

@greptileai please review again with latest changes

@marcellodebernardi marcellodebernardi force-pushed the codex/model-card-packaging branch from 0a876d4 to 513a048 Compare February 27, 2026 15:36
@marcellodebernardi

Copy link
Copy Markdown
Contributor Author

@greptileai review again with latest changes

@marcellodebernardi

Copy link
Copy Markdown
Contributor Author

@greptileai please review again with latest changes

@marcellodebernardi marcellodebernardi merged commit cc66625 into main Feb 27, 2026
13 checks passed
@marcellodebernardi marcellodebernardi deleted the codex/model-card-packaging branch February 27, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants