Skip to content

Update model package cli to match latest schema#2445

Open
xiaoyu-work wants to merge 2 commits intomainfrom
xiaoyu/model-pkg
Open

Update model package cli to match latest schema#2445
xiaoyu-work wants to merge 2 commits intomainfrom
xiaoyu/model-pkg

Conversation

@xiaoyu-work
Copy link
Copy Markdown
Collaborator

Describe your changes

Update model package cli to match latest schema

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

Copilot AI review requested due to automatic review settings May 6, 2026 23:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates olive generate-model-package to emit an ORT model-package “proposal-shaped” directory layout and schema, and expands test coverage to validate the new manifest/metadata/variant format and external-data handling.

Changes:

  • Reworked CLI packaging to generate manifest.json with schema_version/components, and per-component metadata.json + per-variant variant.json under top-level component directories (no models/ wrapper).
  • Added a write_model_package writer with validation, configs/ copying, and optional cross-variant external-data dedup into shared_weights/.
  • Greatly expanded CLI+writer tests (single-source allowed, composite inference precedence, compatibility parsing, dedup behavior, and safety checks).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
olive/cli/model_package.py Refactors the CLI to build VariantSpecs and writes a proposal-shaped model package (manifest/metadata/variant.json), including external-data discovery and optional dedup.
test/cli/test_model_package.py Replaces/extends tests to validate the new schema/layout, helper behavior, composite inference precedence, and external-data dedup + safety.

Comment thread olive/cli/model_package.py Outdated
Comment thread olive/cli/model_package.py
Comment thread olive/cli/model_package.py
Comment thread olive/cli/model_package.py
Comment thread olive/cli/model_package.py
@xiaoyu-work xiaoyu-work requested a review from shaahji May 7, 2026 20:12
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