{"name":"Optimum: Accelerate Hugging Face Models with Hardware Optimization","description":"Optimum is an extension of Hugging Face Transformers, Diffusers, TIMM, and Sentence-Transformers, designed to provide a suite of optimization tools. It enables maximum efficiency for training and running models on targeted hardware, simplifying the process for developers. This library helps users achieve significant performance gains across various machine learning workflows.","github":"https://github.com/huggingface/optimum","url":"https://osrepos.com/repo/huggingface-optimum","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/huggingface-optimum","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/huggingface-optimum.md","json":"https://osrepos.com/repo/huggingface-optimum.json","topics":["Python","Machine Learning","AI","Transformers","Optimization","Inference","Training","ONNX"],"keywords":["Python","Machine Learning","AI","Transformers","Optimization","Inference","Training","ONNX"],"stars":null,"summary":"Optimum is an extension of Hugging Face Transformers, Diffusers, TIMM, and Sentence-Transformers, designed to provide a suite of optimization tools. It enables maximum efficiency for training and running models on targeted hardware, simplifying the process for developers. This library helps users achieve significant performance gains across various machine learning workflows.","content":"## Introduction\n\nOptimum is a powerful extension of Hugging Face Transformers, Diffusers, TIMM, and Sentence-Transformers, providing a comprehensive set of optimization tools. Its primary goal is to enable maximum efficiency for training and running models on targeted hardware, all while maintaining ease of use for developers. Optimum helps accelerate your machine learning workflows by leveraging various hardware-specific optimizations. For more detailed information, refer to the official [Optimum documentation](https://huggingface.co/docs/optimum/index){:target=\"_blank\"}.\n\n## Installation\n\nGetting started with Optimum is straightforward. You can install the core library using `pip`:\n\nbash\npython -m pip install optimum\n\n\nFor accelerator-specific features, Optimum provides additional installation options. These specialized installations ensure you have the necessary dependencies for optimizing models on particular hardware. Please consult the [official documentation](https://huggingface.co/docs/optimum/index){:target=\"_blank\"} for detailed instructions on installing accelerator-specific components, such as those for ONNX Runtime, OpenVINO, or Habana.\n\n## Examples\n\nOptimum offers extensive capabilities for both accelerated inference and training across a variety of hardware and software ecosystems.\n\n### Accelerated Inference\n\nOptimum provides multiple tools to export and run optimized models efficiently:\n\n*   **ONNX / ONNX Runtime**: Export models to the ONNX format and run them with the high-performance ONNX Runtime. Learn more about [ONNX export](https://huggingface.co/docs/optimum-onnx/en/onnx/usage_guides/export_a_model){:target=\"_blank\"} and [running ONNX models](https://huggingface.co/docs/optimum-onnx/en/onnxruntime/usage_guides/models){:target=\"_blank\"}.\n*   **Intel OpenVINO**: Optimize, quantize, and deploy deep learning models on Intel hardware. Detailed guides are available in the [OpenVINO documentation](https://huggingface.co/docs/optimum/intel/inference){:target=\"_blank\"}.\n*   **ExecuTorch**: Leverage PyTorch’s native solution for on-device inference across mobile and edge devices. Explore [ExecuTorch export](https://huggingface.co/docs/optimum-executorch/guides/export){:target=\"_blank\"}.\n*   **Quanto**: A PyTorch quantization backend that allows for model quantization via Python API or `optimum-cli`. Find more details and [examples in the Quanto repository](https://github.com/huggingface/optimum-quanto){:target=\"_blank\"}.\n*   **NVIDIA TensorRT-LLM**: Accelerate large language models on NVIDIA GPUs. Refer to the [Optimum NVIDIA blog post](https://huggingface.co/blog/optimum-nvidia){:target=\"_blank\"} for more information.\n\n### Accelerated Training\n\nOptimum also provides wrappers around the original Transformers Trainer, simplifying accelerated training on powerful hardware:\n\n*   **Intel Gaudi Accelerators (HPU)**: Achieve optimal performance for training on first-gen Gaudi, Gaudi2, and Gaudi3. See the [Intel Gaudi training documentation](https://huggingface.co/docs/optimum/main/en/habana/usage_guides/accelerate_training){:target=\"_blank\"}.\n*   **AWS Trainium**: Enable accelerated training on Trn1 and Trn1n instances. Explore [AWS Trainium training tutorials](https://huggingface.co/docs/optimum-neuron/training_tutorials/sft_lora_finetune_llm){:target=\"_blank\"}.\n\n## Why use Optimum?\n\nOptimum is an essential tool for anyone working with Hugging Face models who needs to achieve peak performance. It simplifies the complex process of hardware optimization, allowing developers to focus on model development rather than low-level hardware specifics. By providing broad support for various accelerators and offering easy-to-use APIs, Optimum ensures your models run faster, more efficiently, and with reduced computational costs, both during inference and training.\n\n## Links\n\n*   **GitHub Repository**: [huggingface/optimum](https://github.com/huggingface/optimum){:target=\"_blank\"}\n*   **Official Documentation**: [Optimum Documentation](https://huggingface.co/docs/optimum/index){:target=\"_blank\"}","metrics":{"detailViews":9,"githubClicks":13},"dates":{"published":null,"modified":"2026-01-06T00:00:59.000Z"}}