
TorchServe
PyTorch's official model serving framework with REST/gRPC, batching, and versioning.
About
TorchServe is the official open-source model serving framework for PyTorch, developed by AWS and Meta. Models are packaged into .mar archives with custom Python handlers for preprocessing and inference logic, then served over REST or gRPC with dynamic batching, multi-model serving, model versioning for A/B testing, Prometheus metrics, and worker auto-scaling. It is preinstalled in AWS PyTorch Deep Learning Containers and used under the hood by services like SageMaker and Vertex AI endpoints.
The honest caveats: the project is in limited maintenance mode — community guidance flags checking environment compatibility before adopting. It predates the LLM era, so serving large LLMs needs the vLLM-enabled path rather than the classic handler model. For modern LLM serving, dedicated engines like vLLM or TensorRT-LLM are usually better; TorchServe remains strongest for traditional PyTorch vision and tabular models.
What it can do
- REST and gRPC inference endpoints
- .mar model packaging with custom handlers
- Dynamic request batching
- Multi-model serving and versioning
- Prometheus metrics and logging
Setup
pip install torchserve torch-model-archiver, package your model as a .mar archive, then torchserve --start.
Prerequisites
Trained PyTorch model; Python environment matching the model.
Use cases
Works with
Trust score — 8/10
Scored 8/10 (verified tier, metrics-v1). Evidence: Verified via vendor site/docs/GitHub and reputable coverage, wave 85; Trending score 78/100 from researcher assessment.
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.