Instructions to use plavno/LFM2.5-2.6B-AutoRound-W8A16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use plavno/LFM2.5-2.6B-AutoRound-W8A16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="plavno/LFM2.5-2.6B-AutoRound-W8A16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("plavno/LFM2.5-2.6B-AutoRound-W8A16") model = AutoModelForCausalLM.from_pretrained("plavno/LFM2.5-2.6B-AutoRound-W8A16", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use plavno/LFM2.5-2.6B-AutoRound-W8A16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "plavno/LFM2.5-2.6B-AutoRound-W8A16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "plavno/LFM2.5-2.6B-AutoRound-W8A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/plavno/LFM2.5-2.6B-AutoRound-W8A16
- SGLang
How to use plavno/LFM2.5-2.6B-AutoRound-W8A16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "plavno/LFM2.5-2.6B-AutoRound-W8A16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "plavno/LFM2.5-2.6B-AutoRound-W8A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "plavno/LFM2.5-2.6B-AutoRound-W8A16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "plavno/LFM2.5-2.6B-AutoRound-W8A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use plavno/LFM2.5-2.6B-AutoRound-W8A16 with Docker Model Runner:
docker model run hf.co/plavno/LFM2.5-2.6B-AutoRound-W8A16
LFM2.5-2.6B — AutoRound W8A16 (8-bit weights / fp16 activations)
8-bit weight-only quantization of LiquidAI/LFM2.5-2.6B,
produced with Intel AutoRound and packed for
GPTQ/Marlin kernels so it runs on vLLM without any extra flags.
Built and released by Plavno.
This is the accuracy-preserving variant. A smaller 4-bit sibling is available at
plavno/LFM2.5-2.6B-AutoRound-W4A16,
but it carries a real quality cost — see Choosing between the two.
Quantization details
| Method | AutoRound (signed-gradient rounding optimization) |
| Weight precision | 8-bit integer, symmetric |
| Activations | fp16 (not quantized) |
| Group size | 128 |
| Packing format | auto_round:auto_gptq |
| Quantized modules | 166 of 167 — all model.layers linear projections |
| Kept in higher precision | lm_head |
| Calibration | conversational multilingual text, 256 samples × 512 tokens, balanced 16×16 across all 16 supported languages |
| Weights on disk | ~2.9 GB (vs ~5.4 GB bf16) |
Calibration
This build and its 4-bit sibling
plavno/LFM2.5-2.6B-AutoRound-W4A16
were calibrated on the same language-balanced set — the only difference between the
two repos is the weight bit width.
The set is conversational multilingual text: 256 samples of 512 tokens, with an exactly equal share of 16 samples per language across all 16 languages the base model supports:
Arabic · Chinese · English · French · German · Hindi · Indonesian · Italian · Japanese · Korean · Polish · Portuguese · Russian · Spanish · Thai · Vietnamese
Calibration was deliberately balanced rather than English-only, so that quantization error is not concentrated on the non-English languages. The register is conversational (utterance-level) rather than encyclopedic prose, which suits dialogue and speech-derived workloads.
Running on vLLM
LFM2 is natively supported from vLLM 0.23.0 onward. The quantization is detected
automatically from config.json, so no --quantization flag is needed.
pip install "vllm>=0.23"
vllm serve plavno/LFM2.5-2.6B-AutoRound-W8A16 \
--max-model-len 4096 \
--gpu-memory-utilization 0.90
Add --enable-prefix-caching when many requests share a long common prefix
(system prompt, few-shot block, shared context) — only the new suffix is then
prefilled on each request:
vllm serve plavno/LFM2.5-2.6B-AutoRound-W8A16 \
--enable-prefix-caching \
--max-model-len 4096
Query the OpenAI-compatible endpoint:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "plavno/LFM2.5-2.6B-AutoRound-W8A16",
"messages": [{"role": "user", "content": "Say hi in one word."}],
"max_tokens": 16
}'
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
resp = client.chat.completions.create(
model="plavno/LFM2.5-2.6B-AutoRound-W8A16",
messages=[{"role": "user", "content": "List three primary colors."}],
max_tokens=64,
)
print(resp.choices[0].message.content)
Offline batch inference
from vllm import LLM, SamplingParams
llm = LLM(model="plavno/LFM2.5-2.6B-AutoRound-W8A16", max_model_len=4096)
out = llm.generate(
["Explain what a REST API is in two sentences."],
SamplingParams(temperature=0, max_tokens=128),
)
print(out[0].outputs[0].text)
Choosing between the two
| W8A16 (this repo) | W4A16 | |
|---|---|---|
| Weights on disk | ~2.9 GB | ~1.7 GB |
| Quality vs bf16 | near-lossless | noticeable degradation, uneven across languages |
| Best for | accuracy-sensitive work, multilingual input, reading token logprobs | tight VRAM budgets, maximum decode throughput |
Pick this 8-bit build when output quality matters, when the workload is multilingual, or when you read token-level logprobs (classification, routing, scoring) — the 4-bit build shifts the output distribution enough to affect those.
Pick the 4-bit build when VRAM is the binding constraint or when decode throughput matters more than fidelity.
Notes
- Short convolution layers of the LFM2 architecture and
lm_headstay in higher precision; this is expected and correct for this architecture. - The chat template opens a reasoning block (
<think>) in the generation prompt. If you need a bare single-token answer (classification, routing), drive/v1/completionswith your own prompt and close the block yourself (<think></think>) rather than relying on/v1/chat/completions. - 8-bit weight-only quantization reduces the bytes moved per decode step, which helps memory-bandwidth-bound generation. It does not speed up compute-bound prefill, where the dequantization step is additional work.
License
Inherits the license of the base model, LFM Open License v1.0. Refer to the base model card for intended use and limitations.
Quantized and published by Plavno.
- Downloads last month
- -