torch-model-archiver
Torch Model Archiver is used for creating archives of trained neural net models that can be consumed by TorchServe inference
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-archiveruv
uv add torch-model-archiverpoetry
poetry add torch-model-archiverInstalling 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
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
model-archiverModel Archiver creates `.mar` archive files…
permissive · top 15,000 on PyPI
multi-model-serverMulti Model Server is a tool for serving deep…
permissive · top 15,000 on PyPI
rotary-embedding-torchImplements rotary positional embeddings for…
permissive · top 15,000 on PyPI
pte-adapter-model-explorerExtends Model Explorer with visualization…
permissive · top 15,000 on PyPI
ema-pytorchMaintains an exponential moving average (EMA)…
permissive · top 15,000 on PyPI
segmentation-models-pytorchProvides PyTorch-based neural network models…
permissive · top 15,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
pytorchThis package is a redirect or placeholder; the…
unclear · top 15,000 on PyPI
pytorchcvProvides a collection of pretrained computer…
unclear · top 15,000 on PyPI
tlparsetlparse parses structured PyTorch torch.compile…
permissive · top 15,000 on PyPI