Zurück zum Ranking

huggingface/optimum

Pythonhuggingface.co/docs/optimum/main/

🚀 Accelerate inference and training of 🤗 Transformers, Diffusers, TIMM and Sentence Transformers with easy to use hardware optimization tools

onnxpytorchinferencetrainingintelgraphcoreonnxruntimetransformersquantizationhabanaoptimizationtflite
Sterne-Wachstum
Sterne
3.4k
Forks
668
Wochenwachstum
Issues
256
1k2k3k
Sept. 2021Apr. 2023Dez. 2024Juli 2026
ArtefaktePyPIpip install optimum
README

🤗 Optimum

PyPI - License PyPI - Python Version PyPI - Version PyPI - Downloads Documentation

Optimum is an extension of Transformers 🤖 Diffusers 🧨 TIMM 🖼️ and Sentence-Transformers 🤗, providing a set of optimization tools and enabling maximum efficiency to train and run models on targeted hardware, while keeping things easy to use.

Installation

Optimum can be installed using pip as follows:

python -m pip install optimum

If you'd like to use the accelerator-specific features of Optimum, you can check the documentation and install the required dependencies according to the table below:

Accelerator Installation
ONNX pip install --upgrade --upgrade-strategy eager optimum[onnx]
ONNX Runtime pip install --upgrade --upgrade-strategy eager optimum[onnxruntime]
ONNX Runtime GPU pip install --upgrade --upgrade-strategy eager optimum[onnxruntime-gpu]
OpenVINO pip install --upgrade --upgrade-strategy eager optimum[openvino]
NVIDIA TensorRT-LLM docker run -it --gpus all --ipc host huggingface/optimum-nvidia
AMD Instinct GPUs and Ryzen AI NPU pip install --upgrade --upgrade-strategy eager optimum[amd]
AWS Trainum & Inferentia pip install --upgrade --upgrade-strategy eager optimum[neuronx]
Intel Gaudi Accelerators (HPU) pip install --upgrade --upgrade-strategy eager optimum[habana]
FuriosaAI pip install --upgrade --upgrade-strategy eager optimum[furiosa]

The --upgrade --upgrade-strategy eager option is needed to ensure the different packages are upgraded to the latest possible version.

To install from source:

python -m pip install git+https://github.com/huggingface/optimum.git

For the accelerator-specific features, append optimum[accelerator_type] to the above command:

python -m pip install optimum[onnxruntime]@git+https://github.com/huggingface/optimum.git

Accelerated Inference

Optimum provides multiple tools to export and run optimized models on various ecosystems:

  • ONNX / ONNX Runtime, one of the most popular open formats for model export, and a high-performance inference engine for deployment.
  • OpenVINO, a toolkit for optimizing, quantizing and deploying deep learning models on Intel hardware.
  • ExecuTorch, PyTorch’s native solution for on-device inference across mobile and edge devices.
  • Intel Gaudi Accelerators enabling optimal performance on first-gen Gaudi, Gaudi2 and Gaudi3.
  • AWS Inferentia for accelerated inference on Inf2 and Inf1 instances.
  • NVIDIA TensorRT-LLM.

The export and optimizations can be done both programmatically and with a command line.

ONNX + ONNX Runtime

🚨🚨🚨 ONNX integration was moved to optimum-onnx so make sure to follow the installation instructions 🚨🚨🚨

Before you begin, make sure you have all the necessary libraries installed :

pip install --upgrade --upgrade-strategy eager optimum[onnx]

It is possible to export Transformers, Diffusers, Sentence Transformers and Timm models to the ONNX format and perform graph optimization as well as quantization easily.

For more information on the ONNX export, please check the documentation.

Once the model is exported to the ONNX format, we provide Python classes enabling you to run the exported ONNX model in a seamless manner using ONNX Runtime in the backend.

For this make sure you have ONNX Runtime installed, fore more information check out the installation instructions.

More details on how to run ONNX models with ORTModelForXXX classes here.

Intel (OpenVINO + NNCF)

Before you begin, make sure you have all the necessary libraries installed.

