Run this model with HF Jobs
Run LiquidAI/LFM2-24B-A2B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/LiquidAI/LFM2-24B-A2B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/LiquidAI/LFM2-24B-A2B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/LiquidAI/LFM2-24B-A2B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/LiquidAI/LFM2-24B-A2B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use LiquidAI/LFM2-24B-A2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM2-24B-A2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LiquidAI/LFM2-24B-A2B") 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("LiquidAI/LFM2-24B-A2B") model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2-24B-A2B", 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 LiquidAI/LFM2-24B-A2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM2-24B-A2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LiquidAI/LFM2-24B-A2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM2-24B-A2B
- SGLang
How to use LiquidAI/LFM2-24B-A2B 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 "LiquidAI/LFM2-24B-A2B" \ --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": "LiquidAI/LFM2-24B-A2B", "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 "LiquidAI/LFM2-24B-A2B" \ --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": "LiquidAI/LFM2-24B-A2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LiquidAI/LFM2-24B-A2B with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM2-24B-A2B
Intel Iris Xe Benchmarks (15 GiB RAM, 61.9 GB/s): LFM2-8B-A1B vs. the 8β9 GiB Q4_K_M Weight Cap
Sharing llama-bench (Vulkan) and inferzero gpu_bench measurements from my 15 GiB laptop (i7-1355U, Intel Iris Xe 0xA7A1, 61.9 GB/s peak read bandwidth, 49,152 B shared memory, no matrix cores). I am benchmarking candidate models for a local Rust/TypeScript compiler-fixing CLI (cargo check / tsc / cargo test), targeting Q4_K_M GGUFs to preserve code-editing precision:
Model (llama-bench Vulkan) |
GGUF Size | pp4096 |
tg128 |
Measured Notes on 15 GiB Iris Xe |
|---|---|---|---|---|
LFM2.5-1.2B (QAD-Q4_0, Short-Conv + GQA) |
661 MiB |
760.52 t/s |
36.56 t/s |
1,021.25 t/s at pp512, 351.95 t/s at pp16384. |
LFM2-8B-A1B (Q4_0, 8.34B / 1B active, Short-Conv + GQA) |
4.41 GiB |
341.59 t/s |
22.33 t/s |
225.60 t/s at pp16384; strong throughput on Iris Xe. |
Qwen3.5-9B (Q4_K_M, 8.95B dense, 3:1 DeltaNet + GQA) |
5.28 GiB |
83.15 t/s |
6.62 t/s |
104.21 t/s at pp512; 37.5 GB/s decode read. |
LiquidCode-2.5-24B-A2B (Q4_K_M) |
14.5 GB |
β | β | Not run; exceeds my <= 8.0β9.0 GiB Q4_K_M weight budget on 15 GiB unified RAM alongside OS, 10K f16 KV cache, and compiler processes. |
Observed Hardware Constraints (15 GiB Unified RAM / 49,152 B SLM):
- Target
Q4_K_MWeight Budget (<= 8.0β9.0 GiB): On a15 GiBunified-memory system running OS (Xubuntu),10Kf16KV cache (--cache-ram 2048), andcargo/tscbuilds,5.28 GiB(Qwen3.5-9BQ4_K_M) leaves comfortable headroom, whereas a14.5 GBQ4_K_MGGUF leaves almost none. - Memory Bandwidth (
61.9 GB/speak): Reading5.28 GiBper token on denseQwen3.5-9Byields6.62 t/s(37.5 GB/s), whereas1B-activeLFM2-8B-A1Breaches22.33 t/s. - Linear / Partial-Linear Hybrid Attention & Head Width (
49,152 BSLM): Linear and partial-linear hybrids (LFM2'sShort-Conv + GQA,Qwen3.5's3:1 DeltaNet + GQA, andGranite-4.0-h-tiny's9:1 Mamba-2 + GQAat312.89 t/spp4096) avoid the quadraticO(NΒ²)context drop past4K. Meanwhile,>= 512-dim global attention heads (Gemma 4/Nemotron-3.5-Bolt-E4B,4.70 GiB) dropped-55.8%frompp512topp4096(177.31 -> 78.41 t/s) inllama.cppVulkan, making<= 128-dim GQA layers critical on49,152 BSLM hardware.
Questions for the Liquid AI team:
- Before I run end-to-end
cargo check/tscrepair loops, how doesLFM2-8B-A1B(1Bactive) hold up againstLiquidCode-2.5-24B-A2Bon no-think multi-step Rust/TypeScript compiler fixes and strict JSON tool calling? - Are you exploring any linear / partial-linear hybrid (
Short-Conv + <= 128-dim GQA) MoE variants that fit inside a<= 8.0β9.0 GiBQ4_K_MGGUF footprint (~12Bβ15Btotal parameters) for15β16 GiBunified-memory laptops?