推理前需先用 optimum-cli 把模型导出为 OpenVINO IR,不能直接加载原始权重;量化需要额外准备校准数据集;导出模型也可改用 OpenVINO GenAI 框架推理。

optimum-intel
huggingfaceApache-2.0活跃维护把 Hugging Face 的 Transformers、Diffusers 等模型接到 Intel 的 OpenVINO 等优化工具上,加速 CPU/GPU 推理,覆盖 LLM、语音识别、语音合成和多模态模型。
🤗 Optimum Intel: Accelerate inference with Intel optimization tools
pip install -U optimum-intel面向 Intel CPU、GPU 及专用深度学习推理加速器,具体支持设备列表见 OpenVINO 文档;README 未给出具体显存要求。
把 Transformers 等模型导出成 OpenVINO IR,在 Intel CPU/GPU 上加速推理
把 Hugging Face 的 Transformers、Diffusers 等模型接到 Intel 的 OpenVINO 等优化工具上,加速 CPU/GPU 推理,覆盖 LLM、语音识别、语音合成和多模态模型。
核心能力
- 用 optimum-cli 把 Hub 模型导出为 OpenVINO IR 格式
- 提供 OVModelForXxx 类替换 AutoModelForXxx 直接跑推理
- 支持训练后静态量化,可指定 dtype 与校准数据集
- 对接 Transformers、Diffusers、Sentence Transformers 和 timm
容易踩的坑
- v2.2.0最新正式版2026-09-17 · 2026-09-17 13:11 UTC
New Model Support
- Mistral 3 (#1627 by @kyoui-dev)
- DeepSeek-OCR-2 (#1793 by @openvino-agent)
- Meta Muse Glimmer (#1924 by @rkazants)
- Ouro (#1783 by @openvino-dev-samples)
- Fun-ASR (#1801 by @openvino-agent)
- LTX2 text-to-audio-video (#1733 by @anatyrova) and image-to-video (#1885 by @goyaladitya05)
- LTX-Video image-to-video (#1762 by @goyaladitya05)
- Qwen-Image (#1790 by @openvino-agent)
- Z-Image (#1946 by @openvino-agent)
- DFlash draft models for speculative decoding (#1756 by @ofirzaf), including VLM support (#1926 by @ofirzaf, #1971 by @rkazants)
- Multi-Token Prediction heads for Qwen3.5, Qwen3.6 (including MoE flavors) and Qwen3.8-27B (#1814 by @openvino-agent, #1971 by @rkazants)
- Video input for Gemma 4 and Gemma 4 Unified (#1951 by @yatarkan)
Improvements & fixes
- Added default int4 compression configs for gemma-4-12B-it (#1952 by @anzr299) and Muse-Glimmer-30B (#1929 by @andreyanufr)
- Fixed Gemma 4 Unified vision embedding fp16 overflow on GPU by setting an activation scale factor (#1973 by @rkazants)
- Fixed chat template application for Gemma 4 Unified (#1895 by @popovaan)
- Fixed Mamba 2 selective SSM representation for Granite 4.0 hybrid (#1789 by @openvino-agent)
- Optimized Qwen3-Omni-MoE Talker MoE export (#1880 by @sgonorov)
- Fixed the inputs_embeds input of the Qwen3-VL Eagle draft model (#1932 by @popovaan)
- Fixed Fun-ASR model type (#1925 by @popovaan) and added export and auto-compression tests (#1874 by @LauraGPT)
- Fixed calibration dataset preparation for FLUX.2-klein (#1923 by @andrey-churkin)
- Added the missing --group-size-fallback argument to the export CLI (#1845 by @andrey-churkin)
- Removed the _LTX2AttnProcessorWithEps patch for LTX2 (#1928 by @anatyrova)
- Removed the patch_16bit_model flag from the export path (#1930 by @anatyrova)
- Bumped the minimum NNCF version to v3.3 and unpinned safetensors (#1916 by @andrey-churkin, #1918 by @echarlaix)
Other Changes
- Added an OpenVINO export space to the documentation (#1882 by @echarlaix)
- Added agent skills for optimum and tiny test model creation (#1848 by @Mohamed-Ashraf273)
- Removed unneeded transformers version checks in tests (#1933 by @popovaan)
- CI: run OpenVINO tests on release-branch pull requests (#1892), restore Qwen3.5 and Qwen3.5-MoE in the preview workflow (#1891), sync built docs to the hf-doc-build bucket (#1898 by @echarlaix)
New Contributors
- @kyoui-dev made their first contribution in #1627 (https://github.com/huggingface/optimum-intel/pull/1627)
- @goyaladitya05 made their first contribution in #1762 (https://github.com/huggingface/optimum-intel/pull/1762)
- @LauraGPT made their first contribution in #1874 (https://github.com/huggingface/optimum-intel/pull/1874)
- @yatarkan made their first contribution in #1951 (https://github.com/huggingface/optimum-intel/pull/1951)
Compatible transformers version
Compatible with transformers>=4.51,<5.6
Recommended versions
- OpenVINO: v2026.4
- OpenVINO GenAI: v2026.4
- NNCF: v3.4
Full Changelog
https://github.com/huggingface/optimum-intel/compare/v2.1.0...v2.2.0
- v2.1.0-muse-glimmerv2.1.0-Muse-Glimmer2026-08-26 · 2026-08-26 10:52 UTC
查看更新说明
New Model Support
Compatible transformers version
- Muse Glimmer: Requires transformers==5.15
- Everything else: Compatible with transformers>=4.51,<5.6
Recommended versions
- OpenVINO: v2026.3.1
- OpenVINO GenAI: v2026.3.1
- OpenVINO Tokenizers: v2026.3.1
- NNCF: v3.3.0
- v2.1.02026-08-05 · 2026-08-05 14:15 UTC
查看更新说明
New Model Support
- Gemma 3n (#1650 by @anatyrova)
- Qwen3-Omni-MOE (#1700 by @sgonorov)
- SmolLM3 (#1715 by @AshutoshSinghIntel)
- Qwen3-VL-Embedding (#1723 by @mlukasze)
- Gemma 4 Unified (#1770 by @rkazants)
- FLUX.2 (#1809 by @rkazants)
Improvements & fixes
- Transformers v5.1-5.5 support (#1684 by @echarlaix)
- Fix Kokoro voice conversion from local model directory (#1803 by @mmikolajcz)
- Extended OpenVINO transformation verification tests for MoE architectures (#1776 by @anatyrova)
- Unpatch 16-bit models previously patched with
patch_16bit_modelafter conversion (#1811 by @anatyrova) - Set dynamic sequence length for FLUX.2 (#1846 by @rkazants)
- Deprecated the broken
contextualcalibration dataset, replaced withtextvqa(#1849 by @echarlaix) - Fixed passing of
token_type_idsfor Gemma3 (#1881 by @popovaan) - Fixed export for encoder-decoder models with unnamed tensors (#1857 by @echarlaix)
- Fixed long audio inference for Qwen3-ASR (#1782 by @popovaan)
- Fixed ssm states handling for Mamba and Falcon-Mamba (#1779 by @echarlaix)
- Pinned
huggingface_hub<1.22to fix offline loading (#1855 by @echarlaix) - Use base transformers version for version comparisons (#1798 by @AlexanderDokuchaev)
Other Changes
- CI: local model caching and rate-limit fixes for fork PRs (#1817, #1826, #1835, #1837, #1840, #1842 by @echarlaix)
- Faster doc builds (#1851 by @mishig25)
New Contributors
- @anatyrova made their first contribution in #1650
- @AshutoshSinghIntel made their first contribution in #1715
- @mlukasze made their first contribution in #1723
Full Changelog
https://github.com/huggingface/optimum-intel/compare/v2.0.0...v2.1.0
Compatible transformers version
Compatible with transformers>=4.51,<5.6
NPU-specific requirements:
- Whisper - need transformers v5.0
- LFM2 - need transformers v5.0
Maximum supported transformers version by model architectures can be found in the table below (models not listed support up to transformers v5.6)
Model architecture Max transformers version AquilaM 4.57.6 Arctic 4.53.3 Baichuan 4.57.6 Bitnet 4.57.6 ChatGLM2 4.55.4 DBRX 4.57.6 Data2VecText 4.57.6 Deci 4.57.6 Deepseek 4.53.3 Exaone 4.57.6 Exaone4 4.5 - v2.0.02026-06-10 · 2026-06-10 12:59 UTC
查看更新说明
Breaking Changes
- Intel Neural Compressor (INC) and Intel Extension for PyTorch (IPEX) integrations have been fully removed (https://github.com/huggingface/optimum-intel/pull/1687). Both were deprecated in v1.27.0. Users relying on these should stay on v1.27
- ONNX dependency was removed from package requirements (#1753)
- OpenVINO and NNCF are now installed by default, the [openvino] and [nncf] extras are now deprecated (#1602)
New Model Support
- Arcee Trinity (AFMoE) (#1569)
- Qwen3VL (#1551)
- Qwen3-next (hybrid SSM/attention) (#1523)
- Qwen3.5, Qwen3.5-MoE, Qwen3.6 (#1689)
- Gemma 4 (#1688)
- Eagle3: Speculative decoding draft model support (#1588)
- LFM2-MoE (#1691)
- Kokoro TTS (#1653)
- Qwen3-ASR (#1677)
- CohereLabs/tiny-aya-base (Command-R family) (#1623)
- HY-MT1.5-1.8B (#1621)
- VideoChat (#1637)
Quantization & Compression
- Extended dataset options for calibration: Datasets can now be specified with parameters, e.g. wikitext2:seq_len=128 (#1564)
- Default 8-bit quantization configs with configurable dynamic quantization group size (#1570)
- NNCF CB4 mode renamed to cb4_f8e4m3 for newer NNCF versions (#1597)
- Data-Aware AWQ for Qwen3-30B added to configuration (#1620)
- Fix quantized model save path: Immediate save after quantization now writes to the correct path (#1576)
- Fix per_layer_inputs value error during quantization (#1714)
- Fix calibration data collection (#1778)
Improvements
- Transformers v5 compatibility (#1589)
- Hybrid attention models: past_key_values in attention_mask now supported for stateful inference (#1641)
- beam_idx connected to Linear Attention Layers (CausalConv1D, SSM, GDN) for correct beam search with recurrent models (#1619)
- Fix long-context inference for Phi-3.5 and Phi-4 (#1744)
- Fix SpeechT5 dynamic batch inference (#1664)
- Fix MoE patching to enable ConvertTiledMoeBlockToGatherMatmuls transformation (#1741)
- Improved numpy input handling for model inputs with mixed types (#1646)
- Fix task inference for Phi-4-multimodal-instruct (#1610)
New Contributors
- @andrew-k-park made their first contribution in https://github.com/huggingface/optimum-intel/pull/1590
- @andrey-churkin made their first contribution in https://github.com/huggingface/optimum-intel/pull/1597
- @Mohamed-Ashraf273 made their first contribution in https://github.com/huggingface/optimum-intel/pull/1623
- @anzr299 made their first contribution in https://github.com/huggingface/optimum-intel/pull/1620
- @MissLostCodes made their first contribution in https://github.com/huggingface/optimum-intel/pull/1646
- @hf-security-analysis[bot] made their first contribution in https://github.com/huggingface/optimum-intel/pull/1663
- @paulinebm made their first contribution in https://github.com/huggingface/optimum-intel/pull/1671
- @rtrompier made their first contribution in https://github.com/huggingface/optimum-intel/pull/1685
- @xufang-lisa made their first contribution in https://github.com/huggingface/optimum-intel/pull/1637
- @openvino-agent made their first contribution in https://github.com/huggingface/optimum-intel/pull/1653
- @Lyamin-Roman made their first contribution in https://github.com/huggingface/optimum-intel/pull/1740
What's Changed
Full Changelog: https://github.com/huggingface/optimum-intel/compare/v1.27.0...v2.0.0
Compatible with transformers>=v4.45,<v5.1
- v1.27.0v1.27.0: Transformers 4.56/4.57, Zamba2, BitNet, Granite-4, Exaone-4, LFM22025-12-23 · 2025-12-23 16:08 UTC
查看更新说明
️🏗 New architectures support
- Add OpenVINO support for Zamba2 by @rkazants in https://github.com/huggingface/optimum-intel/pull/1354
- Add OpenVINO support for BitNet by @rkazants in https://github.com/huggingface/optimum-intel/pull/1518
- Add OpenVINO support for LFM2 by @popovaan in https://github.com/huggingface/optimum-intel/pull/1515
- Add OpenVINO support for EXAONE 4.0 by @zhaohb in https://github.com/huggingface/optimum-intel/pull/1491
- Add OpenVINO support for Granite-4.0 family by @rkazants in https://github.com/huggingface/optimum-intel/pull/1514
🧹 Deprecations
- Removed
nf4_fp8quantization modes by @ljaljushkin in https://github.com/huggingface/optimum-intel/pull/1493 - Add depreciation warnings for INC and IPEX by @echarlaix in https://github.com/huggingface/optimum-intel/pull/1568
🔧 Enhancements & Fixes
- [OpenVINO] Transformers 4.56/4.57 support by @IlyasMoutawwakil in https://github.com/huggingface/optimum-intel/pull/1541
- [OpenVINO] Fix OpenVINO model inference not being affected by static quantization by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1461
- [IPEX] Fix IPEX models for transformers v4.55 by @kaixuanliu in https://github.com/huggingface/optimum-intel/pull/1485
- [OpenVINO]Add default config for Qwen3-30B-A3B by @ljaljushkin in https://github.com/huggingface/optimum-intel/pull/1506
- [OpenVINO] Fix
preprocess_inputsmethod for Gemma3 by @rkazants in https://github.com/huggingface/optimum-intel/pull/1507 - [IPEX] Fix IPEX models
can_compilemethod by @jiqing-feng in https://github.com/huggingface/optimum-intel/pull/1511 - [OpenVINO] Fix TasksManager._TRANSFORMERS_TASKS_TO_MODEL_LOADERS by @echarlaix in https://github.com/huggingface/optimum-intel/pull/1501
- [OpenVINO] Add default int4 config for inceptionai/jais-13b by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1519
- [OpenVINO] Add
cache_positioninput insideprepare_inputsmethod for Mamba by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1517 - [OpenVINO] Refactor from_pretrained quantization by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1520
- [OpenVINO] fix bug for attention_mask when model is not patched by @kaixuanliu in https://github.com/huggingface/optimum-intel/pull/1526
- [OpenVINO] Add custom int4 config for SmolVLM2-256M-Video by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1532
- [OpenVINO] Fix whisper inference for models exported without pkv by @echarlaix in https://github.com/huggingface/optimum-intel/pull/1534
- [OpenVINO] Optimize IR for Mamba models by @rkazants in https://github.com/huggingface/optimum-intel/pull/1538
- [OpenVINO] NNCF 2.19 update by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1522
- [OpenVINO] Update optimum-intel to OV 2025.4 release by @rkazants in https://github.com/huggingface/optimum-intel/pull/1544
- [OpenVINO] Update InferRequestWrapper to collect samples depending on stateful models state by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1505
- [OpenVINO] Add gsm8k as a dataset option for CausalLM quantization by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1547
- [OpenVINO] Take into account that
pillowmay be not installed by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1546 - [OpenVINO] Refactor CLI quantization by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1525
- [OpenVINO] Streamline opevino-genai base pipelines testing by @IlyasMoutawwakil in https://github.com/huggingface/optimum-intel/pull/1545
- [OpenVINO] Fix VLM mixed quantization by @nikita-savelyevv in https://github.com/huggingface/optimum-intel/pull/1553
- [OpenVINO] Remove using nncf.torch.patch_torch_operators by @AlexanderDokuchaev in https://github.com/huggingface/optimum-intel/pull/1555
- [OpenVI
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Optimum Intel
🤗 Optimum Intel is the interface between the 🤗 Transformers, Diffusers, Sentence Transformers and timm libraries and the different tools and libraries provided by OpenVINO to accelerate end-to-end pipelines on Intel architectures.
OpenVINO is an open-source toolkit that enables high performance inference capabilities for Intel CPUs, GPUs, and special DL inference accelerators (see the full list of supported devices). It is supplied with a set of tools to optimize your models with compression techniques such as quantization, pruning and knowledge distillation. Optimum Intel provides a simple interface to optimize your model, convert it to the OpenVINO Intermediate Representation (IR) format and run inference using OpenVINO Runtime.
Installation
To install the latest release of 🤗 Optimum Intel with the corresponding required dependencies, you can use pip as follows:
pip install -U optimum-intel
Optimum Intel is a fast-moving project with regular additions of new model support, so you may want to install from source with the following command:
pip install optimum-intel@git+https://github.com/huggingface/optimum-intel.git
Export:
To export your model to OpenVINO IR format, use the optimum-cli tool. Below is an example of exporting TinyLlama/TinyLlama_v1.1 model:
optimum-cli export openvino --model TinyLlama/TinyLlama_v1.1 ov_TinyLlama_v1_1
To export a model hosted on the Hub you can use our space. After conversion, a repository will be pushed under your namespace, this repository can be either public or private.
Additional information on exporting models is available in the documentation.
Inference:
To load an exported model and run inference using Optimum Intel, use the corresponding OVModelForXxx class instead of AutoModelForXxx:
from optimum.intel import OVModelForCausalLM
from transformers import AutoTokenizer, pipeline
model_id = "ov_TinyLlama_v1_1"
model = OVModelForCausalLM.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
results = pipe("Hey, how are you doing today?", max_new_tokens=100)
For more details on Optimum Intel inference, refer to the documentation.
Note: Alternatively, an exported model can also be inferred using OpenVINO GenAI framework, that provides optimized execution methods for highly performant Generative AI.
Quantization:
Post-training static quantization can also be applied. Here is an example on how to apply static quantization on a Whisper model using the LibriSpeech dataset for the calibration step.
from optimum.intel import OVModelForSpeechSeq2Seq, OVQuantizationConfig
model_id = "openai/whisper-tiny"
q_config = OVQuantizationConfig(dtype="int8", dataset="librispeech", num_samples=50)
q_model = OVModelForSpeechSeq2Seq.from_pretrained(model_id, quantization_config=q_config)
# The directory where the quantized model will be saved
save_dir = "nncf_results"
q_model.save_pretrained(save_dir)
You can find more information in the documentation.
Running the examples
Check out the notebooks directory to see how 🤗 Optimum Intel can be used to optimize models and accelerate inference.
Do not forget to install requirements for every example:
cd <example-folder>
pip install -r requirements.txt