TorchServe is a flexible and easy-to-use tool for serving PyTorch models for inference at scale. Current version 0.12.0, released as part of the PyTorch ecosystem, with releases roughly quarterly.
pip install torchserve torch-model-archiverVerified import paths — ran on the pinned version, not inferred.
Basic workflow: archive a model, start TorchServe, and make a prediction.
Use `--sync` flag or set `sync: true` in config.properties.
Install both packages: pip install torchserve torch-model-archiver
Implement a handler class inheriting from `torchserve.base_handler.BaseHandler`.
Use `torch-model-archiver my_model --version 1.0 --model-file model.py ...` instead of `--model-name my_model`.