> ## 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.

# LFM3-1.7B

> 1.7B text model for local agents and specialized applications, with a 256K context window and native tool calling

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

LFM3-1.7B is Liquid AI's text model for local agents and specialized applications, based on the new LFM3 tri-hybrid architecture. It is post-trained for agentic harnesses such as Hermes Agent, Pi, and OpenClaw, with a 256K-token context window. At 4-bit precision, it takes about 1 GB of memory, so it fits on any phone or laptop.

[HF](https://huggingface.co/LiquidAI/LFM3-1.7B)
[Base](https://huggingface.co/LiquidAI/LFM3-1.7B-Base)
[GGUF](https://huggingface.co/LiquidAI/LFM3-1.7B-GGUF)
[MLX](https://huggingface.co/LiquidAI/LFM3-1.7B-MLX-4bit)
[ONNX](https://huggingface.co/LiquidAI/LFM3-1.7B-ONNX)
[FP8](https://huggingface.co/LiquidAI/LFM3-1.7B-FP8)
[NVFP4](https://huggingface.co/LiquidAI/LFM3-1.7B-NVFP4)

## Specifications

| Property | Value |
| - | - |
| Parameters | 1.73B |
| Context Length | 256K tokens (input + output) |
| Architecture | LFM3 (dense), 24 layers (13 gated short convolution + 5 sliding-window attention + 6 global attention) |
| Vocabulary Size | 128K |
| Languages | English, Arabic, Chinese, French, German, Italian, Japanese, Korean, Portuguese, Spanish, Vietnamese, Thai, Indonesian, Hindi, Russian, Polish |
| Generation Parameters | `temperature=0.1`, `top_k=50`, `repetition_penalty=1.1` |
| License | [LFM Open License v1.0](https://docs.liquid.ai/lfm/help/model-license.md) |

> **Local Agents**
>
> Post-trained for agent harnesses like Hermes Agent, Pi, and OpenClaw

> **256K Context**
>
> Long context for tool traces and multi-step workflows

> **Made to be Specialized**
>
> Adapt it to your domains, formats, and tools with single-GPU fine-tuning

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.

## Quick Start

**Transformers**

Install:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
pip install -U transformers torch accelerate
```

Run:

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
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"])
```

**llama.cpp**

Requires a llama.cpp build with LFM3 support. Use a GGUF with the current chat template, or load the template with `--chat-template-file`.

**Install:**

brew install llama.cpp

**Run:**

llama-cli -hf LiquidAI/LFM3-1.7B-GGUF \\
\--temp 0.1 --top-k 50 --repeat-penalty 1.1

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).

**vLLM**

**Install:**

pip install -U vllm

**Run:**

from vllm import LLM, SamplingParams

llm = LLM(model="LiquidAI/LFM3-1.7B")

sampling\_params = SamplingParams(temperature=0.1, top\_k=50, repetition\_penalty=1.1, max\_tokens=8192)

output = llm.chat(\[\{"role": "user", "content": "What is machine learning?"}], sampling\_params)
print(output\[0].outputs\[0].text)

**SGLang**

**Install:**

uv pip install "sglang>=0.5.10"

**Launch server:**

sglang serve \\
\--model-path LiquidAI/LFM3-1.7B \\
\--host 0.0.0.0 \\
\--port 30000

**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/LFM3-1.7B",
messages=\[\{"role": "user", "content": "What is machine learning?"}],
temperature=0.1,
extra\_body=\{"top\_k": 50, "repetition\_penalty": 1.1},
)

print(response.choices\[0].message.content)

For local agent setup, see the [Agent Harnesses guide](https://docs.liquid.ai/examples/agent-harnesses.md).

## Reasoning

Reasoning is enabled by default. Set `enable_thinking=False` in `apply_chat_template()` for direct answers. Reasoning from turns before the latest user message is removed unless `preserve_thinking=True`. See [Chat Template](https://docs.liquid.ai/lfm/key-concepts/chat-template.md) and [Tool Use](https://docs.liquid.ai/lfm/key-concepts/tool-use.md) for the message format.

For math and science, use `temperature=1.0`, `top_p=0.95`, `top_k=20`, and `repetition_penalty=1.0` instead of the general generation parameters.

## Defer Loading and Tool Search

LFM3-1.7B supports deferred tools, so tool definitions stay out of the prompt until a search tool returns them. See [Defer Loading and Tool Search](https://docs.liquid.ai/lfm/key-concepts/tool-use.md#defer-loading-and-tool-search) for how it works and a complete example.

## FP8 and NVFP4 Checkpoints

[LFM3-1.7B-FP8](https://huggingface.co/LiquidAI/LFM3-1.7B-FP8) and [LFM3-1.7B-NVFP4](https://huggingface.co/LiquidAI/LFM3-1.7B-NVFP4) are FP8 and 4-bit floating-point versions of LFM3-1.7B for GPU inference with SGLang. To use one, replace the model ID in the SGLang example above.


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