alt.freeweights.lfm / LFM2-1.2B-ONNX
From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.lfmSubject:

LFM2-1.2B-ONNX

Date: 2026-11-15Commit: dd09594Signed: 2DC28CC7B26A283B ✓

Text generation model. Onnx weights, 11.4 GB in all. Published by onnx-community under LFM-1.0 (custom).

lfm11.4GBLFM2-1.2B-ONNXonnxcustom terms
FactsParamsnot statedSize11.4 GBFormatsonnxTasktext generationLicenseLFM-1.0 (custom)From sourcecustom termsread terms
# custom terms: read the license before you download
$ fw get onnx-community/LFM2-1.2B-ONNX
# manifest sha256 61542b10c981… · 11.4 GB · 24 files
$ fw verify ./LFM2-1.2B-ONNX onnx-community/LFM2-1.2B-ONNX
From sourceHosted (signed)onnx-community/LFM2-1.2B-ONNXLast check: 2026-11-15 00:22 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Quantized of LFM2-1.2B.

Works with

Runs with

Ranked by fit to this model (onnx), then by GitHub stars.

Convert with

Overview

Size
11.4 GB
Weights
760 MB (smallest of 6 ONNX variants)
Parameters
not stated
Formats
onnx
Task
text generation
License
LFM-1.0 (custom) (custom)
Files
24, each with a sha256
Publisher
onnx-community
Added
2026-11-15
Section
alt.freeweights.lfm
Lineage

Original release from the publisher.

Base model: LiquidAI/LFM2-1.2B

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 00:22 UTCpassed

Model card

From the publisher at commit dd09594. Shown as plain text with links; images open at the publisher.

Image: Liquid AI

https://playground.liquid.ai/chat

LFM2-1.2B#

LFM2 is a new generation of hybrid models developed by Liquid AI, specifically designed for edge AI and on-device deployment. It sets a new standard in terms of quality, speed, and memory efficiency.

We're releasing the weights of three post-trained checkpoints with 350M, 700M, and 1.2B parameters. They provide the following key features to create AI-powered edge applications:

  • Fast training & inference – LFM2 achieves 3x faster training compared to its previous generation. It also benefits from 2x faster decode and prefill speed on CPU compared to Qwen3.
  • Best performance – LFM2 outperforms similarly-sized models across multiple benchmark categories, including knowledge, mathematics, instruction following, and multilingual capabilities.
  • New architecture – LFM2 is a new hybrid Liquid model with multiplicative gates and short convolutions.
  • Flexible deployment – LFM2 runs efficiently on CPU, GPU, and NPU hardware for flexible deployment on smartphones, laptops, or vehicles.

Find more information about LFM2 in our blog post.

📄 Model details#

Due to their small size, we recommend fine-tuning LFM2 models on narrow use cases to maximize performance. They are particularly suited for agentic tasks, data extraction, RAG, creative writing, and multi-turn conversations. However, we do not recommend using them for tasks that are knowledge-intensive or require programming skills.

PropertyValue
Parameters1,170,340,608
Layers16 (10 conv + 6 attn)
Context length32,768 tokens
Vocabulary size65,536
Precisionbfloat16
Training budget10 trillion tokens
LicenseLFM Open License v1.0

Supported languages: English, Arabic, Chinese, French, German, Japanese, Korean, and Spanish.

Generation parameters: We recommend the following parameters:

  • temperature=0.3
  • min_p=0.15
  • repetition_penalty=1.05

Architecture: Hybrid model with multiplicative gates and short convolutions: 10 double-gated short-range LIV convolution blocks and 6 grouped query attention (GQA) blocks.

Pre-training mixture: Approximately 75% English, 20% multilingual, and 5% code data sourced from the web and licensed materials.

Training approach:

  • Knowledge distillation using LFM1-7B as teacher model
  • Very large-scale SFT on 50% downstream tasks, 50% general domains
  • Custom DPO with length normalization and semi-online datasets
  • Iterative model merging

🏃 How to run LFM2#

Transformers.js#

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

Example: Basic example

import { pipeline, TextStreamer } from "@huggingface/transformers";

// Create a text generation pipeline
const generator = await pipeline(
  "text-generation",
  "onnx-community/LFM2-1.2B-ONNX",
  { dtype: "q4", device: "webgpu" },
);

// Define the list of messages
const messages = [
  { role: "system", content: "You are a helpful assistant." },
  { role: "user", content: "What is the capital of France?" },
];

// Generate a response
const output = await generator(messages, {
    max_new_tokens: 512,
    do_sample: false,
    streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true }),
});
console.log(output[0].generated_text.at(-1).content);
// The capital of France is Paris.

Example: Tool calling

import { pipeline, TextStreamer } from "@huggingface/transformers";

// Create a text generation pipeline
const generator = await pipeline(
  "text-generation",
  "onnx-community/LFM2-1.2B-ONNX",
  { dtype: "q4", device: "webgpu" },
);

