How to use from the
Use from the
MLX library
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# if on a CUDA device, also pip install mlx[cuda]

# Generate text with mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("moonbox-dev/LFM3-1.7B-MLX")

prompt = "Once upon a time in"
text = generate(model, tokenizer, prompt=prompt, verbose=True)

LFM3 1.7B MLX

MLX builds of LFM3 1.7B (Liquid AI's LFM3), made by Moonbox for Apple Silicon Macs. Each build is a folder and a complete mlx-vlm model: weights, config.json, Liquid's tokenizer, chat template and processor settings. These files are not an official Liquid AI release.

Files

The last column is how far each build is from the original bf16 model (see "Quality" below for what was measured).

Precision File Size sha256 Against the original
8bit 8bit/chat_template.jinja 12.1 kB f45005c50cd2 KL 0.0026 nats (p95 0.0059), top-1 agreement 97.2 %, perplexity 24.88 vs 24.92
8bit 8bit/config.json 49.4 kB e96977bbeaec KL 0.0026 nats (p95 0.0059), top-1 agreement 97.2 %, perplexity 24.88 vs 24.92
8bit 8bit/generation_config.json 0.3 kB 0095ba7158e9 KL 0.0026 nats (p95 0.0059), top-1 agreement 97.2 %, perplexity 24.88 vs 24.92
8bit 8bit/model.safetensors 1.84 GB 2b06cea98d75 KL 0.0026 nats (p95 0.0059), top-1 agreement 97.2 %, perplexity 24.88 vs 24.92
8bit 8bit/model.safetensors.index.json 50.7 kB 0f4f85710fd2 KL 0.0026 nats (p95 0.0059), top-1 agreement 97.2 %, perplexity 24.88 vs 24.92
8bit 8bit/special_tokens_map.json 0.1 kB 7946f864cbfb KL 0.0026 nats (p95 0.0059), top-1 agreement 97.2 %, perplexity 24.88 vs 24.92
8bit 8bit/tokenizer.json 17.9 MB 7e226e34bfac KL 0.0026 nats (p95 0.0059), top-1 agreement 97.2 %, perplexity 24.88 vs 24.92
8bit 8bit/tokenizer_config.json 1.9 kB b77214b9f12b KL 0.0026 nats (p95 0.0059), top-1 agreement 97.2 %, perplexity 24.88 vs 24.92
6bit 6bit/chat_template.jinja 12.1 kB f45005c50cd2 KL 0.012 nats (p95 0.029), top-1 agreement 94.1 %, perplexity 25.01 vs 24.92
6bit 6bit/config.json 49.4 kB 6b17e03393c8 KL 0.012 nats (p95 0.029), top-1 agreement 94.1 %, perplexity 25.01 vs 24.92
6bit 6bit/generation_config.json 0.3 kB 0095ba7158e9 KL 0.012 nats (p95 0.029), top-1 agreement 94.1 %, perplexity 25.01 vs 24.92
6bit 6bit/model.safetensors 1.41 GB 503d68675793 KL 0.012 nats (p95 0.029), top-1 agreement 94.1 %, perplexity 25.01 vs 24.92
6bit 6bit/model.safetensors.index.json 50.7 kB 940f7e7b4133 KL 0.012 nats (p95 0.029), top-1 agreement 94.1 %, perplexity 25.01 vs 24.92
6bit 6bit/special_tokens_map.json 0.1 kB 7946f864cbfb KL 0.012 nats (p95 0.029), top-1 agreement 94.1 %, perplexity 25.01 vs 24.92
6bit 6bit/tokenizer.json 17.9 MB 7e226e34bfac KL 0.012 nats (p95 0.029), top-1 agreement 94.1 %, perplexity 25.01 vs 24.92
6bit 6bit/tokenizer_config.json 1.9 kB b77214b9f12b KL 0.012 nats (p95 0.029), top-1 agreement 94.1 %, perplexity 25.01 vs 24.92
4bit 4bit/chat_template.jinja 12.1 kB f45005c50cd2 KL 0.034 nats (p95 0.075), top-1 agreement 90.9 %, perplexity 25.43 vs 24.92 (dynamic)
4bit 4bit/config.json 49.4 kB 79e7921c928e KL 0.034 nats (p95 0.075), top-1 agreement 90.9 %, perplexity 25.43 vs 24.92 (dynamic)
4bit 4bit/generation_config.json 0.3 kB 0095ba7158e9 KL 0.034 nats (p95 0.075), top-1 agreement 90.9 %, perplexity 25.43 vs 24.92 (dynamic)
4bit 4bit/model.safetensors 1.31 GB e768708a074c KL 0.034 nats (p95 0.075), top-1 agreement 90.9 %, perplexity 25.43 vs 24.92 (dynamic)
4bit 4bit/model.safetensors.index.json 50.7 kB 59d48cae312f KL 0.034 nats (p95 0.075), top-1 agreement 90.9 %, perplexity 25.43 vs 24.92 (dynamic)
4bit 4bit/special_tokens_map.json 0.1 kB 7946f864cbfb KL 0.034 nats (p95 0.075), top-1 agreement 90.9 %, perplexity 25.43 vs 24.92 (dynamic)
4bit 4bit/tokenizer.json 17.9 MB 7e226e34bfac KL 0.034 nats (p95 0.075), top-1 agreement 90.9 %, perplexity 25.43 vs 24.92 (dynamic)
4bit 4bit/tokenizer_config.json 1.9 kB b77214b9f12b KL 0.034 nats (p95 0.075), top-1 agreement 90.9 %, perplexity 25.43 vs 24.92 (dynamic)

LFM3 1.7B (Liquid AI's 1.7B hybrid model of short convolutions and attention, text only, with thinking) converted to MLX for Apple Silicon, in three builds. Each folder is a complete mlx-vlm model.

These files were converted by Moonbox from LiquidAI/LFM3-1.7B (revision 1da06bec). They are not an official Liquid AI release.

How to run

With mlx-vlm 0.8.0 or later (the first release that runs LFM3 is 0.7.11):

from huggingface_hub import snapshot_download
from mlx_vlm import load, generate

folder = snapshot_download("moonbox-dev/LFM3-1.7B-MLX", allow_patterns="6bit/*") + "/6bit"
model, processor = load(folder)
msgs = [{"role": "user", "content": "Explain in two sentences why the sky is blue."}]
prompt = processor.tokenizer.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
print(generate(model, processor, prompt, max_tokens=1024, temperature=0.1, top_k=50, repetition_penalty=1.1).text)
  • Chat template. Liquid's ChatML (<|startoftext|> first, <|im_start|>role ... <|im_end|>); tools are declared in the system turn between <tools> and </tools>. Thinking is on by default: the reply opens with <think>; enable_thinking=False closes an empty think block instead (Liquid notes the model may still reason in its answer). Earlier turns' thinking is dropped unless preserve_thinking=True.
  • Tool calls are XML (a superset of qwen3_coder): <tool_call>\n<function=name>\n<parameter=key>\nvalue\n</parameter>\n</function>\n</tool_call>; pass a call's arguments back as a mapping, its result as a tool message.
  • Sampling (Liquid's card): temperature=0.1, top_k=50, repetition_penalty=1.1 for chat, tools and agents; temperature=1.0, top_p=0.95, top_k=20 for maths. Text only: this model has no vision tower.
  • Memory and speed on a 24 GB MacBook Air (M5), measured through Moonbox's server (greedy, thinking off; a short answer, a 4K-token prompt):
Build Peak Decode (short / after 4K) Prefill 4K Load Runs on
8bit 2.6 GB 62.2 / 61.2 tok/s 2711 tok/s 2.4 s 8 GB Macs and up
6bit 2.2 GB 80.0 / 76.8 tok/s 2959 tok/s 1.8 s 8 GB Macs and up
4bit 2.1 GB 84.9 / 81.5 tok/s 3003 tok/s 1.7 s 8 GB Macs and up

The three builds

MLX affine quantization of the language model's linear layers and its embedding (tied to the head).

Build Size Layout Mean KL (nats) Top-1 agreement Perplexity
8bit 1.9 GB 8 bits, group 64, the embedding (tied: the head) too 0.0026 97.2 % 24.88
6bit 1.5 GB 6 bits, group 64, the embedding (tied: the head) too 0.012 94.1 % 25.01
4bit 1.4 GB dynamic (d4e): the MLPs' gate and up projections (w1, w3) 4 bits except in mlx-vlm's 'more bits' layers (the first and last eighth and every third in between), where they are 6; the down projections (w2), attention, the short convolutions' projections and the embedding (tied: the head too) 6 bits; group 64 0.034 90.9 % 25.43

Against the bf16 original (perplexity 24.92), teacher-forced through mlx-vlm's own forward, on 16,368 positions of English prose, Python and chat transcripts in the model's own template. The mark this lab uses is top-1 90 % (KL 0.01 ideal). This small model loses more to quantization than larger ones: a plain 4-bit build (every module 4 bits, group 64) is at KL 0.170 and 79.8 %. Liquid AI's own MLX 4-bit (LiquidAI/LFM3-1.7B-MLX-4bit, measured the same way) is at KL 0.170 and 79.8 %. Other layouts measured (lab/zoo/lfm3/notes.md in Moonbox's repository names them): 5bit 0.040 / 89.4 %; d4a 0.071 / 87.2 %; d4b 0.070 / 87.1 %; d4c 0.056 / 88.1 %; d4d 0.095 / 84.2 %; d4f 0.044 / 89.5 %; d4g 0.026 / 91.7 %; d4h 0.021 / 93.1 %; d5 0.019 / 92.8 %; mixed46 0.120 / 82.8 %.

How these were made

From LFM3 1.7B at revision 1da06bec6a, by Moonbox's converter (lab/zoo/lfm3/convert.py in Moonbox's repository): mlx_vlm.convert with a quantization layout of our own, MLX affine quantization of the language model only; every other part of the model is kept as the publisher shipped it (bfloat16). The publisher's Python files (transformers remote code) are left out: mlx-vlm has its own implementation. Each build was checked against the original before upload (teacher-forced through mlx-vlm's own forward); the sha256 column above is what the files must hash to.

