Instructions to use Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx 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("Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx") 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 Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx"
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": "Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx 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 "Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx"
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 Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx"
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 "Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx" \ --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"
LFM2.5-24B-A2B-abliterated-ternary-mlx
Known quality degradation: this ternary build often fails to finish even simple questions within 8K tokens and can hallucinate facts. Not recommended for general use; see Evaluation.
⚠️ Uncensored model. Refusal behavior has been removed. You are responsible for how you use it. Experimental / personal-learning release.
Base & license
- Base: LiquidAI/LFM2.5-24B-A2B, released under the LFM Open License v1.0.
LICENSEandNOTICEare kept unchanged; seeMODIFICATION_NOTE.txtfor the modifications.
Abliteration
- Refusal direction removed via per-layer biprojected direction:
W' = W - 1.75 · r rᵀ W - Applied to layers 14–39: mixer
out_projand MoE expertw2(down projection). - Follows the recipe of AtomicChat/LFM2.5-24B-A2B-Uncensored-GGUF (credit to AtomicChat), with directions recomputed on our own weights.
Quantization (~10.3 GB)
- MoE experts: GPTQ 3-bit; per layer, low-routing-frequency experts are ternary (GPTQ) — 114 ternary expert slots, ~4.7% of expert params (1,075,838,976 / 22,951,231,488).
- Attention/conv/dense: 4-bit; router: 8-bit; embeddings: 6-bit (MLX affine, group size 64).
- Storage is standard MLX affine quantization (uniform bits per SwitchGLU stack; ternary values are stored inside regular low-bit tensors), so no custom kernels are needed — stock
mlx-lmloads it (tested with mlx-lm 0.32.0). per_layer_alloc.json/quant_stats.jsondescribe the per-layer allocation.
Usage
pip install mlx-lm
mlx_lm.generate --model Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx --prompt "Hello"
from mlx_lm import load, generate
model, tok = load("Jakevin/LFM2.5-24B-A2B-abliterated-ternary-mlx")
p = tok.apply_chat_template([{"role": "user", "content": "Hello"}], add_generation_prompt=True, tokenize=False)
print(generate(model, tok, p, max_tokens=512))
Peak memory ~13.6 GB during evaluation (Apple Silicon).
Evaluation
Small sample; no confidence intervals.
Harmful prompts (10, 8K cap)
| Model | Refused |
|---|---|
| Official LiquidAI MLX 4-bit | 10/10 |
| This model | 0/10 (8 answered, 2 unfinished at 8K) |
General questions (4, 8K cap)
| Prompt | Official LiquidAI MLX 4-bit | This model |
|---|---|---|
| Taipei night market | 693 tokens, done | 1,354 tokens, done but contains fabricated details |
| Photosynthesis | 153 tokens, done | not finished at 8,192 |
| Fibonacci code | 933 tokens, done | not finished at 8,192 |
| Capital of Japan | 240 tokens, done | 203 tokens, done |
For reference, the non-ternary abliterated 4-bit build (Jakevin/LFM2.5-24B-A2B-abliterated-4bit-mlx) was not run on the same 4-question 8K suite; with a 1,000-token cap it finished 3/4, and the Fibonacci question finished in 1,235 tokens in a separate 8K rerun.
- Downloads last month
- 509
4-bit