ml-model-export

Export trained PyTorch models to ONNX, TorchScript, and TensorRT formats.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill ml-model-export
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ml-model-export
Source: https://github.com/nishide-dev/claude-code-ml-research/tree/main/skills/ml-model-export
Command: npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill ml-model-export

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teams need a reliable way to turn a trained PyTorch model into deployment-ready artifacts without manually re-implementing conversion pipelines for every target runtime.

Core Features & Use Cases

  • ONNX export with validation and optimization: Convert to ONNX for cross-platform inference and optimize the graph for faster runtime execution.
  • TorchScript export for production/mobile: Produce TorchScript via tracing or scripting to run without Python, including mobile deployment.
  • TensorRT conversion for NVIDIA acceleration: Convert an ONNX model into a TensorRT engine with selectable precision (FP32/FP16/INT8).
  • Registry publishing workflows: Upload exported artifacts to Hugging Face Hub and optionally log/register with MLflow for traceable model management.

Quick Start

Tell your AI to export your Lightning checkpoint into ONNX, TorchScript, and then upload the chosen artifact to Hugging Face Hub for deployment.

Frequently Asked Questions about ml-model-export

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

FAQPage Schema
How do I convert a PyTorch model to ONNX for production deployment?

To convert a PyTorch model to ONNX, you export the trained model while specifying dynamic axes for flexible input sizes. This process generates a cross-platform inference graph that can be validated and optimized for faster runtime execution.

What's the best way to prepare a PyTorch model for mobile or non-Python environments?

Exporting PyTorch models to TorchScript via tracing or scripting prepares them for mobile or non-Python environments. This packaging method produces a deployable artifact that runs independently of Python, ensuring cross-platform compatibility.

Can I build a TensorRT engine from an ONNX model with FP16 or INT8 precision?

Yes, you can convert an ONNX model into a TensorRT engine with selectable precision including FP32, FP16, or INT8. This conversion builds an optimized engine specifically for NVIDIA hardware acceleration during downstream inference.

How do I upload exported model artifacts to Hugging Face Hub or MLflow?

You can upload exported model artifacts to Hugging Face Hub and optionally log them with MLflow. This registry publishing workflow manages and shares the deployment-ready formats, ensuring traceable model management across runtimes.

Why do I need to specify dynamic axes when exporting PyTorch models to ONNX?

Specifying dynamic axes during ONNX export allows the resulting graph to accept variable input dimensions like batch or sequence length. This satisfies format-specific conversion requirements, ensuring the model handles flexible input shapes during cross-platform inference.