LFM2.5-1.2B-Instruct-WSP-JSONFix
weight edit for strict JSON output
1 min readupdated
A modified version of LiquidAI/LFM2.5-1.2B-Instruct (1.17B parameters) that fixes the base model's habit of wrapping outputs in Markdown code blocks when strict JSON is requested. The fix requires no fine-tuning, gradient descent, or LoRA—instead, it directly adjusts 32,768 BF16 values (0.0028% of the weights) across layers 12–15. It is built for developers who need clean JSON responses from an LLM without extra wrapper characters.
Key features
- Fixes output behavior without extra training or dataset changes
- Targeted weight scaling in FFN down-projection layers (
w2) - Retains the ability to output standard code blocks when explicitly asked
- Fully compatible with the base tokenizer and chat template
What you can do
- Use the model in parsing pipelines and JSON API response generation
- Integrate it into automation scripts for tool calling and utility workflows
Example
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("yasserrmd/LFM2.5-1.2B-JSONFix")
model = AutoModelForCausalLM.from_pretrained("yasserrmd/LFM2.5-1.2B-JSONFix", dtype="bfloat16")
Read more
DetailsBase model: LiquidAI/LFM2.5-1.2B-Instruct
Library: transformers
Precision: BF16
License: LFM Open License v1.0










Comments