Views
No views yet
LiquidAI/LFM2.5-2.6B quantized for Intel AI Boost NPU, using the same NPU-correct recipe as the sibling mosesman/LFM2-2.6B-openvino-int4-npu build.--weight-format int4 --sym --group-size 128 --backup-precision int8_sym--backup-precision int8_sym) keeps NPU arithmetic zero-point-free, which the NPU executes cleanly.<|im_start|> / <|im_end|>), tool-call supportpip install openvino openvino-genai transformers1import openvino_genai as ov_genai
2from transformers import AutoTokenizer
3
4model_id = "mosesman/LFM2.5-2.6B-openvino-int4-npu"
5device = "NPU" # or "GPU" / "CPU"
6
7tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
8prompt = tokenizer.apply_chat_template(
9 [{"role": "user", "content": "What is 17*19? Reply with only the number."}],
10 tokenize=False,
11 add_generation_prompt=True,
12)
13
14pipe = ov_genai.LLMPipeline(model_id, device)
15config = ov_genai.GenerationConfig()
16config.max_new_tokens = 128
17config.do_sample = False
18
19print(pipe.generate(prompt, config))"NPU" (not AUTO / HETERO). Tokenizer/detokenizer glue may still use CPU; model compute stays on NPU.temperature 0.1, top_k 50, repetition_penalty 1.1..blob / driver caches under local temp / cache dirs), so subsequent cold starts usually launch in seconds. Later generates in the same process are much faster either way.OVModelForCausalLM)pip install "optimum[openvino]" transformers1from optimum.intel.openvino import OVModelForCausalLM
2from transformers import AutoTokenizer, pipeline
3
4model_id = "mosesman/LFM2.5-2.6B-openvino-int4-npu"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
7model = OVModelForCausalLM.from_pretrained(model_id, device="NPU")
8
9pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
10messages = [{"role": "user", "content": "What is 17*19? Reply with only the number."}]
11prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
12print(pipe(prompt, max_new_tokens=32, do_sample=False)[0]["generated_text"])run_lfm_device.py (NPU -> GPU -> CPU fallback):python run_lfm_device.py --device NPU --greedy1optimum-cli export openvino \
2 --model LiquidAI/LFM2.5-2.6B \
3 --trust-remote-code \
4 --weight-format int4 \
5 --sym \
6 --group-size 128 \
7 --backup-precision int8_sym \
8 ./LFM2.5-2.6B-openvino-int4-npuoptimum-intel 2.1.0nncf 3.3.0openvino / openvino-genai 2026.3.0transformers 5.4.0 (LFM2.5's config rejects newer Transformers - ValueError: Maximum required is 5.4.0)| Device | Approx. tok/s | Notes |
|---|---|---|
| Arc 140V (GPU) | ~59 | fastest |
| CPU | ~35 | quick load |
| AI Boost (NPU) | ~20 | lowest power; slow first compile |
32.0.100.4841; OpenVINO notes recommend >= 32.0.100.4621 on Windows)openvino_model.xml / .binopenvino_tokenizer.xml / .binopenvino_detokenizer.xml / .binLiquidAI/LFM2.5-2.6B under the LFM Open License v1.0 (lfm1.0).LICENSE (copied from the base model)LiquidAI/LFM2.5-2.6B.