License

The LFM Open License v1.0 (LICENSE, copied from the original repository), as the original model card declares. These files are a derivative of the original model: its weights were converted and quantized as described above (NOTICE.md says so too). Under the licence, commercial use is licensed only to entities below its revenue threshold (10 million USD a year); read the licence before using these files. The original model card follows unchanged.


Original model card

LFM3-1.7B

LFM3-1.7B is a text model for local agents and specialized applications, based on our new tri-hybrid architecture.

  • Agentic training: post-trained for agentic harnesses such as Hermes Agent, Pi, and OpenClaw, with a 256K-token context window.
  • Designed for the edge: at 4-bit precision, it takes about 1 GB of memory, so it fits on any phone or laptop.
  • Made to be specialized: adapt the model to your domains, formats, and tools via quick single-GPU fine-tuning.

Find more information about the LFM3 family in our release blog post.

Model details


The LFM3 family includes base, text, vision, audio, omni, and decision models.

Property Specification
Checkpoint Post-trained, text-only language model
Parameters 1.73B
Architecture 24 layers: 13 gated short convolutions, 5 sliding-window attention, 6 global attention
Context length 256K tokens (input + output)
Vocabulary 128,000 tokens
Languages English, Arabic, Chinese, French, German, Italian, Japanese, Korean, Portuguese, Spanish, Vietnamese, Thai, Indonesian, Hindi, Russian, Polish
License LFM Open License v1.0

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.

