
Model-Optimizer
Quantize, prune, and distill AI models for GPU inference
Replaces Clika

Who it's for
ModelOpt's PTQ path quantizes a deployed Hugging Face or Megatron model to FP8 or NVFP4 in a single calibration pass, cutting memory footprint 2x to 4x and enabling higher throughput on the same hardware. The export to vLLM or TensorRT-LLM is a direct pipeline step with no manual format work.
Skip if your inference runtime is not TensorRT-LLM, vLLM, or SGLang. ModelOpt's export paths are tied to NVIDIA deployment frameworks; optimization results do not directly transfer to other runtimes.
Minitron-style pruning combined with two-phase distillation lets research teams produce smaller model variants from an existing checkpoint. Puzzletron adds heterogeneous NAS, and the result can be published as a smaller, faster model with documented quality retention, as Bielik.AI did with Bielik Minitron 7B.
Skip if your base model is not in ModelOpt's support matrix. Check the pruning and distillation support matrices in the GitHub repo before starting; architectures outside the matrix require custom integration work.
Because ModelOpt runs inside your own infrastructure with no external API calls during the optimization step, it fits environments where model weights and training data cannot leave the organization's network. The Apache-2.0 license permits internal commercial use without licensing agreements or usage-based billing.
Skip if you have no NVIDIA GPU infrastructure. ModelOpt's hardware-specific quantization and export paths require CUDA-capable hardware for the optimization step.
ModelOpt supports quantization for Hugging Face diffusers models, and NVIDIA has documented a 60% diffusion latency reduction using ModelOpt with TensorRT in an Adobe deployment. Cache Diffusion is an additional ModelOpt technique for further inference acceleration on diffusion architectures.
Skip if your deployment target is not NVIDIA TensorRT. Diffusion model optimizations in ModelOpt are coupled to the TensorRT export path.
The problem
Deploying large language models at production latency and acceptable cost is a consistent pain point for engineering teams. A 70B parameter model requires substantial GPU memory and compute; running inference on it at scale means either buying more hardware than the budget allows or accepting latency that makes the product unusable. The standard path has been to rely on paid compression services or to accept that model optimization is too complex to build in-house. Post-training quantization, pruning, and distillation each require care to avoid accuracy degradation, and applying them in combination while targeting a specific deployment framework adds further complexity. Teams end up with underutilized hardware, oversized cloud bills, or models that never make it to production at all.
How it works
Compresses model size 2x to 4x by reducing weight precision from FP16/BF16 to FP8, INT8, INT4, or NVFP4, with minimal accuracy loss on most architectures. Works on Hugging Face LLMs and VLMs, diffusion models, and ONNX graphs. PTQ requires no retraining and runs in a single pass over a calibration dataset.
Recovers the accuracy that aggressive quantization costs by running a few training steps with the original model as teacher. QAD on Qwen3.6-35B-A3B with W4A4 NVFP4 achieved up to 1.30x vLLM throughput over BF16 at 3.1x smaller checkpoint size while matching BF16 accuracy. Supports Megatron-Bridge and Hugging Face training frameworks.
Reduces model parameters or memory footprint by removing unnecessary weights. Includes Minitron-style pruning plus distillation, used to produce Bielik Minitron 7B (33% smaller, 50% faster, 90% quality retained) and to compress Colosseum-355B to 260B. Puzzletron adds heterogeneous pruning and NAS for LLMs and VLMs.
Trains lightweight draft modules that predict extra tokens during the main model's inference pass, reducing wall-clock latency per token. ModelOpt supports vanilla Markov heads (DSpark) and GRU-based correction heads (Domino) on the shared DFlash backbone. Works with Hugging Face and Megatron-LM training frameworks.
Exports quantized checkpoints in formats ready for TensorRT-LLM, TensorRT, vLLM, and SGLang without manual format conversion. The unified Hugging Face export API covers both transformers and diffusers models. Pre-quantized checkpoints for DeepSeek-R1, Llama 3.x, and Nemotron 3 are available on Hugging Face.
Features
- Post-Training Quantization
- Quantization-Aware Distillation
- Pruning and Neural Architecture Search
- Speculative Decoding
- Multi-Framework Deployment Export
How to install
Install the stable release from PyPI with pip.
pip install -U nvidia-modelopt[all]Recommended for this setup
Strengths
- Apache-2.0 license with no usage restrictions: The full library is Apache-2.0 licensed, permitting unrestricted commercial and research use. You can run ModelOpt on your infrastructure, modify it, and distribute derivative work without royalties or commercial-use clauses. This contrasts with paid optimization services where the optimization pipeline is proprietary and usage is metered.
- Native NVIDIA ecosystem integration: ModelOpt is developed by NVIDIA and integrates directly with TensorRT-LLM, TensorRT, Megatron-Bridge, and vLLM deployment paths. Optimized checkpoints move into production without format conversion steps. Adobe used ModelOpt with TensorRT to achieve a 60% reduction in diffusion latency and a 40% reduction in total cost of ownership.
- Pre-quantized checkpoint collection on Hugging Face: NVIDIA publishes ready-to-deploy ModelOpt-optimized checkpoints for major models including DeepSeek-R1-FP4, Llama-3.3-70B-Instruct-FP4, Llama-3.1-405B-Instruct-FP4, and Nemotron 3 series. Teams that need inference acceleration without running the optimization pipeline themselves can use these directly on TensorRT-LLM or vLLM.
- Actively maintained by NVIDIA with a public roadmap: ModelOpt was open sourced in January 2025 and has been updated continuously, with the last push on September 26, 2026. NVIDIA ships new techniques as blog-backed algorithm releases. The roadmap is tracked publicly on GitHub, and 4,473 stars with 649 forks indicate active community use.
Trade-offs
- Requires NVIDIA GPU hardware: Most optimization techniques and all deployment export paths are built for NVIDIA hardware. FP8, NVFP4, and INT4 quantization targets assume TensorRT or CUDA-capable GPUs. Teams running on AMD, Apple Silicon, or CPU-only inference will find ModelOpt's advanced techniques inapplicable, and the export path to TensorRT-LLM does not transfer to non-CUDA runtimes.
- Pre-1.0 API with short deprecation window: ModelOpt follows a 0.x versioning scheme with a one-release migration window after deprecations. Breaking changes to the Python API can appear in minor version updates while the library remains pre-1.0. Teams building automated optimization pipelines should pin the version and test upgrades before deploying changes.
- 418 open issues across supported model architectures: The public issue tracker shows 418 open issues, reflecting active user pain points and gaps between documented support and real-world model architectures. Not all are bugs, but the volume indicates friction with specific models or quantization paths. Check the support matrix and open issues before committing to a specific model or technique.
Tech stack
FAQ
Yes. ModelOpt is Apache-2.0 licensed and available on PyPI at no cost. You can use it commercially, modify it, and distribute derivative work without restrictions. The only requirements are NVIDIA GPU infrastructure with compatible CUDA and the target deployment framework installed.
Post-training quantization (PTQ) reduces model weight precision in a single calibration pass with no retraining, giving 2x to 4x compression at some accuracy cost. Quantization-aware training (QAT) or quantization-aware distillation (QAD) adds a short training phase with the original model as teacher to recover accuracy. PTQ is faster to run; QAT and QAD produce higher-accuracy quantized models at the cost of additional compute.
ModelOpt exports quantized checkpoints for TensorRT-LLM, TensorRT, vLLM, and SGLang. The unified Hugging Face export API covers both transformers and diffusers models. Pre-quantized checkpoints for DeepSeek-R1, Llama 3.x, and Nemotron 3 series are available on the NVIDIA Hugging Face collection.
ModelOpt is designed for NVIDIA hardware and its export paths target CUDA-based deployment frameworks. FP8, NVFP4, and INT4 quantization techniques assume NVIDIA GPUs. Teams deploying on AMD, Apple Silicon, or CPU-only setups will need a different optimization stack; ModelOpt does not currently cover those targets.
ModelOpt accepts any Hugging Face, PyTorch, or ONNX model as input, but the depth of support varies by architecture. Each technique has its own support matrix published in the GitHub repo. Check the quantization, pruning, distillation, or speculative decoding support matrix for your specific architecture before starting to avoid blocked paths.