Instructions to use LiquidAI/LFM3-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiquidAI/LFM3-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LiquidAI/LFM3-1.7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM3-1.7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LiquidAI/LFM3-1.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LiquidAI/LFM3-1.7B" # 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/LFM3-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LiquidAI/LFM3-1.7B
- SGLang
How to use LiquidAI/LFM3-1.7B 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/LFM3-1.7B" \ --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/LFM3-1.7B", "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/LFM3-1.7B" \ --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/LFM3-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LiquidAI/LFM3-1.7B with Docker Model Runner:
docker model run hf.co/LiquidAI/LFM3-1.7B
Unexpected </think> with enable_thinking=False — expected behavior?
Hello! I’m seeing a closing tag inside generated text despite disabling thinking.
Model: LiquidAI/LFM3-1.7B
Messages:
System: Answer factual questions briefly.
User: What is a Renault Twingo? Answer in one sentence.
Settings:
enable_thinking=False
temperature=0.1
top_k=50
top_p=1.0
repetition_penalty=1.1
Observed output includes:
…hatchback or city car.</think>A Renault Twingo is…
This reproduced in fresh llama.cpp sessions using the official Q4_K_M GGUF. Our runtime includes the fix from llama.cpp PR #31374, whose regression tests passed.
It also appeared using the original BF16 checkpoint with Transformers 5.22.1 and PyTorch 2.8.0 CPU.
Reference-test limitations:
- Linear calculations were promoted to FP32, then rounded back to BF16 activations for CPU feasibility; weights were unchanged.
- The reference run stopped at its 300-second limit after 64 generated tokens. The tag appeared before that stop.
- This is one prompt and seed, not a comprehensive evaluation.
Is this expected raw-output behavior requiring a specific response parser, or an issue with thinking-disabled generation? What is the recommended handling for streaming text into speech?
I can provide pinned revisions, token IDs and raw response logs if helpful.
Hey, yes, leakage of thinking traces is expected because it was trained as a reasoning model. You can experiment with different generation parameters to help prevent this, but unfortunately it's not 100% reliable. We'll work on this for the next release.
Thanks for the explanation! We’re experimenting with LFM3-1.7B for a local voice assistant on a Raspberry Pi 5. Are there generation settings you’d recommend in the meantime? Looking forward to the next release and happy to help test it!
I don't have specific recommendations because it depends on your use case, so you may need to experiment with a few configurations to see what works best for you. Thanks!