Inference


Choose a checkpoint variant for your inference framework and hardware.

Checkpoint Framework Description
BF16 vLLM, SGLang, Transformers BF16 weights for GPU inference.
FP8 SGLang FP8 quantization for GPU inference.
NVFP4 SGLang 4-bit floating-point quantization for GPU inference.
GGUF llama.cpp, Ollama, LM Studio Local inference on CPUs and GPUs.
MLX MLX 4-bit quantization for Apple Silicon.
ONNX ONNX Runtime Cross-platform inference with ONNX Runtime.
OpenVINO OpenVINO 4-bit quantization for Intel hardware.

Sampling parameters:

  • General (chat, tool use, agents, coding): temperature=0.1,top_k=50, repetition_penalty=1.1
  • Math & STEM (math, science): temperature=1.0, top_p=0.95, top_k=20

Transformers quick start:

from transformers import pipeline

generator = pipeline(
    "text-generation",
    model="LiquidAI/LFM3-1.7B",
    trust_remote_code=True,
)

messages = [{"role": "user", "content": "What is C. elegans?"}]
output = generator(
    messages,
    do_sample=True,
    temperature=0.1,
    top_k=50,
    repetition_penalty=1.1,
    max_new_tokens=2048,
)
print(output[0]["generated_text"][-1]["content"])

