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

LFM2-350M-ONNX

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

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

lfm3.24GBLFM2-350M-ONNXonnxcustom terms
FactsParamsnot statedSize3.24 GBFormatsonnxTasktext generationLicenseLFM-1.0 (custom)From sourcecustom termsread terms
# custom terms: read the license before you download
$ fw get onnx-community/LFM2-350M-ONNX
# manifest sha256 62809e102d93… · 3.24 GB · 19 files
$ fw verify ./LFM2-350M-ONNX onnx-community/LFM2-350M-ONNX
From sourceHosted (signed)onnx-community/LFM2-350M-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-350M.

Works with

Runs with

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

Convert with

Overview

Size
3.24 GB
Weights
255 MB (smallest of 5 ONNX variants)
Parameters
not stated
Formats
onnx
Task
text generation
License
LFM-1.0 (custom) (custom)
Files
19, 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-350M

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 ecc51d3. Shown as plain text with links; images open at the publisher.

Image: Liquid AI

https://playground.liquid.ai/chat

LFM2-350M#

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
Parameters354,483,968
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-350M-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. It is a vibrant city known for its historical landmarks, art, fashion, and cuisine.

Example: Tool calling

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

// Create a text generation pipeline
const generator = await pipeline(
  "text-generation",
  "onnx-community/LFM2-350M-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, NY", 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-350M-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

19 files · 3.24 GBWeights 255 MB (smallest of 5 ONNX variants). Sizes and sha256 from the signed manifest.
Hide all 19 files with their sha256
FileSizesha256
.gitattributes1.83 KBba44193cf00eb237e2824cbfa212775d626f48f7c4caa3e630deda0908552db2
LICENSE10.6 KB55a61add48383d18363d9c80355acc747a1b0fb2bdb527964ce0583bb54b689d
README.md10.3 KBfffb9ed79989be408942b94657069da9b6d468b099efe8f81bacdfc251cbdb32
chat_template.jinja1.35 KB2294f49b51a0b9a1b0194add3f124237b5bd986599f43180eec49bba4de01365
config.json1.38 KB5828fb2f22d478d13f68bb609baee33f4584993e47dbf0c0acbd0d4aacf8df42
generation_config.json136 B1be9f5bf1f044d6ce4ec91376c2bc14337078e1260a0ba56ff507c0c25ef1902
onnx/model.onnx141 KBcfcfc8049ebc7dc76007a9c9a12c8464fb62d2259f11c46bd93345f21be9cc78
onnx/model.onnx_data1.45 GB680a8908696734b38b214043ca559279feeef344fb4edb6fb640b7a30d2a504e
onnx/model_fp16.onnx140 KBc8c4c04faba4cab5fc95bad5f5d43dca53f788b51c96ef4e21059627511799ba
onnx/model_fp16.onnx_data725 MB08bc3480b5f5e52d73de603b40a0cb8f94574b6efbe268479b88eabdcdd8db21
onnx/model_q4.onnx183 KB325ea0c2f36ddd257fb3cfee855a085fc664fc34bcd201f9b15b16ebed3ce33b
onnx/model_q4.onnx_data294 MBbcde3684697b8df4557ed62f420fddbfc2846334e341d6f807a8b799838c2d89
onnx/model_q4f16.onnx183 KB3227fd58d43811630dd918b58d25ff8c5ef3d16b13e7efc5496205079990a82c
onnx/model_q4f16.onnx_data255 MB16297d38c1b93159495c978142baa2542cda873537392235573360238eb0aeb1
onnx/model_quantized.onnx186 KB05415ed893f4e892630b9243126c2df6ad9db2ace19a13d4cbe40e28a05611f8
onnx/model_quantized.onnx_data510 MBbba0b2bb41f11bc5dc3a8422258c582831f1f7927abcd5c2ef3dc0c99bf03d8e
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
ecc51d35a7 pinned now2026-11-15 00:22 UTC19 files · 3.24 GB

Use it

# custom terms: read the license before you download
$ fw get onnx-community/LFM2-350M-ONNX
# manifest sha256 62809e102d93… · 3.24 GB · 19 files
$ fw verify ./LFM2-350M-ONNX onnx-community/LFM2-350M-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-350M-ONNX.json --dir ./LFM2-350M-ONNX $ python3 fw.py verify ./LFM2-350M-ONNX ./onnx-community__LFM2-350M-ONNX.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/LFM2-350M-ONNX --revision ecc51d35a7edbc8f9ef6d23b59a5f036dcfc7ee8 --local-dir ./LFM2-350M-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-350M-ONNXDate: 2026-11-15Commit: ecc51d3Signed: 2DC28CC7B26A283B ✓
Upstream
onnx-community/LFM2-350M-ONNX
Pinned commit
ecc51d35a7edbc8f9ef6d23b59a5f036dcfc7ee8
Manifest
LFM2-350M-ONNX.json · .minisig
Manifest sha256
62809e102d9370eecb3f8d81fd19165c65f2a526e2348fbeb574e39142cf0086
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-350M-ONNX.json $ curl -O https://freeweights.allternit.com/manifests/onnx-community/LFM2-350M-ONNX.json.minisig $ minisign -Vm LFM2-350M-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-350M · 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-350M-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-350M-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