nvalchemi-model-wrapping

Wrap PyTorch MLIPs with BaseModelMixin to standardize inputs, outputs, and embeddings.

127|32|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/NVIDIA/nvalchemi-toolkit --skill nvalchemi-model-wrapping
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nvalchemi-model-wrapping
Source: https://github.com/NVIDIA/nvalchemi-toolkit/tree/main/.claude/skills/nvalchemi-model-wrapping
Command: npx skills add https://github.com/NVIDIA/nvalchemi-toolkit --skill nvalchemi-model-wrapping

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This approach lets you wrap any MLIP with the BaseModelMixin to standardize how models receive inputs, generate outputs, and produce embeddings within nvalchemi.

Core Features & Use Cases

  • Standardized input/output interface via BaseModelMixin for arbitrary MLIPs.
  • Clear embedding extraction and graph-level representations, plus export options for integration with external tools.
  • Supports single AtomicData or Batch workflows and configurable runtime behavior through ModelCard/ModelConfig.
  • Use case: wrap a PyTorch MLIP to produce energies and forces in a workflow, and easily export a compiled model for ASE calculators.

Quick Start

Create a wrapper by combining your PyTorch model with BaseModelMixin, implement adapt_input, adapt_output, and forward as demonstrated, then set model.model_config to enable desired computations.

Frequently Asked Questions about nvalchemi-model-wrapping

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize PyTorch MLIP inputs and outputs for energies and forces?

To standardize PyTorch MLIP inputs and outputs, wrap the model with BaseModelMixin to enforce a uniform interface for AtomicData or Batch inputs, enabling consistent energies, forces, and embedding computations.

What is the best way to wrap an arbitrary MLIP to extract graph-level embeddings?

The best way to wrap an arbitrary MLIP for embedding extraction is applying BaseModelMixin, which standardizes graph-level representations and outputs, allowing you to define embedding behavior through ModelConfig.

Can I use BaseModelMixin with Batch inputs for my PyTorch MLIP?

Yes, BaseModelMixin supports both single AtomicData and Batch inputs, allowing your PyTorch MLIP to process batched atomic configurations seamlessly within the nvalchemi workflow.

How do I export a compiled MLIP for ASE calculators after wrapping?

After wrapping your MLIP with BaseModelMixin, you can use the optional model export feature to generate a compiled model suitable for integration with external ASE calculators.

Do I need ModelConfig to define runtime behavior for a wrapped MLIP?

Yes, you need to set model.model_config using a ModelCard or ModelConfig to define capabilities and configure the desired runtime computations for your wrapped MLIP.