> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liquid.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LFM2-24B-A2B

> 24B parameter Mixture-of-Experts model with 2B active parameters (deprecated - use LFM2.5-24B-A2B instead)

[← Back to Text Models](https://docs.liquid.ai/lfm/models/text-models.md)

> [!WARNING]
>
> This model is deprecated. Use [LFM2.5-24B-A2B](https://docs.liquid.ai/lfm/models/lfm25-24b-a2b) for improved performance.

LFM2-24B-A2B was the largest model in the LFM2 series, a Mixture-of-Experts model combining 24B total parameters with only 2B active parameters per forward pass, built for laptops and single-GPU deployments. It has been superseded by LFM2.5-24B-A2B.

[HF](https://huggingface.co/LiquidAI/LFM2-24B-A2B)
[GGUF](https://huggingface.co/LiquidAI/LFM2-24B-A2B-GGUF)
[MLX](https://huggingface.co/LiquidAI/LFM2-24B-A2B-MLX-8bit)
[ONNX](https://huggingface.co/LiquidAI/LFM2-24B-A2B-ONNX)

## Specifications

| Property | Value |
| - | - |
| Parameters | 24B (2B active) |
| Context Length | 32K tokens |
| Architecture | LFM2 (MoE) |

> [card] MoE Efficiency
>
> 24B quality, 2B inference cost

> [card] Laptop-Ready
>
> Runs on laptops and single GPUs

> [card] Tool Calling
>
> Native function calling support

## Quick Start

> [tab] Transformers
>
> **Install:**
>
> pip install "transformers>=5.2.0" torch accelerate
>
> **Download & Run:**
>
> from transformers import AutoModelForCausalLM, AutoTokenizer
>
> model\_id = "LiquidAI/LFM2-24B-A2B"
> model = AutoModelForCausalLM.from\_pretrained(
> model\_id,
> device\_map="auto",
> dtype="bfloat16",
> )
> tokenizer = AutoTokenizer.from\_pretrained(model\_id)
>
> inputs = tokenizer.apply\_chat\_template(
> \[\{"role": "user", "content": "What is machine learning?"}],
> add\_generation\_prompt=True,
> return\_tensors="pt",
> tokenize=True,
> return\_dict=True,
> ).to(model.device)
>
> output = model.generate(\*\*inputs, do\_sample=True, temperature=0.1, top\_k=50, repetition\_penalty=1.05, max\_new\_tokens=512)
> input\_length = inputs\["input\_ids"].shape\[1]
> response = tokenizer.decode(output\[0]\[input\_length:], skip\_special\_tokens=True)
> print(response)

> [tab] llama.cpp
>
> **Install:**
>
> brew install llama.cpp
>
> **Run:**
>
> llama cli -hf LiquidAI/LFM2-24B-A2B-GGUF \\
> \--temp 0.1 --top-k 50 --repeat-penalty 1.05
>
> **Web chat UI and OpenAI-compatible API** at `http://localhost:9931`:
>
> llama serve -hf LiquidAI/LFM2-24B-A2B-GGUF \\
> \--temp 0.1 --top-k 50 --repeat-penalty 1.05
>
> The `-hf` flag downloads the model directly from Hugging Face. For other installation methods and advanced usage, see the [llama.cpp guide](https://docs.liquid.ai/deployment/on-device/llama-cpp.md).

> [tab] vLLM
>
> **Install:**
>
> pip install -U vllm
>
> **Run:**
>
> from vllm import LLM, SamplingParams
>
> llm = LLM(model="LiquidAI/LFM2-24B-A2B")
>
> sampling\_params = SamplingParams(temperature=0.1, top\_k=50, repetition\_penalty=1.05, max\_tokens=512)
>
> output = llm.chat(\[\{"role": "user", "content": "What is machine learning?"}], sampling\_params)
> print(output\[0].outputs\[0].text)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.