For local agent setup, see the Agent Harnesses guide.

Chat template

LFM3 uses this ChatML format, generated from the checkpoint's chat template:

<|startoftext|><|im_start|>system
You are a helpful assistant trained by Liquid AI.<|im_end|>
<|im_start|>user
Explain how a heat pump works.<|im_end|>
<|im_start|>assistant
<think>

Use tokenizer.apply_chat_template() with add_generation_prompt=True to format messages automatically.

Reasoning is enabled by default. You can set enable_thinking=False to disable thinking traces, but this behavior can be inconsistent, especially for reasoning-heavy tasks.

Reasoning from turns before the latest user message is removed unless preserve_thinking=True.

Tool calling

Pass function schemas through tools=... to apply_chat_template(). The template formats tool definitions and results automatically. Generated calls use XML:

<tool_call>
<function=get_weather>
<parameter=city>
Paris
</parameter>
</function>
</tool_call>

Execute the call in your application. Add the parsed assistant call to history as a tool_calls entry, then append the result as a tool message. Keep passing the tool schemas on subsequent requests and preserve the assistant's content and reasoning from the current tool-use turn.

function.arguments must be a Python mapping. Decode JSON strings with json.loads() before applying the template.

Tool search

LFM3 supports deferred tools. Set defer_loading=True to keep tool definitions out of the prompt until your harness's search tool returns their names as tool_reference parts. The chat template then inserts their definitions into <additional_tools>.

tools = [
    search_tool,
    {"type": "function", "defer_loading": True, "function": get_weather_schema},
]
messages.append({
    "role": "tool",
    "tool_call_id": call_id,
    "content": [
        {"type": "text", "text": "Found 1 tool."},
        {"type": "tool_reference", "name": "get_weather"},
    ],
})

Your harness implements and runs the search. Keep the full tools list, including deferred tools, on every request. In the system prompt, tell the model when to search:

You only have one tool right now: search_tools, which searches a catalog of many more tools. If none of your current tools can handle a request, call search_tools to find one, then call the tool it returns.

Works with vLLM, SGLang, and LFM3-compatible llama.cpp builds. For llama.cpp, use a GGUF with the current chat template or load it with --chat-template-file.

See Deferred tools and tool search for the full guide.

Fine-tuning


LFM3-1.7B is designed for easy customization for a given domain, task, or application via TRL.

Training Use case Notebook
SFT Extract structured JSON from messy documents Open in Colab
DPO Answer from retrieved documents, or decline Open in Colab
GRPO Call the right tools in a 108-tool phone app Open in Colab
CPT Learn a new language (Turkish) from raw text Open in Colab

Performance


Benchmarks

LFM3-1.7B can power agentic applications that used to need 9B parameters.

