Skip to content

ONNX-style producer fields, rename producers to packages (wire format v3) - #58

Merged
Gnpd merged 9 commits into
mainfrom
fix-format-3
Sep 22, 2026
Merged

Gnpd merged 9 commits into
mainfrom
fix-format-3

Conversation

@Gnpd

@Gnpd Gnpd commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bumps the wire format to v3: metadata.producer_name/producer_version now follow ONNX semantics and name the tool that wrote the file ("openmodels" + its release version, or a third-party writer's own name/version) instead of conflating the outermost model's package with scikit-learn's version.
  • scikit-learn's version moves to a new metadata.domain_version field, which the deserialize-time version check now reads (falling back to producer_version only for v1/v2 files, since that's the only shape where it ever held the sklearn version).
  • metadata.producers is renamed metadata.packages and now always includes sklearn, even when no estimator in the tree is scikit-learn's own class. v2 files' producers key is still read for backward compatibility.
  • Deserialize now also warns (never fails) on a version mismatch for any non-sklearn package listed in packages.
    • metadata.dependency_versions gains python (platform.python_version()).
    • Drops metadata.openmodels_version (v3 only) - producer_version with producer_name: "openmodels" records the same release, and the old field was never read on deserialize.
    • docs/format.md updated: field table, worked examples, a new "Files written by other tools" section, and format history entry for v3.
    • Releases as 0.2.2 (CHANGELOG + pyproject.toml).

Why

The old producer_version/producer_name pair mixed two unrelated things - which package wrote the model class, and what scikit-learn version its attribute layout matches - into one field. That broke down for a third-party root estimator (mismatched values) and gave a non-Python writer (e.g. an R exporter) nothing honest to put in producer_name. Splitting "who wrote this file" (producer_*) from "what environment it targets" (domain_version, packages) follows ONNX's convention and makes both openmodels-written and externally-written files self-describing.

@Gnpd
Gnpd merged commit 22b035e into main Sep 22, 2026
6 checks passed
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.

1 participant