Downloads · 30 days
12
12% of all-time downloads
mosesman/LFM2-2.6B-openvino-int4-npu
LFM2-2.6B-openvino-int4-npu is a text generation model from mosesman. Use it when you need the model to write or continue text. It is set up for openvino. The card lists the license as other.
OpenVINO IR export of LiquidAI/LFM2-2.6B quantized for Intel AI Boost NPU.
Downloads · 30 days
12
12% of all-time downloads
All-time downloads
102
Public
Repo size
1.4 GB
Likes
0
Public
Click a slice to open those files.
.bin1.4 GB · 99%
From the Hugging Face model README
OpenVINO IR export of LiquidAI/LFM2-2.6B quantized for Intel AI Boost NPU.
Default INT4 exports of LFM2 often produce garbled tokens on NPU. This build uses Intel’s documented NPU-friendly recipe:
--weight-format int4 --sym --group-size 128 --backup-precision int8_sym
Validated on:
2026.3.0, NPU driver 32.0.100.4841| Export | Backup layers | NPU |
|---|---|---|
Typical INT4 (int8_asym backup) | asymmetric / zero-points | ❌ garbled |
This repo (int8_sym backup) | symmetric INT8 | ✅ coherent |
~95% of weights remain INT4; only layers that cannot stay INT4 use INT8-symmetric backup.
pip install openvino openvino-genai transformers
import openvino_genai as ov_genai
from transformers import AutoTokenizer
model_id = "mosesman/LFM2-2.6B-openvino-int4-npu"
device = "NPU" # or "GPU" / "CPU"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "What is 17*19? Reply with only the number."}],
tokenize=False,
add_generation_prompt=True,
)
pipe = ov_genai.LLMPipeline(model_id, device)
config = ov_genai.GenerationConfig()
config.max_new_tokens = 128
config.do_sample = False
print(pipe.generate(prompt, config))
NPU-only tip: pass "NPU" (not AUTO / HETERO). Tokenizer/detokenizer glue may still use CPU; model compute stays on NPU.
The first NPU load can take ~1–2 minutes while OpenVINO / the NPU driver compiles the graph. OpenVINO caches the compiled blob (e.g. .blob / driver caches such as .cl_cache under local temp / cache dirs), so subsequent cold starts usually launch in seconds instead of recompiling from scratch. Later generates in the same process are much faster either way.
OVModelForCausalLM)pip install "optimum[openvino]" transformers
from optimum.intel.openvino import OVModelForCausalLM
from transformers import AutoTokenizer, pipeline
model_id = "mosesman/LFM2-2.6B-openvino-int4-npu"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = OVModelForCausalLM.from_pretrained(model_id, device="NPU")
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
messages = [{"role": "user", "content": "What is 17*19? Reply with only the number."}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
print(pipe(prompt, max_new_tokens=32, do_sample=False)[0]["generated_text"])
This folder includes run_lfm_device.py:
python run_lfm_device.py --device NPU --greedy
optimum-cli export openvino \
--model LiquidAI/LFM2-2.6B \
--trust-remote-code \
--weight-format int4 \
--sym \
--group-size 128 \
--backup-precision int8_sym \
./LFM2-2.6B-openvino-int4-npu
Tooling used for this build:
optimum-intel 2.1.0nncf 3.3.0openvino / openvino-genai 2026.3.0Greedy decode, ~120 new tokens, corrected INT4 IR:
| Device | Approx. tok/s | Notes |
|---|---|---|
| Arc 140V (GPU) | ~59 | fastest |
| CPU | ~35 | quick load |
| AI Boost (NPU) | ~20 | lowest power; slow first compile |
Exact numbers vary by driver, prompt length, and power mode.
32.0.100.4841; OpenVINO notes recommend ≥ 32.0.100.4621 on Windows)Also runs on Intel GPU / CPU via the same IR if needed.
OpenVINO GenAI layout:
openvino_model.xml / .binopenvino_tokenizer.xml / .binopenvino_detokenizer.xml / .binDerivative of LiquidAI/LFM2-2.6B under the LFM Open License v1.0 (lfm1.0).
LICENSE (copied from the base model)This repository redistributes a quantized derivative. Downstream commercial use remains subject to Liquid AI’s license terms (including the commercial revenue threshold).
Provided as-is for interoperability with Intel NPU / OpenVINO. Not affiliated with Liquid AI or Intel. Validate quality for your own workload before production use.
If you use LFM2, please cite Liquid AI’s model card / paper for LiquidAI/LFM2-2.6B.