NVIDIA Model Optimizer: Unified model compression and export to TensorRT-LLM
It compresses Hugging Face, PyTorch, and ONNX models, then connects them directly to TensorRT-LLM, vLLM, and other inference backends.
GitHub NVIDIA/Model-Optimizer Updated 2026-09-25 Branch main Stars 4.5K Forks 649
Python Cuda Model quantization TensorRT-LLM vLLM SGLang PyTorch

🧭 Decision Guide

Try it if you

  • You have a Hugging Face, PyTorch, or ONNX model and need to deploy it with TensorRT-LLM, vLLM, or SGLang.
    The README sections Input and Export for deployment explicitly list these input types and downstream frameworks.
  • You need PTQ to compress a model by 2x-4x, or need QAT, pruning, distillation, or sparsity.
    The README Techniques table lists Post Training Quantization, Quantization Aware Training, Pruning, Distillation, and Sparsity.
  • You want to use ready-to-deploy checkpoints from the NVIDIA Model Optimizer Collection.
    The README Pre-Quantized Checkpoints section provides a link to the Hugging Face Nvidia Model Optimizer Collection.

Skip it if you

  • Your model is not a Hugging Face, PyTorch, or ONNX model and falls outside the input types listed in the README.
    The README Input section states that Model Optimizer currently supports Hugging Face, PyTorch, or ONNX models.
  • Your project requires a stable 1.0 API and cannot accept compatibility changes in ModelOpt 0.x.
    The README Deprecation Policy says Model Optimizer is still pre-1.0 and removal of deprecated elements may introduce breaking changes in 0.x minor versions.
  • You cannot accept additional third-party open-source software being installed with nvidia-modelopt[all].
    The README Install section states that Model Optimizer will download and install additional third-party open-source software projects.

Requirements

  • The stable package can be installed from PyPI with `pip install -U nvidia-modelopt[all]`.
  • You need to review the license terms of Model Optimizer and its additional third-party open-source projects.
  • For editable source development, run `git clone [email protected]:NVIDIA/Model-Optimizer.git`, `cd Model-Optimizer`, and `pip install -e .[dev]`.
  • You can use NVIDIA containers with Model Optimizer pre-installed: `nvcr.io/nvidia/pytorch:-py3`, `nvcr.io/nvidia/nemo:`, or `nvcr.io/nvidia/tensorrt-llm/release:`.
  • The README requires reviewing the relevant licenses before using containers and upgrading Model Optimizer to the latest version.

First step (verbatim from README)

pip install -U nvidia-modelopt[all]

Watch out

  • Do not treat the 0.x API as a long-term stable interface; the README allows breaking changes in minor versions.
    The Deprecation Policy explicitly says Model Optimizer remains in 0.x and may include breaking changes in minor versions.
  • Before using `nvidia-modelopt[all]` or NVIDIA containers, account for additional open-source projects and container licenses.
    The README Install section separately warns about licenses for additional third-party software and the respective container licenses.
  • Model eligibility cannot be determined from the overview alone; the README provides Support Matrix pages for LLM/VLM, Diffusers, ONNX, and other categories.
    The README Model Support Matrix section provides matrix links for LLM/VLM Quantization, Diffusers Quantization, ONNX Quantization, and other categories.

Not stated in the README

  • The README does not specify CUDA, GPU models, driver versions, or minimum versions for each deployment backend.
  • The README does not provide exact compatibility-version combinations for specific models on TensorRT-LLM, vLLM, or SGLang.
  • The overview does not include the full contents of each model Support Matrix, so support for a target model cannot be confirmed from the provided material.
  • The README does not provide unified compression, throughput, or accuracy-change figures for techniques other than PTQ.
  • The README does not identify which specific third-party projects `nvidia-modelopt[all]` installs or provide their license list.
  • The README does not explain which compatibility changes were included across the 5 releases or in the latest ModelOpt 0.47.0 Release.

💡 Deep Analysis

6
Yes I maintain Hugging Face LLMs/VLMs and want to reduce model size with post-training quantization before deploying the checkpoint directly with vLLM; is Model Optimizer suitable for this path?
For: An inference engineer using Hugging Face LLMs/VLMs and planning deployment with vLLM

Yes, because the README explicitly covers Hugging Face LLM/VLM quantization and connects quantized checkpoints to vLLM.

  • Post-training quantization is advertised as providing 2x-4x model compression while preserving model quality as much as possible.
  • Hugging Face models are supported as inputs, with an “HF LLMs / VLMs” example and a separate support matrix.
  • The resulting checkpoint can be used with vLLM, but model coverage, quantization formats, and operators remain constrained by the support matrix and downstream runtime.
  • Compression ratio alone does not establish latency improvement; hardware, vLLM version, and batching configuration still matter.