// Define the tools available to the model
const tools = [
  {
    name: "get_weather",
    description: "Get current weather information for a location",
    parameters: {
      type: "object",
      properties: {
        location: {
          type: "string",
          description: "The city and state, e.g. San Francisco, CA",
        },
        unit: {
          type: "string",
          enum: ["celsius", "fahrenheit"],
          description: "The unit of temperature to use",
        },
      },
      required: ["location"],
    },
  },
];

// Define the list of messages
const messages = [
  { role: "user", content: "What's the weather like in New York?" },
];

// Generate a response
const output = await generator(messages, {
    max_new_tokens: 512,
    do_sample: false,
    streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true }),
    tokenizer_encode_kwargs: { tools },
});
console.log(output[0].generated_text.at(-1).content);
// [get_weather(location="New York", unit="fahrenheit")]
ONNXRuntime#
from transformers import AutoConfig, AutoTokenizer
import onnxruntime
import numpy as np
from huggingface_hub import snapshot_download

# 1. Load config, processor, and model
model_id = "onnx-community/LFM2-700M-ONNX"
config = AutoConfig.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
eos_token_id = config.eos_token_id

filename = "model.onnx" # Options: "model.onnx", "model_fp16.onnx", "model_q4.onnx", "model_q4f16.onnx"
model_path = snapshot_download(repo_id=model_id, allow_patterns=f"onnx/{filename}*") # Download the graph + weights
session = onnxruntime.InferenceSession(f"{model_path}/onnx/{filename}")

# 2. Prepare inputs
prompt = "What is C. elegans?"
messages = [{"role": "user", "content": prompt}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="np")
input_ids = inputs['input_ids']
attention_mask = inputs['attention_mask']
batch_size = input_ids.shape[0]
num_logits_to_keep = np.array(1, dtype=np.int64)

past_cache_values = {}
for inp in session.get_inputs():
    name = inp.name
    shape = inp.shape
    dtype = np.float32 if inp.type == "tensor(float)" else np.float16
    if name.startswith("past_key_values"):
        # Attention KV cache: shape [batch_size, num_kv_heads, 0, head_dim]
        past_cache_values[name] = np.zeros([batch_size, shape[1], 0, shape[3]], dtype=dtype)
    elif name.startswith("past_conv"):
        # Conv cache: shape [batch_size, hidden_size, conv_L_cache]
        past_cache_values[name] = np.zeros([batch_size, shape[1], shape[2]], dtype=dtype)

# 3. Generation loop
max_new_tokens = 1024
generated_tokens = np.array([[]], dtype=np.int64)
for i in range(max_new_tokens):
  logits, *present_cache_values = session.run(None, dict(
      input_ids=input_ids,
      attention_mask=attention_mask,
      num_logits_to_keep=num_logits_to_keep,
      **past_cache_values,
  ))

  ## Update values for next generation loop
  input_ids = logits[:, -1].argmax(-1, keepdims=True)
  attention_mask = np.concatenate([attention_mask, np.ones_like(input_ids, dtype=np.int64)], axis=-1)
  for j, key in enumerate(past_cache_values):
    past_cache_values[key] = present_cache_values[j]
  generated_tokens = np.concatenate([generated_tokens, input_ids], axis=-1)
  if np.isin(input_ids, eos_token_id).any():
      break

  ## (Optional) Streaming
  print(tokenizer.decode(input_ids[0]), end='', flush=True)
print()

# 4. Output result
print(tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0])

Files

