skillfed

torch-model-archiver

Torch Model Archiver is used for creating archives of trained neural net models that can be consumed by TorchServe inference

torch-model-archiver v0.12.0 103.5K downloads/30d#12,803 on PyPI4,347
Permissive license Apache License Version 2.0 Abandoned released

What it is and what it does

Torch Model Archiver is a command-line tool that packages trained PyTorch neural network models into .mar (model archive) files suitable for inference serving with TorchServe. It bundles the model weights, architecture, and a handler script into a single deployable artifact that TorchServe can load and use to serve predictions. The tool is part of the TorchServe ecosystem but can be installed standalone.

The package has low install friction—it depends only on enum-compat—and is distributed as a pure Python wheel. However, the underlying repository is archived and marked as abandoned, meaning no active development or maintenance is occurring. The last release was in September 2024, and while no known vulnerabilities are recorded, the lack of ongoing maintenance may be a concern for long-term production use or compatibility with future PyTorch versions.

Use it for:

  • Package a trained PyTorch model into a .mar file for deployment on a TorchServe inference server.
  • Automate model archiving in a CI/CD pipeline to prepare models for production serving.
  • Bundle custom inference handlers with model weights for standardized deployment across teams.
  • Create reproducible model archives for sharing trained models with consistent serving configuration.
  • Prepare models for containerized inference services that consume TorchServe-compatible archives.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Torch Model Archiver creates .mar archive files from trained neural network models for deployment with TorchServe inference serving.

Yes, if you are already using TorchServe and need to package models for serving—it is the standard tool for that task and has low install friction. However, approach with caution for new projects: the repository is archived and maintenance is abandoned, so security patches and compatibility updates with future PyTorch versions are unlikely. Evaluate whether TorchServe itself remains actively maintained and suitable for your deployment strategy.

Install

torch-model-archiver on PyPI

pip

pip install torch-model-archiver

uv

uv add torch-model-archiver

poetry

poetry add torch-model-archiver

Installing torch-model-archiver

Before you install

Low install friction with a single lightweight runtime dependency. However, the repository is archived and maintenance is abandoned as of the latest release on 2024-09-30, with no commits since 2025-08-06.

License in practice

Apache License Version 2.0 is permissive, allowing commercial use, modification, and distribution with minimal restrictions—suitable for most projects.

Quickstart

pip install torch-model-archiver

from torch_model_archiver.model_packaging import package_model

package_model(model_name, model_path, handler, export_path)

Requires PyTorch and a trained model file; TorchServe is needed to serve the resulting .mar archive.

Verify before relying

  • Whether the archived repository will receive security patches or bug fixes if issues are discovered.
  • Compatibility with recent PyTorch and TorchServe versions given the abandoned maintenance status.
  • Whether enum-compat dependency has known issues or is actively maintained.

Package facts

License Apache License Version 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — enum-compat
Maintenance abandoned — 683 days since the last release
Last repo commit (repository archived)
First released
Downloads 103,470/month — #12,803 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: torch_model_archiver-0.12.0-py3-none-any.whl

Keywords: TorchServe, Torch, Model, Archive, Archiver, Server, Serving, Deep, Learning, Inference, AI

Tags

torch model archivercreate mar files pytorchtorchserve model packagingneural network model archivepytorch model deploymenttorchserve model preparationdeep learning model serving
model-servingpytorch-ecosystemarchived

More Artificial Intelligence packages