LiquidAI / LFM2.5-1.2B-Instruct-ONNX

huggingface.co
Total runs: 4.1K
24-hour runs: 0
7-day runs: 503
30-day runs: 2.7K
Model's Last Updated: February 17 2026
text-generation

Introduction of LFM2.5-1.2B-Instruct-ONNX

Model Details of LFM2.5-1.2B-Instruct-ONNX

LFM2.5-1.2B-Instruct-ONNX

ONNX export of LFM2.5-1.2B-Instruct for cross-platform inference.

LFM2.5 is a hybrid architecture combining multiplicative gates and short convolutions, optimized for edge deployment with fast inference on CPU, GPU, and NPU hardware.

Recommended Variants
Precision Size Use Case
Q4 ~1.2GB Recommended for most uses
FP16 ~2.4GB Higher quality
Q8 ~1.7GB Balance of quality and size
Model Files
onnx/
├── model.onnx              # FP32
├── model_fp16.onnx         # FP16
├── model_q4.onnx           # Q4 (recommended)
└── model_q8.onnx           # Q8
Python
Installation
pip install onnxruntime transformers numpy huggingface_hub
# or with GPU support:
pip install onnxruntime-gpu transformers numpy huggingface_hub
Inference
import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer

# Download model (Q4 recommended)
model_id = "LiquidAI/LFM2.5-1.2B-Instruct-ONNX"
model_path = hf_hub_download(model_id, "onnx/model_q4.onnx")
data_path = hf_hub_download(model_id, "onnx/model_q4.onnx_data")

# Load model and tokenizer
session = ort.InferenceSession(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)

# Prepare chat input
messages = [{"role": "user", "content": "What is the capital of France?"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
input_ids = np.array([tokenizer.encode(prompt, add_special_tokens=False)], dtype=np.int64)

# Initialize KV cache
ONNX_DTYPE = {"tensor(float)": np.float32, "tensor(float16)": np.float16, "tensor(int64)": np.int64}
cache = {}
for inp in session.get_inputs():
    if inp.name in {"input_ids", "attention_mask", "position_ids"}:
        continue
    shape = [d if isinstance(d, int) else 1 for d in inp.shape]
    for i, d in enumerate(inp.shape):
        if isinstance(d, str) and "sequence" in d.lower():
            shape[i] = 0
    cache[inp.name] = np.zeros(shape, dtype=ONNX_DTYPE.get(inp.type, np.float32))

# Check if model uses position_ids
input_names = {inp.name for inp in session.get_inputs()}
use_position_ids = "position_ids" in input_names

# Generate tokens
seq_len = input_ids.shape[1]
generated_tokens = []

for step in range(100):  # max tokens
    if step == 0:
        ids = input_ids
        pos = np.arange(seq_len, dtype=np.int64).reshape(1, -1)
    else:
        ids = np.array([[generated_tokens[-1]]], dtype=np.int64)
        pos = np.array([[seq_len + len(generated_tokens) - 1]], dtype=np.int64)

    attn_mask = np.ones((1, seq_len + len(generated_tokens)), dtype=np.int64)
    feed = {"input_ids": ids, "attention_mask": attn_mask, **cache}
    if use_position_ids:
        feed["position_ids"] = pos

    outputs = session.run(None, feed)
    next_token = int(np.argmax(outputs[0][0, -1]))
    generated_tokens.append(next_token)

    # Update cache
    for i, out in enumerate(session.get_outputs()[1:], 1):
        name = out.name.replace("present_conv", "past_conv").replace("present.", "past_key_values.")
        if name in cache:
            cache[name] = outputs[i]

    if next_token == tokenizer.eos_token_id:
        break

print(tokenizer.decode(generated_tokens, skip_special_tokens=True))
License

This model is released under the LFM 1.0 License .

Runs of LiquidAI LFM2.5-1.2B-Instruct-ONNX on huggingface.co

4.1K
Total runs
0
24-hour runs
79
3-day runs
503
7-day runs
2.7K
30-day runs

More Information About LFM2.5-1.2B-Instruct-ONNX huggingface.co Model

More LFM2.5-1.2B-Instruct-ONNX license Visit here:

https://choosealicense.com/licenses/lfm1.0

LFM2.5-1.2B-Instruct-ONNX huggingface.co

LFM2.5-1.2B-Instruct-ONNX huggingface.co is an AI model on huggingface.co that provides LFM2.5-1.2B-Instruct-ONNX's model effect (), which can be used instantly with this LiquidAI LFM2.5-1.2B-Instruct-ONNX model. huggingface.co supports a free trial of the LFM2.5-1.2B-Instruct-ONNX model, and also provides paid use of the LFM2.5-1.2B-Instruct-ONNX. Support call LFM2.5-1.2B-Instruct-ONNX model through api, including Node.js, Python, http.

LFM2.5-1.2B-Instruct-ONNX huggingface.co Url

https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct-ONNX

LiquidAI LFM2.5-1.2B-Instruct-ONNX online free

LFM2.5-1.2B-Instruct-ONNX huggingface.co is an online trial and call api platform, which integrates LFM2.5-1.2B-Instruct-ONNX's modeling effects, including api services, and provides a free online trial of LFM2.5-1.2B-Instruct-ONNX, you can try LFM2.5-1.2B-Instruct-ONNX online for free by clicking the link below.

LiquidAI LFM2.5-1.2B-Instruct-ONNX online free url in huggingface.co:

https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct-ONNX

LFM2.5-1.2B-Instruct-ONNX install

LFM2.5-1.2B-Instruct-ONNX is an open source model from GitHub that offers a free installation service, and any user can find LFM2.5-1.2B-Instruct-ONNX on GitHub to install. At the same time, huggingface.co provides the effect of LFM2.5-1.2B-Instruct-ONNX install, users can directly use LFM2.5-1.2B-Instruct-ONNX installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

LFM2.5-1.2B-Instruct-ONNX install url in huggingface.co:

https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct-ONNX

Url of LFM2.5-1.2B-Instruct-ONNX

LFM2.5-1.2B-Instruct-ONNX huggingface.co Url

Provider of LFM2.5-1.2B-Instruct-ONNX huggingface.co

LiquidAI
ORGANIZATIONS

Other API from LiquidAI

huggingface.co

Total runs: 119.0K
Run Growth: 76.2K
Growth Rate: 64.05%
Updated:April 02 2026
huggingface.co

Total runs: 104.2K
Run Growth: 78.6K
Growth Rate: 75.40%
Updated:March 30 2026
huggingface.co

Total runs: 100.4K
Run Growth: 58.9K
Growth Rate: 58.70%
Updated:February 13 2026
huggingface.co

Total runs: 94.9K
Run Growth: 25.8K
Growth Rate: 27.18%
Updated:March 30 2026
huggingface.co

Total runs: 20.2K
Run Growth: -12.8K
Growth Rate: -63.43%
Updated:March 30 2026
huggingface.co

Total runs: 15.0K
Run Growth: -24.0K
Growth Rate: -159.48%
Updated:March 30 2026
huggingface.co

Total runs: 11.9K
Run Growth: -170
Growth Rate: -1.43%
Updated:March 30 2026
huggingface.co

Total runs: 9.6K
Run Growth: -1.9K
Growth Rate: -19.52%
Updated:March 30 2026
huggingface.co

Total runs: 6.5K
Run Growth: 449
Growth Rate: 6.86%
Updated:March 30 2026
huggingface.co

Total runs: 3.8K
Run Growth: -692
Growth Rate: -18.35%
Updated:March 30 2026