Skip to content

Allow Apeiron to use custom checkpoints - #126

Open
anagainaru wants to merge 2 commits into
AI-ModCon:mainfrom
anagainaru:checkpoint
Open

Allow Apeiron to use custom checkpoints#126
anagainaru wants to merge 2 commits into
AI-ModCon:mainfrom
anagainaru:checkpoint

Conversation

@anagainaru

@anagainaru anagainaru commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Model harnesses can define custom checkpoints. If the model requires metadata beyond weights (e.g., preprocessing scalers, feature names, architecture parameters). This PR introduces an optional build_checkpoint_payload() function that the model harness can overwrite (by default only weights are saved which is the current behavior of Apeiron).

def build_checkpoint_payload(self):
    """Save checkpoint with all metadata needed for loading."""
    return {
        "model_state_dict": self.model.state_dict(),
        "feature_names": self._feature_names,
        "scaler": self._scaler,
        "input_dim": self._input_dim,
    }

This will ensure that the checkpoints and the input model can have the same elements (i.e. the checkpoints can be used as input model for Apeiron using the same model harness used to create them)

Documentation

  • Docstrings updated
  • User docs / README updated

Testing

  • Testing on the AERIS model harness that requires a feature_list in addition to weights

Closes #125

@anagainaru
anagainaru requested a review from Zilinghan September 5, 2026 14:15
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.

Option of saving full model or only weights for checkpoints

1 participant