license: other
license_name: lfm1.0
license_link: LICENSE
base_model: Vortecks/LFM3-1.7B-Heretic-Abliterated
library_name: mlx
pipeline_tag: text-generation
language:
- en
- ar
- zh
- fr
- de
- it
- ja
- ko
- pt
- es
- vi
- th
- id
- hi
- ru
- pl
tags: - mlx
- apple-silicon
- liquid
- lfm3
- edge
- conversational
- tool-calling
- custom_code
- heretic
- abliterated
- uncensored
- bf16
LFM3-1.7B Heretic Abliterated · MLX · bf16
An MLX port of Vortecks/LFM3-1.7B-Heretic-Abliterated
for Apple silicon. The weights are the source's bfloat16 bytes, unchanged. There is no quantization, pruning,
fine-tuning or new abliteration. The model has its refusal behavior removed, so it applies no safety filtering
of its own.
The port matches the reference implementation within the declared tolerances on every check
(results). All 286 tensors are bit-identical to the source.
| Base model | LiquidAI/LFM3-1.7B |
| Abliteration | Vortecks, with Heretic |
| Parameters | ~1.73B, bfloat16 (3.46 GB) |
| Architecture | Lfm3ForCausalLM, 24 layers: 13 gated short convolutions, 5 sliding-window attention, 6 global attention |
| Context | 262,144 tokens |
| Languages | 16 (see metadata) |
| Runtime | mlx-lm 0.32.2 or later, with trust_remote_code=True |
| License | LFM Open License v1.0 (LICENSE) |
How to use
mlx-lm has no built-in LFM3 architecture. This repo ships one as lfm3.py, and config.json points to it.
mlx-lm runs that file only when you pass trust_remote_code. Read lfm3.py before you run it.
pip install -U mlx-lm
mlx_lm.generate --model mchen04/LFM3-1.7B-Heretic-Abliterated-MLX-bf16 --trust-remote-code \
--temp 0.1 --top-k 50 --prompt "Who are you?"
from mlx_lm import load, generate
model, tokenizer = load("mchen04/LFM3-1.7B-Heretic-Abliterated-MLX-bf16", trust_remote_code=True)
messages = [{"role": "user", "content": "Who are you?"}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512, verbose=True))
Resident inference needs about 4 GB of free unified memory.
Recommended sampling, from the source model card:
| Mode | Settings |
|---|---|
| General (chat, tool use, agents, coding) | temperature=0.1, top_k=50, repetition_penalty=1.1 |
| Math and STEM | temperature=1.0, top_p=0.95, top_k=20 |
mlx-lm applies repetition_penalty to the last 20 tokens by default. Transformers applies it to the whole
context. Set repetition_context_size in make_logits_processors if you need to match transformers.
The chat template supports tool calls and a thinking block, as in the source model. Pass tools=[...] toapply_chat_template for tool use.
Uses
Intended: local chat, tool calling, structured output and long-context work on Apple silicon, for research
and applications that provide their own moderation.
Out of scope: any use without your own safety layer where outputs reach other people. Uses that the
LFM Open License or applicable law forbid.
Risks and limitations
- No refusals. Vortecks reports 3/100 refusals on Heretic's adversarial prompt set, against 92/100 for the
base model. The model will produce harmful, false or offensive content on request. The deployer is responsible
for moderation and policy compliance. - Abliteration changes the model. Vortecks reports a KL divergence of 0.0094 from the base model. That is
small, but abliteration can still lower some abilities. This port did not test refusal rates or benchmark
scores. It tests only that the port behaves the same as the source model. - Strict JSON can fail. On the two JSON prompts in the test set, the source model fails strict parsing in
every run: once with unquoted keys and once with text after the array. This port reproduces that exactly.
Validate structured output. - bfloat16 ties. Greedy decoding at bfloat16 sometimes meets exact logit ties. Equally valid implementations
can then choose different tokens, so outputs can differ from transformers after a tie. - Custom code. Loading runs
lfm3.pyfrom this repo. - Speed not measured. The verification ran on a 16 GB M2 under a memory cap, with weights streamed layer by
layer. This card gives no tokens-per-second figure for normal resident inference.
Evaluation
The checks compare this port with the source repo's own transformers code, pinned by revision. Each runs at
float32 and at bfloat16, on the same token ids, over 9 prompts: chat, translation, multi-turn memory, JSON,
tool call, tool follow-up and long-context retrieval. The pass criteria were committed before any real-model
run (evidence/TOLERANCES.md).
| Check | Result |
|---|---|
| T1 tensors vs source safetensors | PASS: 286/286 bit-identical |
| T2 source safetensors vs Vortecks' BF16 GGUF | PASS: 286/286 bit-identical |
| T3 float32 logits, port vs reference (2,076 positions) | PASS: max |Δ| 1.44e-3 (limit 5e-3), mean KL 2.3e-10, top-1 100% |
| T4 float32 greedy continuations | PASS: 9/9 identical |
| T5 bfloat16 logits vs float32 reference | PASS: mean KL 3.73e-3 for the port, 5.39e-3 for the reference's own bfloat16 run |
| T6 bfloat16 greedy, port vs reference | PASS: 6/9 identical; the 3 differences follow near-ties (margins 0.125–0.25, limit 0.5) |
| T7 chat template rendering and output format | PASS: identical on all 9 conversations; tool call correct in every run |
| T8 KV-cache decode vs full forward | PASS: max |Δ| 4.33e-3 (limit 5e-3) |
Full numbers and greedy outputs: evidence/REPORT.md and
evidence/report.json. Hardware: Apple M2, 16 GB, mlx 0.32 and mlx-lm 0.32.2.
What changed from the source
The LFM Open License asks for notice of modified files. Only these differ from
Vortecks/LFM3-1.7B-Heretic-Abliterated at
revision dc37c60c02a35603456c85c2aecd7bc22b23b89c:
model.safetensors: the 13 depthwise convolution kernels are stored as(C, K, 1)instead of(C, 1, K),
which is the MLX layout. The values are the same bytes. Every other tensor is unchanged.config.json:auto_mapremoved,"model_file": "lfm3.py"added.lfm3.py: new, an MLX implementation of the LFM3 architecture.convert_manifest.json: new, the sha256 of every input and output file and each change applied.evidence/: new, the verification results.
The tokenizer, chat template and generation config are byte-for-byte copies of the source.
License
This model is a derivative of LiquidAI/LFM3-1.7B and is
distributed under the LFM Open License v1.0. The full text is in LICENSE. The license does not
cover commercial use by an entity with annual revenue of USD 10 million or more. Read the license for the exact
terms.
Credits
- Liquid AI for LFM3-1.7B.
- Vortecks for the Heretic abliteration.
- Heretic by p-e-w.
- Arditi et al., Refusal in Language Models Is Mediated by a Single Direction, 2024.