Benchmark LFM3
1.7B
LFM2.5
2.6B
MiniCPM5
2B
Gemma 4
E4B
Qwen3.5
4B
Qwen3.5
9B
Agents
LiveClaw 45.60 14.70 30.37 20.36 19.94 35.77
Claw-Eval General (EN), average 68.64 62.63 60.74 56.14 61.96 66.53
Claw-Eval General (EN), pass^3 51.40 37.52 34.58 22.43 42.99 51.87
BrowseComp-Plus (OpenClaw subset) 37.00 26.33 16.83 21.00 24.67 38.00
WebArena-Verified 38.42 3.02 9.11 17.06 21.92 28.94
EnterpriseOps-Gym 28.20 7.94 13.41 9.86 25.96 28.97
AutomationBench (public) 41.29 0.94 4.71 1.92 8.67 15.10
Tool use
BFCL V4 71.39 55.89 62.65 48.25 55.12 62.83
ToolSandbox 80.36 78.04 68.16 69.27 75.40 76.41
MCP-Atlas 32.57 16.45 26.38 6.19 41.37 42.67
ฯ„ยณ-bench (4 domains), average 68.01 56.77 69.44 33.53 65.98 67.11
Agentic coding
SWE-bench Verified (OpenCode) 43.40 18.00 34.80 0.50 41.20 51.20
SWE-bench Multilingual (OpenCode) 23.00 8.00 15.67 0.67 23.33 35.00
Terminal-Bench 2.1 (OpenCode) 12.92 0.00 5.62 0.00 13.48 17.98
Coding
LiveCodeBench v6 73.46 60.57 70.52 71.00 61.99 69.86
LiveCodeBench Pro 25Q231.7419.1629.3429.9424.2534.43
SciCode 28.47 16.32 27.78 25.00 23.02 31.60
Instruction following
IFEval96.6695.3987.8390.0292.5292.08
IFBench73.0360.4862.0844.5638.1648.84
IFStruct93.7282.1872.6578.4587.0589.20
Multi-IF 89.10 84.80 73.19 81.03 80.32 84.44
Knowledge
GPQA Diamond63.3757.7865.1557.8875.7680.40
Humanity's Last Exam (no tools)7.175.888.204.7712.8416.41
Humanity's Last Exam (with tools)13.909.6011.506.0011.6017.50
AA-Omniscience (public)0.50-33.17-5.00-15.33-57.17-28.00
AA-Omniscience accuracy (public)7.078.759.139.8315.6713.17
AA-Omniscience non-hallucination (public)92.9353.6984.4472.0913.6452.59
Long context
AA-LCR 52.83 6.00 49.34 39.33 52.67 62.00
RULER 128K 65.56 1.15 37.96 18.82 84.63 87.11
Average49.3731.5539.1931.7439.2747.24
Evaluation details

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.

Edge inference

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.

LFM3-1.7B edge inference at 32K context: prefill throughput, decode throughput, and host plus GPU memory on AMD Ryzen AI Max+ 395, Apple M5 Max, and iPhone 17 Pro, compared with MiniCPM5-2B, Qwen3.5-4B, Qwen3.5-9B, and Gemma 4 E4B.
Evaluation details

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.

AMD Ryzen AI Max+ 395: Radeon 8060S integrated GPU, Windows, Vulkan backend.
Apple M5 Max: macOS, Metal backend.
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.

GPU inference

At 1,024 concurrent requests, LFM3-1.7B can produce 3.6 billion tokens/day on one NVIDIA B300.

LFM3-1.7B GPU inference: output throughput versus concurrent requests on one NVIDIA B300, compared with MiniCPM5-2B, Gemma 4 E4B, Qwen3.5-4B, and Qwen3.5-9B.

Training


LFM3-1.7B pre-training: web and synthetic data (about 15T tokens), then code, math, and science (3T tokens at 4K context), followed by mid-training on curated agentic data (3T tokens at 32K context), a 128K extension (500B tokens), and a 256K extension (50B tokens), for 22T tokens in total.

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.
LFM3-1.7B post-training recipe: the student goes through SFT and mixed RL, specialist RL teachers such as math, code, and tool RL start from the mixed RL checkpoint, MOPD distills them back into the student, and agentic RL comes last.

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.

Citation


@article{liquidAI2026LFM3,
  author  = {Liquid AI},
  title   = {Introducing LFM3: Every Modality for Specialized Intelligence},
  journal = {Liquid AI Blog},
  year    = {2026},
  note    = {www.liquid.ai/blog/lfm3},
}

For questions and feedback, join Discord. For custom deployment and fine-tuning support, contact Liquid AI.

Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for moonbox-dev/LFM3-1.7B-MLX

Quantized
(189)
this model