24 files · 11.4 GBWeights 760 MB (smallest of 6 ONNX variants). Sizes and sha256 from the signed manifest.
Show all 24 files with their sha256
FileSizesha256
.gitattributes2.13 KBf963deb2230602b910bb6c84c02199c24038eef54ae636c3d40664a2bbb00229
LICENSE10.6 KB55a61add48383d18363d9c80355acc747a1b0fb2bdb527964ce0583bb54b689d
README.md10.2 KB5e4e67831cbe212bd776ae97694315a6964c55a9b37fe5a163e109274ed41bbf
chat_template.jinja1.35 KB2294f49b51a0b9a1b0194add3f124237b5bd986599f43180eec49bba4de01365
config.json1.53 KBa8cdd73559adab4e868cd985119fea0f1957a20023a258a7c54c3e831d1b0450
generation_config.json136 B1be9f5bf1f044d6ce4ec91376c2bc14337078e1260a0ba56ff507c0c25ef1902
onnx/model.onnx141 KB3d4deed4892c41ddc0fb9208e90bc967af420fcf010b4850a0d63505846ec284
onnx/model.onnx_data2.06 GB15a824a148f00bb1071ce9669005afb4e3c202bd958e029120ed95dc3c4542b9
onnx/model.onnx_data_12.07 GBbd11bbe70631e76601a594341c251a8d3aeceb7c18a145cbe58e973d726a241a
onnx/model.onnx_data_2579 MB628cf72dc272ec34c16320d0dceddece8de124f6f4478fa5f87c091804d6d812
onnx/model_fp16.onnx140 KB175ccf5a8f5d3cdd020b0095f7948f2ed82271c943927715616dff71aac4e368
onnx/model_fp16.onnx_data2.07 GBe0b14684fb9fcd819310ae3c408132eeffcf2ec0a727ab4b03c0617f19bfede4
onnx/model_fp16.onnx_data_1289 MB791a8f9f3f356fe952fc9fb717f6e293b04ff0d61876aa044689ee0918867a2b
onnx/model_q4.onnx184 KB042893cd01e150e042d9e6eca847e3d2424d0760d3df57a47d500ac2501471d0
onnx/model_q4.onnx_data850 MB36147183c897f5a06b47f3353f26f081d3afe0a6787caf44c1bfd0dbbe0532b6
onnx/model_q4f16.onnx183 KB2fac6f754129621cb12bf4912705da48eeed8807432eaa80c73ed003ccda182d
onnx/model_q4f16.onnx_data760 MB1adff544de9b1fbfcc8b49a5e87974d333f47182db2c650ae326f7c85498e48f
onnx/model_q8.onnx4.11 MB277b12b232e7add5ac012dde98257bcd360caa7ab646de3f61a8def198e3502f
onnx/model_q8.onnx_data1.20 GBa40e83a292b328bb5ba75bb26ffc271e206f11fcee47c3b680e505d2155c0add
onnx/model_quantized.onnx186 KB395b8a6d14162c27b39a9e4bc6b90d4abd6dc5b9d158d3f38c2bbb2873851fc8
onnx/model_quantized.onnx_data1.52 GBffecb5180465b940d2415a4475a7c8ff0a67362faaec1f1a91b19f5d962ded10
special_tokens_map.json434 B742aefe2b7dec496e8caffdba03a75d0c1a9925d53bd3f3e0d388c96b591b6f4
tokenizer.json3.30 MBbec04fe03d27dbcb6276b46e7d2325433323a8132a2f0404ea6bbf98250a9211
tokenizer_config.json93.6 KB1635881015705807ba0fb6510d77a42e53fc041f4de12bb801f1685a62b7220d
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
dd095948cf pinned now2026-11-15 00:22 UTC24 files · 11.4 GB

Use it

# custom terms: read the license before you download
$ fw get onnx-community/LFM2-1.2B-ONNX
# manifest sha256 61542b10c981… · 11.4 GB · 24 files
$ fw verify ./LFM2-1.2B-ONNX onnx-community/LFM2-1.2B-ONNX
Terms that come with these files. LFM 1.0: commercial use only for organisations under US$10M annual revenue. Keep a copy of the license with the files.
Custom license (custom). Read the license text first. Open this panel to show the commands once you accept its terms.
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/onnx-community/LFM2-1.2B-ONNX.json --dir ./LFM2-1.2B-ONNX $ python3 fw.py verify ./LFM2-1.2B-ONNX ./onnx-community__LFM2-1.2B-ONNX.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/LFM2-1.2B-ONNX --revision dd095948cf23919ef2fcb635a156ce59975f35ff --local-dir ./LFM2-1.2B-ONNX

License

Name
LFM Open License v1.0
Id
LicenseRef-LFM-1.0
Class
Custom terms
Redistribution
click-through
Listing
Hosted (signed)
Terms
LFM 1.0: commercial use only for organisations under US$10M annual revenue. Keep a copy of the license with the files.
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
LICENSE
Text sha256
55a61add48383d18363d9c80355acc747a1b0fb2bdb527964ce0583bb54b689d
Terms gate
Yes. The commands stay folded until you open them after reading the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.lfmSubject: LFM2-1.2B-ONNXDate: 2026-11-15Commit: dd09594Signed: 2DC28CC7B26A283B ✓
Upstream
onnx-community/LFM2-1.2B-ONNX
Pinned commit
dd095948cf23919ef2fcb635a156ce59975f35ff
Manifest
LFM2-1.2B-ONNX.json · .minisig
Manifest sha256
61542b10c981eb3795091284ac180af73b98b18354d0142210ec118a94095a25
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 00:22 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/onnx-community/LFM2-1.2B-ONNX.json $ curl -O https://freeweights.allternit.com/manifests/onnx-community/LFM2-1.2B-ONNX.json.minisig $ minisign -Vm LFM2-1.2B-ONNX.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

LiquidAI/LFM2-1.2B · this model is a quantization of it

No model in the catalog names this one as its parent.

Get it
Read license, then download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/LFM2-1.2B-ONNX
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. LFM2-1.2B-ONNX.json. Provenance. Takedown history: none.
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-1.2B
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-1.2B-Extract
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-1.2B-RAG
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-1.2B-Tool
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-2.6B
From: LiquidAI <huggingface.co/LiquidAI>Subject: LFM2-2.6B-Exp