The first step is to install the full package: pip install -U nvidia-modelopt[all].

  • Input: “Model Optimizer currently supports inputs of a Hugging Face, PyTorch or ONNX model”
  • Techniques: “Post Training Quantization”; “Compress model size by 2x-4x”
  • Export for deployment: checkpoints are ready for downstream frameworks including “vLLM”
  • Model Support Matrix: “LLM / VLM Quantization”
pip install -U nvidia-modelopt[all]
Not stated in the README:The README excerpt does not identify whether your exact LLM/VLM, target GPU, quantization format, and vLLM version are supported.;It does not provide actual throughput, time-to-first-token, or end-to-end latency for your model and workload.
Yes I already serve models with SGLang and want to use NVIDIA’s pre-quantized checkpoints to shorten the path to production instead of quantizing from scratch; is Model Optimizer suitable?
For: A platform engineer running production services with SGLang who wants to adopt NVIDIA pre-quantized checkpoints directly

Yes, because the README provides directly obtainable pre-quantized checkpoints and explicitly lists SGLang as a deployable downstream framework.

  • The Pre-Quantized Checkpoints section describes them as “Ready-to-deploy.”
  • The same section explicitly names TensorRT-LLM, vLLM, and SGLang, directly matching your serving framework.
  • The checkpoints are available through the NVIDIA Model Optimizer Collection, reducing the need to run quantization and export yourself.
  • However, “deployable” does not guarantee compatibility with your production model, quantization configuration, SGLang version, and hardware; the support matrix and runtime still matter.

This path is best suited to validating a published checkpoint that matches your target environment.

  • Pre-Quantized Checkpoints: “Ready-to-deploy checkpoints”
  • Pre-Quantized Checkpoints: “Deployable on TensorRT-LLM, vLLM and SGLang”
  • Pre-Quantized Checkpoints: “Nvidia Model Optimizer Collection”
  • Model Support Matrix: separate matrices for multiple techniques and model types
Not stated in the README:The excerpt does not provide exact checkpoint names, model versions, quantization configurations, SGLang versions, or hardware requirements.;It does not report throughput or latency for your concurrency, context length, and serving configuration.
Yes I train an LLM with Megatron-Bridge and have a limited budget for training steps. I want to recover post-quantization accuracy through quantization-aware training or distillation; is Model Optimizer suitable?
For: A model engineer training LLMs with Megatron-Bridge who needs quantization-aware training for accuracy recovery

Yes, because the README explicitly integrates Megatron-Bridge into training-required inference optimization and provides QAT and distillation examples.

  • The Optimize section names Megatron-Bridge, Megatron-LM, and Hugging Face Accelerate for optimization techniques that require training.
  • QAT / Distillation is described as improving quantized-model accuracy with “a few training steps,” matching your limited training budget.
  • The README provides QAT examples for Hugging Face and Megatron-Bridge and includes a QAT support matrix.
  • This is not a zero-cost conversion path: QAT and distillation still require training data, GPU resources, and training settings compatible with the model structure.

If your LLM is covered by the Megatron-Bridge support path, this is more targeted than PTQ alone.

  • Optimize: integrated with “NVIDIA Megatron-Bridge, Megatron-LM and Hugging Face Accelerate”
  • Techniques: “Quantization Aware Training / Distillation”; “with a few training steps”
  • Techniques examples: Hugging Face and Megatron-Bridge
  • Model Support Matrix: “Quantization Aware Training”
pip install -U nvidia-modelopt[all]
Not stated in the README:The excerpt does not specify compatibility for your LLM, Megatron-Bridge version, training-data scale, or required GPU count.;It does not quantify how many “few training steps” are needed for your model and target accuracy.
It depends I only have an ONNX model and my target runtime is TensorRT; can I use Model Optimizer for quantization and deployment without first converting the model to Hugging Face?
For: A NVIDIA deployment engineer with an existing ONNX model who wants to integrate TensorRT

It depends, because the README accepts ONNX inputs and includes an ONNX quantization example, but it does not promise that every ONNX graph can be quantized and deployed with TensorRT.

  • The input layer explicitly supports Hugging Face, PyTorch, and ONNX models.
  • The Techniques table includes an “ONNX” post-training quantization example, confirming that this is a supported path.
  • The deployment section lists TensorRT as a downstream NVIDIA inference framework.
  • However, the README narrows ONNX coverage through a support matrix; operator coverage, graph structure, precision format, and TensorRT-version compatibility are not detailed in the excerpt.

