---
title: "Optimize and deploy with Optimum-Intel and OpenVINO GenAI"
description: "Hugging Face Transformers LLMs can be exported to OpenVINO IR with Optimum-Intel, quantized with NNCF, and deployed through the lightweight OpenVINO GenAI LLMPipeline from Python or C++."
url: "https://swe.quest/articles/optimize-and-deploy-with-optimum-intel-and-openvino-genai-bbd6caef1a74949e"
canonical: "https://huggingface.co/blog/deploy-with-openvino"
source: "Hugging Face"
published: "2024-09-20"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["inference","llms","c-cpp","python"]
---

# Optimize and deploy with Optimum-Intel and OpenVINO GenAI

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-09-20, 6 min read, How-to. Original: [https://huggingface.co/blog/deploy-with-openvino](https://huggingface.co/blog/deploy-with-openvino)

## Summary

Hugging Face Transformers LLMs can be exported to OpenVINO IR with Optimum-Intel, quantized with NNCF, and deployed through the lightweight OpenVINO GenAI LLMPipeline from Python or C++. Models over one billion parameters default to INT8 weights during export. For Llama 3.1 8B the recommendation is to stack AWQ, scale estimation and mixed INT4/INT8 quantization using a calibration dataset. Wikitext perplexity goes from 7.34 in FP32 to 7.35 at INT8 and 7.83 at INT4. Code examples cover export via API and CLI, generation config, streaming, and chat mode that reuses the KV cache across turns.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [C & C++](https://swe.quest/tags/c-cpp.md) (Languages)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Hugging Face Transformers
- LLM quantization basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- C++ build basics ([easy posts on C & C++](https://swe.quest/tags/c-cpp.md?difficulty=easy))

## Keywords

OpenVINO, OpenVINO GenAI, Optimum-Intel, NNCF, AWQ, Llama 3.1, lm-evaluation-harness

## Related posts

- [Quanto: a PyTorch quantization backend for Optimum](https://swe.quest/articles/quanto-a-pytorch-quantization-backend-for-optimum-8330ba5aea428b63.md): Hugging Face · 2024-03-18 · Medium · 5 min read · Inference & serving, Python, Machine learning, Open source
  Quanto is a PyTorch quantization backend for Optimum that works in eager mode on any device (CPU, CUDA, MPS), supports int2/int4/int8/float8 weights and int8/float8 activations, and accelerates int8-int8, fp16-int4, bf16-int8 and bf16-int4 matmuls on CUDA.
- [Get your VLM running in 3 simple steps on Intel CPUs](https://swe.quest/articles/get-your-vlm-running-in-3-simple-steps-on-intel-cpus-59cb207ffcd00762.md): Hugging Face · 2025-10-15 · Medium · 7 min read · Inference & serving, LLMs, Computer vision, Performance engineering
  SmolVLM2-256M can run locally on Intel CPUs by converting it to OpenVINO IR with Optimum Intel, quantizing it, and running generation, with optional Intel GPU offload via device="gpu".
- [Accelerate your models with 🤗 Optimum Intel and OpenVINO](https://swe.quest/articles/accelerate-your-models-with-optimum-intel-and-openvino-6481f69a8bf224aa.md): Hugging Face · 2022-11-02 · Medium · 5 min read · Inference & serving, Python, Hardware, Computer vision
  Optimum Intel now integrates OpenVINO, letting Transformers models run on OpenVINO Runtime across Intel processors and be quantized with the Neural Network Compression Framework (NNCF).
- [Make your llama generation time fly with AWS Inferentia2](https://swe.quest/articles/make-your-llama-generation-time-fly-with-aws-inferentia2-bc8b5e1981a590c0.md): Hugging Face · 2023-11-07 · Medium · 7 min read · Inference & serving, LLMs, Hardware, Cloud platforms, Performance engineering
  optimum-neuron can now compile and export Llama 2 models for text generation on AWS Inferentia2, using static input shapes (batch size, 2048 sequence length that also bounds the KV cache) and a configurable core count and fp16 precision.
- [Smaller is better: Q8-Chat, an efficient generative AI experience on Xeon](https://swe.quest/articles/smaller-is-better-q8-chat-an-efficient-generative-ai-experience-on-xeon-67e9bd0a15445b38.md): Hugging Face · 2023-05-16 · Easy · 5 min read · Inference & serving, LLMs, Hardware
  SmoothQuant enables accurate 8-bit (INT8) post-training quantization of LLMs by mathematically shifting activation outliers into the weights, which makes Transformer layers quantization-friendly.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
