Instructions to use cybertruck32489/lfm3-1.7b-flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cybertruck32489/lfm3-1.7b-flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cybertruck32489/lfm3-1.7b-flash", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cybertruck32489/lfm3-1.7b-flash", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("cybertruck32489/lfm3-1.7b-flash", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cybertruck32489/lfm3-1.7b-flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cybertruck32489/lfm3-1.7b-flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cybertruck32489/lfm3-1.7b-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cybertruck32489/lfm3-1.7b-flash
- SGLang
How to use cybertruck32489/lfm3-1.7b-flash with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cybertruck32489/lfm3-1.7b-flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cybertruck32489/lfm3-1.7b-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cybertruck32489/lfm3-1.7b-flash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cybertruck32489/lfm3-1.7b-flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cybertruck32489/lfm3-1.7b-flash with Docker Model Runner:
docker model run hf.co/cybertruck32489/lfm3-1.7b-flash
- LFM3-1.7B-Flash
- Model details
- Inference
- Benchmarks
- 1. Web-Search Utility / Sub-Agent (
50 tasks per stage) - 2. Cron & Background Scheduled Tasks (
25 tasks per stage) - 3. Structured Output & JSON Extraction (
25 tasks per stage) - 4. Offline Local Notes RAG & FAQ Kiosk (
25 tasks per stage) - 5. Browser-Use & Local Automation (
25 tasks per stage) - 6. Multilingual Daily Routine (
10 tasks per language,n=60) - 7. Background Bots & Lightweight Personas (
25 tasks per stage,n=50) - 8. Out-of-Domain Generalization (
n=30)
- 1. Web-Search Utility / Sub-Agent (
- Citation
- Model details
LFM3-1.7B-Flash
LFM3-1.7B-Flash adds speculative decoding acceleration to LiquidAI/LFM3-1.7B via a 2-layer Osprey draft head, Best-First DDTree verification, and suffix/prompt lookup.
- Greedy decoding parity: evaluated across tool calls, structured extraction, local RAG, browser automation, multilingual prompts, background/persona tasks, and out-of-domain prompts with
repetition_penalty=1.1anddo_sample=False. - Configurable block size & tree: supports block-size dropout training (
75% K=10and25% K=6) and adjustabledflash_k/max_tree_nodes. - Head-reordered 48K shortlist: reordered vocabulary shortlist with special/tool/thinking tokens at the front, supporting
16K/24Khead slicing. - Standard
transformersworkflow: loads withAutoModelForCausalLM.from_pretrained(..., trust_remote_code=True)and switches viause_dflash=True/False.
Model details
| Property | Specification |
|---|---|
| Base model | LiquidAI/LFM3-1.7B |
| Draft head | Osprey 2L (1-pass drafting, target tap layers [6, 12, 18, 23], draft layers [18, 22]) |
| Verification & lookup | Best-First DDTree (max_tree_nodes=48 default, 12 lightweight) + Suffix/Prompt Lookup (min_match=4, max_len=10) |
| Vocabulary shortlist | 48K head-reordered shortlist (16K/24K slicing supported) |
| License | LFM Open License v1.0 |
Inference
Quick start (transformers)
Call model.prepare_flash_inference() once after loading, then pass use_dflash=True to model.generate().
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "cybertruck32489/lfm3-1.7b-flash"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
).eval()
model.prepare_flash_inference()
messages = [
{"role": "user", "content": "Explain the difference between TCP and QUIC in 3 concise bullet points."}
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output_ids = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
repetition_penalty=1.1,
use_dflash=True,
)
print(tokenizer.decode(output_ids[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Runtime profiles & tool calling
# Default configuration
out_default = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
repetition_penalty=1.1,
use_dflash=True,
dflash_k=10,
max_tree_nodes=48,
)
# Smaller draft tree + 24K sliced LM head
out_sliced = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
repetition_penalty=1.1,
use_dflash=True,
dflash_k=6,
max_tree_nodes=12,
shortlist_limit=24576,
)
# Standard autoregressive baseline
out_ar = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
repetition_penalty=1.1,
use_dflash=False,
)
tools = [{
"type": "function",
"function": {
"name": "web_search",
"description": "Search the web and return top snippets with URLs.",
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string"},
"max_results": {"type": "integer"},
},
"required": ["query"],
},
},
}]
messages = [{"role": "user", "content": "What flag disables the GIL in Python 3.13 free-threaded builds?"}]
prompt = tokenizer.apply_chat_template(
messages,
tools=tools,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(
**inputs,
max_new_tokens=64,
do_sample=False,
repetition_penalty=1.1,
use_dflash=True,
)
print(tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False))
Benchmarks
All measurements below were run on a single NVIDIA Tesla T4 (16 GB, FP16) using AutoModelForCausalLM.generate() with repetition_penalty=1.1 and greedy decoding (do_sample=False), comparing autoregressive decoding (use_dflash=False) against LFM3-1.7B-Flash (use_dflash=True, K=10, N=48).
1. Web-Search Utility / Sub-Agent (50 tasks per stage)
- Web-Search Tool Call: user prompt โ XML
web_searchtool call. - Post-Search Answer: search snippets โ concise answer with an exact quote and source URL.
Sub-Agent Stage (n=50, rep=1.1) |
AR Avg | Flash Avg | Flash Min | Flash Max | Speedup | Avg Latency (AR โ Flash) | Exact Parity |
|---|---|---|---|---|---|---|---|
| 1. Web-Search Tool Call | 34.7 tok/s | 98.2 tok/s | 76.7 tok/s | 154.8 tok/s | 2.83x | 0.94s โ 0.33s | 49/50 |
| 2. Post-Search Answer (Quote + URL) | 34.8 tok/s | 97.2 tok/s | 67.8 tok/s | 132.1 tok/s | 2.79x | 1.01s โ 0.36s | 50/50 |
2. Cron & Background Scheduled Tasks (25 tasks per stage)
- Daily News Digest (EN/FR/DE): news briefs summarized into 2 concise bullet points preserving numbers and entities.
- Scheduled Web Crawl โ JSON: HTML product cards parsed into JSON.
Cron Task (n=25 each, rep=1.1) |
AR Avg | Flash Avg | Flash Min | Flash Max | Speedup | Avg Latency (AR โ Flash) | Exact Parity |
|---|---|---|---|---|---|---|---|
| 1. Daily News Digest (EN/FR/DE) | 36.7 tok/s | 72.7 tok/s | 53.0 tok/s | 111.2 tok/s | 1.98x | 1.54s โ 0.78s | 24/25 |
| 2. Scheduled Web Crawl โ JSON | 36.5 tok/s | 156.8 tok/s | 142.4 tok/s | 177.5 tok/s | 4.30x | 1.90s โ 0.44s | 25/25 |
3. Structured Output & JSON Extraction (25 tasks per stage)
- Messy Messages โ Flat JSON: noisy chat/email messages extracted into a 7-key JSON object.
- Unstructured Notes โ Nested JSON: order/invoice notes extracted into nested JSON with objects and item arrays.
Extraction Task (n=25 each, rep=1.1) |
AR Avg | Flash Avg | Flash Min | Flash Max | Speedup | Avg Latency (AR โ Flash) | Exact Parity |
|---|---|---|---|---|---|---|---|
| 1. Messy Messages โ Flat JSON | 37.8 tok/s | 139.8 tok/s | 122.4 tok/s | 166.0 tok/s | 3.70x | 2.23s โ 0.60s | 25/25 |
| 2. Unstructured Notes โ Nested JSON | 39.3 tok/s | 179.3 tok/s | 167.5 tok/s | 197.0 tok/s | 4.56x | 3.40s โ 0.74s | 25/25 |
4. Offline Local Notes RAG & FAQ Kiosk (25 tasks per stage)
- Local Notes / Study RAG: answers grounded in provided notes/runbooks (including unanswerable declines).
- Embedded FAQ Kiosk: short answers over venue/service FAQ snippets.
Offline RAG Task (n=25 each, rep=1.1) |
AR Avg | Flash Avg | Flash Min | Flash Max | Speedup | Avg Latency (AR โ Flash) | Exact Parity |
|---|---|---|---|---|---|---|---|
| 1. Local Notes / Study RAG | 38.1 tok/s | 99.6 tok/s | 75.4 tok/s | 150.5 tok/s | 2.62x | 1.46s โ 0.56s | 24/25 |
| 2. Embedded FAQ Kiosk | 38.4 tok/s | 102.6 tok/s | 67.3 tok/s | 138.9 tok/s | 2.67x | 1.33s โ 0.50s | 23/25 |
5. Browser-Use & Local Automation (25 tasks per stage)
- Navigation & Click Actions: browser tool calls (
navigate,click,scroll) over page accessibility trees. - Form Filling & Filtering: browser tool calls (
type_text,select_option) over page accessibility trees.
Browser-Use Task (n=25 each, rep=1.1) |
AR Avg | Flash Avg | Flash Min | Flash Max | Speedup | Avg Latency (AR โ Flash) | Exact Parity |
|---|---|---|---|---|---|---|---|
| 1. Navigation & Click Actions | 33.9 tok/s | 91.7 tok/s | 83.2 tok/s | 102.3 tok/s | 2.70x | 0.65s โ 0.24s | 25/25 |
| 2. Form Filling & Filtering | 34.8 tok/s | 92.5 tok/s | 72.5 tok/s | 118.3 tok/s | 2.66x | 0.93s โ 0.33s | 24/25 |
6. Multilingual Daily Routine (10 tasks per language, n=60)
Summarization and note processing across FR, DE, RU, UK, ZH, and JA.
Language (n=10 each, rep=1.1) |
AR Avg | Flash Avg | Flash Min | Flash Max | Speedup | Avg Latency (AR โ Flash) | Exact Parity |
|---|---|---|---|---|---|---|---|
| FR | 35.5 tok/s | 67.3 tok/s | 49.1 tok/s | 117.4 tok/s | 1.90x | 1.44s โ 0.75s | 9/10 |
| DE | 36.5 tok/s | 60.0 tok/s | 50.1 tok/s | 67.7 tok/s | 1.64x | 1.18s โ 0.72s | 10/10 |
| RU | 36.1 tok/s | 75.6 tok/s | 62.8 tok/s | 117.8 tok/s | 2.10x | 1.47s โ 0.70s | 10/10 |
| UK | 36.6 tok/s | 85.9 tok/s | 68.0 tok/s | 194.8 tok/s | 2.35x | 1.47s โ 0.62s | 8/10 |
| ZH | 37.8 tok/s | 54.4 tok/s | 41.4 tok/s | 112.0 tok/s | 1.44x | 1.26s โ 0.88s | 10/10 |
| JA | 37.6 tok/s | 50.5 tok/s | 40.1 tok/s | 136.3 tok/s | 1.34x | 1.13s โ 0.83s | 8/10 |
7. Background Bots & Lightweight Personas (25 tasks per stage, n=50)
- VPS Status & Background Bots: short status messages from operational event descriptions.
- Lightweight Persona Replies: short character-styled replies across role prompts.
Bot / Persona Task (n=25 each, rep=1.1) |
AR Avg | Flash Avg | Flash Min | Flash Max | Speedup | Avg Latency (AR โ Flash) | Exact Parity |
|---|---|---|---|---|---|---|---|
| 1. VPS Status & Background Bots | 37.8 tok/s | 67.3 tok/s | 58.9 tok/s | 94.1 tok/s | 1.78x | 1.28s โ 0.69s | 23/25 |
| 2. Lightweight Persona Replies | 38.1 tok/s | 60.9 tok/s | 51.4 tok/s | 79.3 tok/s | 1.60x | 2.27s โ 1.42s | 20/25 |
8. Out-of-Domain Generalization (n=30)
Varied prompts outside the primary agentic and extraction suites.
Evaluation Split (n=30, rep=1.1) |
AR Avg | Flash Avg | Flash Min | Flash Max | Speedup | Avg Latency (AR โ Flash) | Exact Parity |
|---|---|---|---|---|---|---|---|
| Unseen Out-of-Domain Mix | 38.1 tok/s | 60.6 tok/s | 48.4 tok/s | 87.9 tok/s | 1.59x | 2.45s โ 1.54s | 25/30 |
Citation
Based on LiquidAI/LFM3-1.7B.
@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},
}
- Downloads last month
- 125