Optimum extends Transformers, Diffusers, TIMM, and Sentence Transformers with tools to export, quantize, and run models efficiently on specific hardware.
Overview
Optimum is an extension of Hugging Face Transformers, Diffusers, TIMM, and Sentence Transformers. It provides optimization tooling so training and inference on targeted hardware stay efficient while keeping the familiar Transformers-style APIs.
Accelerated inference covers several ecosystems. Models can be exported to ONNX and run with ONNX Runtime, optimized with OpenVINO on Intel hardware, deployed with ExecuTorch for on-device PyTorch inference, and tuned for Intel Gaudi HPUs, AWS Inferentia, and NVIDIA TensorRT-LLM. Export, graph optimization, and quantization can be done programmatically or from the command line. ONNX-related workflows have moved to a dedicated optimum-onnx package.
Accelerated training wraps the standard Transformers Trainer for hardware such as Intel Gaudi accelerators, AWS Trainium, and ONNX Runtime tuned for GPUs. Optional pip extras pull in accelerator-specific dependencies for OpenVINO, Habana, Neuron, AMD, FuriosaAI, and related stacks.
Optimum is distributed as a collection of packages aligned with hardware partners and open-source integrations, including ONNX Runtime, ExecuTorch, and Torch FX graph transforms, so teams can adopt specialized platforms without rewriting their model workflows.
Key features
- ONNX export and ONNX Runtime classes
- OpenVINO model optimization
- ExecuTorch edge inference export
- Intel Gaudi training wrappers
- AWS Trainium and Inferentia support
- NVIDIA TensorRT-LLM integration
- Quanto quantization backend
- Hardware-specific pip extras
Use cases
- Faster transformer inference on CPUs
- Edge deployment of Hugging Face models
- Intel OpenVINO production pipelines
- Cloud accelerator training jobs
- Model quantization workflows