LFM3-1.7B is designed for local agents, tool calling, structured outputs, and domain-specific fine-tuning. Use retrieval or search for knowledge-heavy tasks. It is not recommended for agentic coding or complex multi-step reasoning due to its small size.
Use these ONNX weights with Transformers.jsv4.3.2 or later. The example below uses the text generation pipeline with WebGPU.
npm install @huggingface/transformers@^4.3.2
import { pipeline, TextStreamer } from "@huggingface/transformers";
// Create a text generation pipeline.
const generator = await pipeline(
"text-generation",
"onnx-community/LFM3-1.7B-ONNX",
{ dtype: "q4f16", device: "webgpu" },
);
const messages = [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "What is the capital of France?" },
];
// Generate and stream a response.
const output = await generator(messages, {
max_new_tokens: 512,
do_sample: true,
temperature: 0.1,
top_k: 50,
repetition_penalty: 1.1,
tokenizer_encode_kwargs: { enable_thinking: false },
streamer: new TextStreamer(generator.tokenizer, {
skip_prompt: true,
skip_special_tokens: true,
}),
});
console.log(output[0].generated_text.at(-1).content);
// Release the model when you are finished using it.
await generator.dispose();
The pipeline applies the chat template automatically. This example disables thinking with tokenizer_encode_kwargs: { enable_thinking: false }. Set enable_thinking: true and increase max_new_tokens when you want to allow a longer reasoning trace.
All models were served with vLLM in BF16 at their full context length: 262,144 tokens for LFM3-1.7B, Qwen3.5-4B, and Qwen3.5-9B, and 131,072 tokens for LFM2.5-2.6B, MiniCPM5-2B, and Gemma 4 E4B. Unless listed below, every eval uses temperature 0.6 and top_p 0.95, with no output limit other than the context length. The Average row is the unweighted mean of every score in the table.
BFCL V4: greedy decoding, up to 32,768 output tokens.
ToolSandbox: greedy decoding, up to 1,024 tokens per turn.
LiveClaw: OpenClaw agent, up to 8,192 tokens per turn.
Claw-Eval: greedy decoding, 3 trials per task.
BrowseComp-Plus: OpenClaw agent, greedy decoding, up to 8,192 tokens per turn.
WebArena-Verified: up to 40 steps.
MCP-Atlas: up to 256 turns.
EnterpriseOps-Gym and AutomationBench: up to 50 turns.
SWE-bench: OpenCode agent, up to 250 turns.
Terminal-Bench 2.1: OpenCode agent, up to 100 turns.
At 32K context, LFM3-1.7B prefills at least 2.5x faster and decodes at least 1.8x faster than every compared model on all three devices, while using the least memory.
All models run as Q4_0 GGUF files in llama.cpp with 32,768 tokens of context, batch size 1, 100 output tokens, and GPU offload. Prefill is the prompt processing speed and decode is the generation speed, both in tokens per second. LFM3-1.7B uses a llama.cpp build with LFM3 support, and the other models use llama.cpp release b11744.
iPhone 17 Pro: Apple A19 Pro, iOS app built on llama.cpp.
Memory: peak usage in GB (109 bytes). On AMD, it adds the host and GPU peaks from the same run, which can slightly overstate usage if the two peaks do not coincide. On Apple devices, the process footprint already includes Metal allocations.
Pre-training: two stages build LFM3-1.7B-Base on 22T tokens in total.
Main pre-training: compared with LFM2, the mix adds more scientific papers, repository-level code, math, and a wider range of knowledge sources.
Mid-training: the last 3.5T tokens use curated, higher-quality data with a larger share of agentic traces and tool calls. This stage also extends the context window to 256K tokens.
Post-training: four stages develop conversation, reasoning, and tool-use capabilities.
Supervised fine-tuning (SFT): 1.75T tokens across various tasks, including chat, reasoning, tool calling, and agentic traces.
Mixed reinforcement learning: many domains trained at once, from math and code to SQL and structured outputs. A length penalty in the reward keeps answers concise.
Multi-domain on-policy distillation (MOPD): six specialist RL teachers (code, math, tool use, long context, agentic work, and enterprise workflows) are distilled back into a single model.
Agentic RL: tasks from web browsing to office work are run inside real agent harnesses, preparing the model for deployment.
# custom terms: read the license before you download$ fw get onnx-community/LFM3-1.7B-ONNX
# manifest sha256 b9b0b3192128… · 8.14 GB · 19 files$ fw verify ./LFM3-1.7B-ONNX onnx-community/LFM3-1.7B-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.