LFM3-1.7B-int8-ov

Description

This is LFM3-1.7B model converted to the OpenVINO™ IR (Intermediate Representation) format with weights compressed to INT8 by NNCF.

Quantization Parameters

Weight compression was performed using optimum-cli export openvino (nncf.compress_weights) with the following parameters:

  • mode: INT8_ASYM

For more information on quantization, check the OpenVINO model optimization guide.

Compatibility

The provided OpenVINO™ IR model is compatible with:

  • OpenVINO version 2026.5.0 (currently available as nightly builds) and higher
  • OpenVINO GenAI version 2026.5.0 (currently available as nightly builds) and higher
  • Optimum Intel with LFM3 support from huggingface/optimum-intel#2087 (until it is merged and released)

Running Model Inference with Optimum Intel

  1. Install packages required for using Optimum Intel integration with the OpenVINO backend:
pip install "git+https://github.com/huggingface/optimum-intel.git@refs/pull/2087/head" --extra-index-url https://download.pytorch.org/whl/cpu
pip install -U --pre openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
pip install "transformers==5.20.0"
  1. Run model inference:
from transformers import AutoTokenizer
from optimum.intel.openvino import OVModelForCausalLM

model_id = "OpenVINO/LFM3-1.7B-int8-ov"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = OVModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)

messages = [{"role": "user", "content": "What is OpenVINO?"}]
inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, enable_thinking=False, return_dict=True, return_tensors="pt"
)
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True))

Reasoning is enabled by default in the model chat template. Remove enable_thinking=False to let the model think before answering.

For more examples and possible optimizations, refer to the Inference with Optimum Intel.

Running Model Inference with OpenVINO GenAI

  1. Install packages required for using OpenVINO GenAI.
pip install -U --pre openvino-genai --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
pip install huggingface_hub
  1. Download model from HuggingFace Hub
import huggingface_hub as hf_hub

model_id = "OpenVINO/LFM3-1.7B-int8-ov"
model_path = "LFM3-1.7B-int8-ov"

hf_hub.snapshot_download(model_id, local_dir=model_path)
  1. Run model inference:
import openvino_genai as ov_genai

device = "CPU"
pipe = ov_genai.LLMPipeline(model_path, device)

history = ov_genai.ChatHistory([{"role": "user", "content": "What is OpenVINO?"}])
# Reasoning is enabled by default; disable it for a direct answer.
history.set_extra_context({"enable_thinking": False})
print(pipe.generate(history, max_new_tokens=200))

More GenAI usage examples can be found in OpenVINO GenAI library docs and samples.

You can find more detailed usage examples in OpenVINO Notebooks:

Running Model with OpenAI client and OpenVINO Model Server

Use an OVMS build that includes OpenVINO and OpenVINO GenAI 2026.5.0 or higher with LFM3 support. If the latest Docker image does not yet include these versions, replace it with a compatible build.

1a. Deploy model on Windows using the binary package:

mkdir C:\models
ovms.exe --rest_port 8000 --source_model OpenVINO/LFM3-1.7B-int8-ov --model_repository_path C:\models --target_device CPU --task text_generation

1b. Deploy model in a Docker container on Linux:

mkdir -p ${HOME}/models
docker run --rm --user $(id -u):$(id -g) -p 8000:8000 -v ${HOME}/models:/models openvino/model_server:latest --rest_port 8000 --source_model OpenVINO/LFM3-1.7B-int8-ov --model_repository_path /models --target_device CPU --task text_generation
  1. Install the client library:
pip install openai
  1. Wait for the model to load, then run the client:
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v3", api_key="unused")
stream = client.chat.completions.create(
    model="OpenVINO/LFM3-1.7B-int8-ov",
    messages=[{"role": "user", "content": "What is OpenVINO?"}],
    max_tokens=200,
    stream=True,
    extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content is not None:
        print(chunk.choices[0].delta.content, end="", flush=True)
print()

Reasoning is enabled by default in the model chat template. Remove extra_body to let the model think before answering.

Limitations

Check the original model card for limitations.

Legal information

The original model is distributed under the LFM Open License v1.0. More details can be found in LFM3-1.7B.

Disclaimer

Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See Intel's Global Human Rights Principles. Intel's products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights.

Downloads last month
45
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for OpenVINO/LFM3-1.7B-int8-ov

Quantized
(85)
this model

Collection including OpenVINO/LFM3-1.7B-int8-ov