> ## 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.5-350M

> Ultra-compact 350M parameter model for edge devices and low latency deployments

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

LFM2.5-350M is a compact LFM2.5 text model designed for edge devices with strict memory and compute constraints. It runs in under 1 GB of memory. Built on the LFM2.5 architecture with extended pre-training and reinforcement learning, it delivers improved chat, instruction-following, and tool-calling performance over LFM2-350M while keeping the same compact footprint. For the smallest footprint, see [LFM2.5-230M](https://docs.liquid.ai/lfm/models/lfm25-230m).

[HF](https://huggingface.co/LiquidAI/LFM2.5-350M)
[GGUF](https://huggingface.co/LiquidAI/LFM2.5-350M-GGUF)
[MLX](https://huggingface.co/LiquidAI/LFM2.5-350M-MLX-8bit)
[ONNX](https://huggingface.co/LiquidAI/LFM2.5-350M-ONNX)

## Specifications

| Property | Value |
| - | - |
| Parameters | 350M |
| Context Length | 32K tokens |
| Architecture | LFM2.5 (Dense) |

> [card] Ultra-Light
>
> Minimal memory and compute footprint

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

> [card] Edge-Ready
>
> Runs on mobile and embedded devices

## Quick Start

> [tab] Transformers
>
> **Install:**
>
> pip install "transformers>=5.2.0" torch accelerate
>
> **Download & Run:**
>
> from transformers import AutoModelForCausalLM, AutoTokenizer
>
> model\_id = "LiquidAI/LFM2.5-350M"
> 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.5-350M-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.5-350M-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.5-350M")
>
> 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)

> [tab] SGLang
>
> **Install:**
>
> uv pip install "sglang>=0.5.10"
>
> **Launch server:**
>
> sglang serve \\
> \--model-path LiquidAI/LFM2.5-350M \\
> \--host 0.0.0.0 \\
> \--port 30000 \\
> \--tool-call-parser lfm2
>
> **Query (OpenAI-compatible):**
>
> from openai import OpenAI
>
> client = OpenAI(base\_url="[http://localhost:30000/v1](http://localhost:30000/v1)", api\_key="None")
>
> response = client.chat.completions.create(
> model="LiquidAI/LFM2.5-350M",
> messages=\[\{"role": "user", "content": "What is machine learning?"}],
> temperature=0.1,
> extra\_body=\{"top\_k": 50, "repetition\_penalty": 1.05},
> )
>
> print(response.choices\[0].message.content)


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