💧 LFM2.5
Collection
Collection of post-trained and base LFM2.5 models. • 30 items • Updated • 137
How to use LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit 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("LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit")
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)How to use LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit with Pi:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit"
# Install Pi:
npm install -g @mariozechner/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
"providers": {
"mlx-lm": {
"baseUrl": "http://localhost:8080/v1",
"api": "openai-completions",
"apiKey": "none",
"models": [
{
"id": "LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit"
}
]
}
}
}# Start Pi in your project directory: pi
How to use LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit with Hermes Agent:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit"
# 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 LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit
hermes
How to use LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "LiquidAI/LFM2.5-1.2B-Instruct-MLX-6bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'
MLX export of LFM2.5-1.2B-Instruct for Apple Silicon inference.
| Property | Value |
|---|---|
| Parameters | 1.2B |
| Precision | 6-bit |
| Group Size | 64 |
| Context Length | 128K |
| Parameter | Value |
|---|---|
| temperature | 0.1 |
| top_k | 50 |
| top_p | 0.1 |
| repetition_penalty | 1.05 |
| max_tokens | 512 |
pip install mlx-lm
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler, make_logits_processors
model, tokenizer = load("LiquidAI/LFM2.5-1.2B-Instruct-6bit")
prompt = "What is the capital of France?"
if tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
sampler = make_sampler(temp=0.1, top_k=50, top_p=0.1)
logits_processors = make_logits_processors(repetition_penalty=1.05)
response = generate(
model,
tokenizer,
prompt=prompt,
max_tokens=512,
sampler=sampler,
logits_processors=logits_processors,
verbose=True,
)
This model is released under the LFM 1.0 License.
6-bit
Base model
LiquidAI/LFM2.5-1.2B-Base