pip install --upgrade --upgrade-strategy eager optimum[openvino]

You can find more information on the different integration in our documentation and in the examples of optimum-intel.

ExecuTorch

Before you begin, make sure you have all the necessary libraries installed :

pip install optimum-executorch@git+https://github.com/huggingface/optimum-executorch.git

Users can export Transformers models to ExecuTorch and run inference on edge devices within PyTorch's ecosystem.

For more information about export Transformers to ExecuTorch, please check the doc for Optimum-ExecuTorch.

Quanto

Quanto is a pytorch quantization backend which allows you to quantize a model either using the python API or the optimum-cli.

You can see more details and examples in the Quanto repository.

Accelerated training

Optimum provides wrappers around the original Transformers Trainer to enable training on powerful hardware easily. We support many providers:

Intel Gaudi Accelerators

Before you begin, make sure you have all the necessary libraries installed :

pip install --upgrade --upgrade-strategy eager optimum[habana]

You can find examples in the documentation and in the examples.

AWS Trainium

Before you begin, make sure you have all the necessary libraries installed :

pip install --upgrade --upgrade-strategy eager optimum[neuronx]

You can find examples in the documentation and in the tutorials.

Ähnliche Repositories
ultralytics/yolov5

Ultralytics YOLOv5 in PyTorch for object detection, instance segmentation, classification, training, and export.

PythonPyPIGNU Affero General Public License v3.0yolov5object-detection
docs.ultralytics.com/yolov5/
57.7k17.5k
lutzroeder/netron

Visualizer for neural network, deep learning and machine learning models

JavaScriptnpmMIT Licenseneural-networkdeep-learning
netron.app
33.3k3.2k
Tencent/ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform

C++Otherinferencehigh-preformance
23.6k4.5k
onnx/onnx

Open standard for machine learning interoperability

PythonPyPIApache License 2.0deep-learningdeep-neural-networks
onnx.ai
21.2k4k
microsoft/onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator

C++MIT Licensedeep-learningonnx
onnxruntime.ai
21.2k4.1k
google/magika

Fast and accurate AI powered file content types detection

PythonPyPIApache License 2.0deep-learningfiletype
securityresearch.google/magika/
17.3k1.1k
tracel-ai/burn

Burn is a next generation tensor library and Deep Learning Framework that doesn't compromise on flexibility, efficiency and portability.

Rustcrates.ioApache License 2.0autodiffdeep-learning
burn.dev
15.6k986
llmware-ai/llmware

Unified framework for building enterprise RAG pipelines with small, specialized models

PythonPyPIApache License 2.0parsingretrieval-augmented-generation
llmware-ai.github.io/llmware/
14.8k2.9k
k2-fsa/sherpa-onnx

Speech-to-text, text-to-speech, speaker diarization, speech enhancement, source separation, and VAD using next-gen Kaldi with onnxruntime without Internet connection. Support embedded systems, Android, iOS, HarmonyOS, Raspberry Pi, RISC-V, RK NPU, Axera NPU, Ascend NPU, x86_64 servers, websocket server/client, support 12 programming languages

C++Apache License 2.0asronnx
k2-fsa.github.io/sherpa/onnx/index.html
13.7k1.6k
supertone-inc/supertonic

Lightning-Fast, On-Device, Multilingual TTS — running natively via ONNX.

SwiftMIT Licensecppcsharp
huggingface.co/spaces/Supertone/supertonic-3
13.5k1.4k
jina-ai/clip-as-service

🏄 Scalable embedding, reasoning, ranking for images and sentences with CLIP

PythonPyPIOtherbertsentence-encoding
clip-as-service.jina.ai
12.8k2.1k
langchain4j/langchain4j

LangChain4j is an idiomatic, open-source Java library for building LLM-powered applications on the JVM. It offers a unified API over popular LLM providers and vector stores, and makes implementing tool calling (including MCP support), agents and RAG easy. It integrates seamlessly with enterprise Java frameworks like Quarkus and Spring Boot.

JavaMavenApache License 2.0huggingfacejava
docs.langchain4j.dev
12.7k2.4k