The project is therefore suitable for validating an ONNX model covered by the matrix, but not for assuming that any ONNX model is directly deployable.

  • Input: support for “Hugging Face, PyTorch or ONNX” models
  • Techniques: Post Training Quantization includes an “ONNX” example
  • Export for deployment: downstream frameworks include “TensorRT”
  • Model Support Matrix: “ONNX Quantization”
pip install -U nvidia-modelopt[all]
Not stated in the README:The excerpt does not state whether your model operators, opset, quantization format, and TensorRT version are compatible.;It does not provide the complete command for converting the quantized ONNX checkpoint into a TensorRT engine.
It depends I use Diffusers models and want to use the unified Hugging Face export API for quantization while connecting to the NVIDIA inference ecosystem; does Model Optimizer cover this workflow?
For: A model developer using Diffusers vision-generation models who needs a unified Hugging Face export API

It depends, because the README explicitly supports unified export and quantization examples for Diffusers, while exact model and downstream-framework coverage still requires checking the support matrix.

  • The deployment section states that the unified Hugging Face export API supports both transformers and diffusers models.
  • Post-training quantization includes a dedicated Diffusers example, so vision-generation support is more than a conceptual claim.
  • The project produces quantized checkpoints intended for TensorRT, TensorRT-LLM, vLLM, or SGLang, but the excerpt does not enumerate Diffusers coverage for each framework.
  • Quantized generation quality, memory usage, and speed may trade off, and the README provides no result for your specific pipeline.

The API-level workflow matches your needs, but direct deployment depends on model and runtime support.

  • Export for deployment: “The unified Hugging Face export API now supports both transformers and diffusers models”
  • Techniques: Post Training Quantization includes a Diffusers example
  • Pre-Quantized Checkpoints: deployable on TensorRT-LLM, vLLM, and SGLang
  • Model Support Matrix: “Diffusers Quantization”
pip install -U nvidia-modelopt[all]
Not stated in the README:The excerpt does not list whether your specific Diffusers pipeline, sampler, quantization format, and target hardware are supported.;It does not state whether the Diffusers checkpoint can be loaded directly by your selected TensorRT, vLLM, or SGLang workflow.
It depends I use a PyTorch model on Windows and want to validate post-training quantization first. Since the README has a Windows example, is Model Optimizer suitable for my environment?
For: A developer validating quantization on Windows with a PyTorch model

It depends, because the README includes a Windows quantization example, but Windows is a separately bounded scenario; general PyTorch input support does not imply complete Windows compatibility.

  • The input layer supports PyTorch models, and the post-training quantization table explicitly includes a “Windows” example.
  • Windows Quantization has its own support matrix, indicating boundaries around model, operator, or environment coverage.
  • The project is integrated with the NVIDIA AI software ecosystem and provides NVIDIA PyTorch, NeMo, and TensorRT-LLM containers; those containers do not automatically represent native Windows deployment.
  • It is therefore suitable for validating a Windows path covered by the matrix, but not for assuming that every PyTorch model and downstream framework works on Windows.
  • Input: support for “Hugging Face, PyTorch or ONNX” models
  • Techniques: Post Training Quantization includes a “Windows” example
  • Model Support Matrix: “Windows Quantization”
  • Install: NVIDIA PyTorch, NeMo, and TensorRT-LLM container images
pip install -U nvidia-modelopt[all]
Not stated in the README:The excerpt does not specify compatibility across Windows versions, CUDA/PyTorch combinations, GPU models, and your exact PyTorch model.;It does not state whether a Windows quantization result can directly enter your target TensorRT, vLLM, or SGLang deployment environment.

✨ Highlights

  • PTQ can compress models by 2x-4x
  • Supports Hugging Face, PyTorch, and ONNX inputs
  • Deployable on TensorRT-LLM, vLLM, and SGLang
  • Covers quantization, pruning, distillation, and sparsity
  • ModelOpt 0.47.0 is still pre-1.0

🔧 Engineering

  • Python APIs compose quantization, pruning, and distillation
  • Unified export supports both transformers and diffusers
  • Quantized checkpoints export to TensorRT and vLLM

⚠️ Risks

  • The pre-1.0 policy provides only about a one-month migration period
  • Installing nvidia-modelopt[all] adds third-party software
  • 0.x minor releases may include breaking changes

👥 For who?

  • Teams working with Hugging Face, PyTorch, or ONNX models
  • Deployment engineers targeting TensorRT-LLM, vLLM, or SGLang
  • NVIDIA users needing PTQ, QAT, NAS, or speculative decoding