Instructions to use stamsam/LFM2.5-8B-A1B-oQ5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use stamsam/LFM2.5-8B-A1B-oQ5 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("stamsam/LFM2.5-8B-A1B-oQ5") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use stamsam/LFM2.5-8B-A1B-oQ5 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "stamsam/LFM2.5-8B-A1B-oQ5"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "stamsam/LFM2.5-8B-A1B-oQ5" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use stamsam/LFM2.5-8B-A1B-oQ5 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "stamsam/LFM2.5-8B-A1B-oQ5"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "stamsam/LFM2.5-8B-A1B-oQ5" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stamsam/LFM2.5-8B-A1B-oQ5", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use stamsam/LFM2.5-8B-A1B-oQ5 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "stamsam/LFM2.5-8B-A1B-oQ5"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default stamsam/LFM2.5-8B-A1B-oQ5
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use stamsam/LFM2.5-8B-A1B-oQ5 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "stamsam/LFM2.5-8B-A1B-oQ5"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "stamsam/LFM2.5-8B-A1B-oQ5" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,14 +1,21 @@
|
|
| 1 |
---
|
| 2 |
library_name: mlx
|
|
|
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- mlx
|
| 5 |
- oq
|
| 6 |
- quantized
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
# LFM2.5-8B-A1B-oQ5
|
| 10 |
|
| 11 |
-
This model
|
| 12 |
|
| 13 |
## Quantization details
|
| 14 |
|
|
@@ -16,3 +23,58 @@ This model was quantized using [oQ](https://github.com/jundot/omlx) (oMLX v0.3.1
|
|
| 16 |
- **Bits**: 5
|
| 17 |
- **Group size**: 64
|
| 18 |
- **Format**: MLX safetensors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
library_name: mlx
|
| 3 |
+
license: other
|
| 4 |
+
license_name: lfm1.0
|
| 5 |
+
license_link: https://huggingface.co/LiquidAI/LFM2.5-8B-A1B/blob/main/LICENSE
|
| 6 |
tags:
|
| 7 |
- mlx
|
| 8 |
- oq
|
| 9 |
- quantized
|
| 10 |
+
- lfm2.5
|
| 11 |
+
- edge
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
+
base_model: LiquidAI/LFM2.5-8B-A1B
|
| 14 |
---
|
| 15 |
|
| 16 |
# LFM2.5-8B-A1B-oQ5
|
| 17 |
|
| 18 |
+
This model is an **MLX oQ5 quantized** version of [LiquidAI/LFM2.5-8B-A1B](https://huggingface.co/LiquidAI/LFM2.5-8B-A1B), quantized using [oQ](https://github.com/jundot/omlx) (oMLX v0.3.12) mixed-precision quantization.
|
| 19 |
|
| 20 |
## Quantization details
|
| 21 |
|
|
|
|
| 23 |
- **Bits**: 5
|
| 24 |
- **Group size**: 64
|
| 25 |
- **Format**: MLX safetensors
|
| 26 |
+
|
| 27 |
+
## Base Model: LFM2.5-8B-A1B
|
| 28 |
+
|
| 29 |
+
LFM2.5 is a new family of hybrid models designed for on-device deployment by Liquid AI. It builds on the LFM2 architecture with extended pre-training and reinforcement learning.
|
| 30 |
+
|
| 31 |
+
### Model Details
|
| 32 |
+
|
| 33 |
+
| Property | Value |
|
| 34 |
+
| --- | --- |
|
| 35 |
+
| Total parameters | 8.3B |
|
| 36 |
+
| Active parameters | 1.5B |
|
| 37 |
+
| Number of layers | 24 (18 double-gated LIV conv + 6 GQA) |
|
| 38 |
+
| Training budget | 38 trillion tokens |
|
| 39 |
+
| Context length | 131,072 |
|
| 40 |
+
| Vocabulary size | 128,000 |
|
| 41 |
+
| Languages | English, Arabic, Chinese, French, German, Japanese, Korean, Portuguese, Spanish |
|
| 42 |
+
|
| 43 |
+
### Recommended Generation Parameters
|
| 44 |
+
|
| 45 |
+
- `temperature: 0.2`
|
| 46 |
+
- `top_p: 80`
|
| 47 |
+
- `repetition_penalty: 1.05`
|
| 48 |
+
|
| 49 |
+
### Chat Template
|
| 50 |
+
|
| 51 |
+
LFM2.5 uses a ChatML-like format:
|
| 52 |
+
|
| 53 |
+
```
|
| 54 |
+
<|startoftext|><|im_start|>system
|
| 55 |
+
You are a helpful assistant trained by Liquid AI.<|im_end|>
|
| 56 |
+
<|im_start|>user
|
| 57 |
+
What is C. elegans?<|im_end|>
|
| 58 |
+
<|im_start|>assistant
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
### Citation
|
| 62 |
+
|
| 63 |
+
```bibtex
|
| 64 |
+
@article{liquidAI20268BA1B,
|
| 65 |
+
author = {Liquid AI},
|
| 66 |
+
title = {LFM2.5-8B-A1B: Personal Assistant On Your Laptop},
|
| 67 |
+
journal = {Liquid AI Blog},
|
| 68 |
+
year = {2026},
|
| 69 |
+
note = {www.liquid.ai/blog/lfm2-5-8b-a1b},
|
| 70 |
+
}
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
```bibtex
|
| 74 |
+
@article{liquidai2025lfm2,
|
| 75 |
+
title = {LFM2 Technical Report},
|
| 76 |
+
author = {Liquid AI},
|
| 77 |
+
journal = {arXiv preprint arXiv:2511.23404},
|
| 78 |
+
year = {2025}
|
| 79 |
+
}
|
| 80 |
+
```
|