Views
No views yet
| File | Format | Embedding | Weights | Cache / activations | Approx. size |
|---|---|---|---|---|---|
onnx/model.onnx | FP32 | FP32 | FP32 | FP32 | 4.7 GB |
onnx/model_fp16.onnx | FP16 | FP16 | FP16 | FP16 | 2.4 GB |
onnx/model_q4.onnx | INT4 | INT4 (GatherBlockQuantized) | INT4 (MatMulNBits) | FP32 | 834 MB |
onnx/model_q4f16.onnx | INT4 + FP16 | INT4 + FP16 scales | INT4 + FP16 scales | FP16 | 744 MB |
onnx/model_q4f32.onnx | INT4 (MatMul-only) | FP32 (kept) | INT4 (MatMulNBits) | FP32 | 1.2 GB |
onnx/model_q8.onnx | INT8 (MatMul-only) | FP32 (kept) | INT8 (MatMulNBits) | FP32 | 1.8 GB |
model_q4f16.onnxis the recommended variant for WebGPU: INT4 weights with FP16 scales, FP16 KV cache and conv state I/O, FP32 logits via an inserted Cast — the format Transformers.js targets for browser inference.
.onnx file ships its weights in one or more .onnx_data chunks (≤ 2 GB each, per the ONNX external-data convention).1import { pipeline } from "@huggingface/transformers";
2
3const generator = await pipeline(
4 "text-generation",
5 "LiquidAI/LFM2.5-1.2B-JP-202606-ONNX",
6 { dtype: "q4f16", device: "webgpu" }
7);
8
9const messages = [
10 { role: "system", content: "You are a helpful assistant trained by Liquid AI." },
11 { role: "user", content: "日本の首都は?" },
12];
13
14const output = await generator(messages, {
15 max_new_tokens: 256,
16 do_sample: true,
17 temperature: 0.1,
18 top_k: 50,
19 repetition_penalty: 1.05,
20});
21console.log(output[0].generated_text);1import numpy as np
2import onnxruntime as ort
3from transformers import AutoTokenizer
4
5REPO = "LiquidAI/LFM2.5-1.2B-JP-202606-ONNX"
6tokenizer = AutoTokenizer.from_pretrained(REPO)
7session = ort.InferenceSession("onnx/model_q4.onnx", providers=["CPUExecutionProvider"])
8
9# Map ORT type names to numpy dtypes so fp16 / q4f16 variants work too.
10ORT_DTYPE = {"tensor(float)": np.float32, "tensor(float16)": np.float16, "tensor(int64)": np.int64}
11
12prompt = tokenizer.apply_chat_template(
13 [{"role": "user", "content": "日本の首都は?"}],
14 tokenize=False,
15 add_generation_prompt=True,
16)
17input_ids = np.array([tokenizer.encode(prompt, add_special_tokens=False)], dtype=np.int64)
18seq_len = input_ids.shape[1]
19
20feed = {
21 "input_ids": input_ids,
22 "attention_mask": np.ones((1, seq_len), dtype=np.int64),
23 "position_ids": np.arange(seq_len, dtype=np.int64).reshape(1, -1),
24}
25for inp in session.get_inputs():
26 if inp.name not in feed:
27 shape = [d if isinstance(d, int) else 1 for d in inp.shape]
28 feed[inp.name] = np.zeros(shape, dtype=ORT_DTYPE[inp.type])
29
30logits = session.run(None, feed)[0]
31next_id = int(np.argmax(logits[0, -1]))
32print(tokenizer.decode([next_id]))temperature: 0.1top_k: 50repetition_penalty: 1.05| Model | Description |
|---|---|
| LFM2.5-1.2B-JP-202606 | Original checkpoint in native format. Best for fine-tuning or inference with Transformers and vLLM. |
| LFM2.5-1.2B-JP-202606-GGUF | Quantized format for llama.cpp and compatible tools. |
| LFM2.5-1.2B-JP-202606-ONNX | ONNX Runtime format for cross-platform deployment (ORT, Transformers.js, WebGPU). |
| LFM2.5-1.2B-JP-202606-MLX-8bit | MLX format for Apple Silicon. |
<|startoftext|><|im_start|>system
You are a helpful assistant trained by Liquid AI.<|im_end|>
<|im_start|>user
日本の首都は?<|im_end|>
<|im_start|>assistanttokenizer.apply_chat_template() to format messages automatically — the included tokenizer.json and chat_template.jinja work unchanged across Transformers, Transformers.js, and ORT.<|tool_call_start|>[fn(...)]<|tool_call_end|>). See the Tool Use documentation for the full guide.1uv run lfm2-export LiquidAI/LFM2.5-1.2B-JP-202606 --precision
2# (plus a one-shot Q4 → Q4F16 conversion using lfm2_moe.export.convert_q4_to_fp16)1@article{liquidai2025lfm2,
2 title={LFM2 Technical Report},
3 author={Liquid AI},
4 journal={arXiv preprint arXiv:2511.23404},
5 year={2025}
6}