nvidia-modelopt
Nvidia Model Optimizer: A unified library of SOTA model optimization techniques like quantization, pruning, Neural Architecture Search (NAS), distillation, speculative decoding, etc. It compresses deep learning models for downstream deployment frameworks like TensorRT-LLM, TensorRT, vLLM, etc. to optimize inference speed.
What it is and what it does
NVIDIA Model Optimizer is a library for compressing and accelerating deep learning models through a suite of optimization techniques. It accepts PyTorch, Hugging Face, or ONNX models as input, applies techniques like quantization (FP8, NVFP4), pruning, distillation, and Neural Architecture Search to reduce model size and latency, then exports optimized checkpoints ready for deployment in inference frameworks like TensorRT-LLM, vLLM, and SGLang.
The package is designed for teams optimizing large language models and vision models for production inference. It integrates with NVIDIA Megatron-LM and Hugging Face Accelerate for training-time optimization, and provides Python APIs to compose multiple techniques together. Dependencies include torch, numpy, omegaconf, pydantic, and other ML-stack standards.
Use it for:
- Quantize large language models to lower precision (FP8, NVFP4) for faster inference without retraining.
- Prune and distill LLMs to reduce model size while maintaining accuracy for deployment on resource-constrained hardware.
- Apply post-training quantization to Hugging Face transformer models for immediate export to TensorRT or vLLM.
- Combine multiple optimization techniques (pruning + distillation + quantization) in a single workflow for maximum throughput gains.
- Export optimized diffusion models for faster image generation on NVIDIA GPUs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Applies state-of-the-art model optimization techniques—quantization, pruning, Neural Architecture Search, distillation, speculative decoding, and sparsity—to accelerate PyTorch, Hugging Face, and ONNX models for deployment.
Yes, if you deploy PyTorch or Hugging Face models on NVIDIA hardware and need to reduce inference latency or memory footprint. The library is actively maintained, permissively licensed, and integrates cleanly with the NVIDIA inference ecosystem. Install friction is low and security record is clean. Not applicable for CPU-only or non-NVIDIA deployments.
Install
nvidia-modelopt on PyPI
pip
pip install nvidia-modeloptuv
uv add nvidia-modeloptpoetry
poetry add nvidia-modeloptInstalling nvidia-modelopt
Before you install
Low friction install; pure Python wheel. Active maintenance with recent commits and 3442 repository stars. Depends on 15 runtime packages including torch, numpy, and omegaconf—standard for ML workflows.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions.
Quickstart
pip install nvidia-modelopt
from nvidia_modelopt import quantization
import torch
model = torch.nn.Linear(10, 5)
quantized = quantization.quantize(model)
Requires PyTorch and NVIDIA GPU support; quantization and optimization workflows typically need CUDA-capable hardware for practical speedup.
Verify before relying
- Whether the package requires NVIDIA-specific GPU hardware or works on CPU for development/testing.
- Performance gains and memory reduction percentages claimed in the description (e.g., 2.6× throughput) for typical model sizes.
- Compatibility with specific downstream frameworks (TensorRT-LLM, vLLM, SGLang) beyond the documented integration points.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 15 — ninja, numpy, nvidia-ml-py, packaging, setuptools, torch, tqdm, PyYAML, omegaconf, pulp, pydantic, regex, rich, safetensors, scipy |
| Maintenance | actively maintained — 39 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 496,448/month — #6,336 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: nvidia_modelopt-0.45.0-py3-none-any.whl
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
onnxslimOnnxSlim reduces the size and operator count of…
permissive · top 5,000 on PyPI
tensorflow-model-optimizationProvides quantization, pruning, and clustering…
permissive · top 15,000 on PyPI
transformer-engine-cu12Accelerates Transformer model training and…
unclear · top 15,000 on PyPI
transformer-engineTransformer Engine accelerates Transformer…
unclear · top 15,000 on PyPI
nncfNNCF provides post-training and training-time…
permissive · top 5,000 on PyPI
optimum-onnxExports Hugging Face transformer models to ONNX…
permissive · top 15,000 on PyPI
model-compression-toolkitCompresses and optimizes neural networks…
permissive · top 15,000 on PyPI
torchaoTorchAO applies quantization and sparsity…
unclear · top 5,000 on PyPI
compressed-tensorsProvides a unified format for storing and…
permissive · top 5,000 on PyPI
ipex-llmAccelerates large language model inference on…
permissive · top 15,000 on PyPI