Text Generation
Transformers
Safetensors
lfm2
liquid
lfm2.5
weight-editing
model-editing
json
training-free
conversational
Instructions to use yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix") model = AutoModelForCausalLM.from_pretrained("yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix
- SGLang
How to use yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix with Docker Model Runner:
docker model run hf.co/yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix
Download wsp/chosen_patch.json from yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix: direct link, hf CLI and curl.
- Browser
- Download file 3.06 kB
-
https://huggingface.co/yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix/resolve/main/wsp/chosen_patch.json
- Command line
-
hf download hf://yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix/wsp/chosen_patch.json
-
curl -L -o chosen_patch.json https://huggingface.co/yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix/resolve/main/wsp/chosen_patch.json
3.06 kB
| { | |
| "meta": [ | |
| { | |
| "param": "model.layers.12.feed_forward.w2.weight", | |
| "kind": "scale", | |
| "n_cols": 3, | |
| "alpha": null, | |
| "scale": 0.5, | |
| "dir": "u", | |
| "fp32_delta_fro": 0.4245277941226959 | |
| }, | |
| { | |
| "param": "model.layers.13.feed_forward.w2.weight", | |
| "kind": "scale", | |
| "n_cols": 3, | |
| "alpha": null, | |
| "scale": 0.5, | |
| "dir": "u", | |
| "fp32_delta_fro": 0.42069733142852783 | |
| }, | |
| { | |
| "param": "model.layers.14.feed_forward.w2.weight", | |
| "kind": "scale", | |
| "n_cols": 1, | |
| "alpha": null, | |
| "scale": 0.5, | |
| "dir": "u", | |
| "fp32_delta_fro": 0.21136318147182465 | |
| }, | |
| { | |
| "param": "model.layers.15.feed_forward.w2.weight", | |
| "kind": "scale", | |
| "n_cols": 9, | |
| "alpha": null, | |
| "scale": 0.5, | |
| "dir": "u", | |
| "fp32_delta_fro": 0.6414475440979004 | |
| } | |
| ], | |
| "changed_scalars": 32768, | |
| "params": { | |
| "model.layers.12.feed_forward.w2.weight": { | |
| "shape": [ | |
| 2048, | |
| 8192 | |
| ], | |
| "dtype": "torch.bfloat16", | |
| "stored_delta_fro": 0.4245277941226959, | |
| "orig_param_sha256": "067ff8e12180fa846bdcb760afd760fd05faab5b1b93758570d4f2bb0c21bfff", | |
| "n_changed": 6144 | |
| }, | |
| "model.layers.13.feed_forward.w2.weight": { | |
| "shape": [ | |
| 2048, | |
| 8192 | |
| ], | |
| "dtype": "torch.bfloat16", | |
| "stored_delta_fro": 0.42069730162620544, | |
| "orig_param_sha256": "65e32f6f6547e8aa25c5c7af8daa4a0e3a7ea698b6b9954c97ba8bfa453e9b28", | |
| "n_changed": 6144 | |
| }, | |
| "model.layers.14.feed_forward.w2.weight": { | |
| "shape": [ | |
| 2048, | |
| 8192 | |
| ], | |
| "dtype": "torch.bfloat16", | |
| "stored_delta_fro": 0.21136318147182465, | |
| "orig_param_sha256": "4c062b2b883563da02f39495b5198b7d82aa18ba49020b68781327cf9ef3fb93", | |
| "n_changed": 2048 | |
| }, | |
| "model.layers.15.feed_forward.w2.weight": { | |
| "shape": [ | |
| 2048, | |
| 8192 | |
| ], | |
| "dtype": "torch.bfloat16", | |
| "stored_delta_fro": 0.6414475440979004, | |
| "orig_param_sha256": "fd2d9d919ab0ad882e397178b562c1019b286ff4d6b214db27a506522d00496e", | |
| "n_changed": 18432 | |
| } | |
| }, | |
| "id": "c11", | |
| "hypothesis": "Selected-column scaling: top-16 neurons scaled by 0.5 (whole write vector, not directional)", | |
| "edits_spec": [ | |
| { | |
| "param": "model.layers.12.feed_forward.w2.weight", | |
| "cols": [ | |
| 4731, | |
| 7264, | |
| 7919 | |
| ], | |
| "kind": "scale", | |
| "alpha": null, | |
| "scale": 0.5, | |
| "dir": "u" | |
| }, | |
| { | |
| "param": "model.layers.13.feed_forward.w2.weight", | |
| "cols": [ | |
| 488, | |
| 5186, | |
| 6715 | |
| ], | |
| "kind": "scale", | |
| "alpha": null, | |
| "scale": 0.5, | |
| "dir": "u" | |
| }, | |
| { | |
| "param": "model.layers.14.feed_forward.w2.weight", | |
| "cols": [ | |
| 3659 | |
| ], | |
| "kind": "scale", | |
| "alpha": null, | |
| "scale": 0.5, | |
| "dir": "u" | |
| }, | |
| { | |
| "param": "model.layers.15.feed_forward.w2.weight", | |
| "cols": [ | |
| 99, | |
| 532, | |
| 660, | |
| 926, | |
| 2017, | |
| 2439, | |
| 3263, | |
| 3682, | |
| 5191 | |
| ], | |
| "kind": "scale", | |
| "alpha": null, | |
| "scale": 0.5, | |
| "dir": "u" | |
| } | |
| ], | |
| "pct_unique": 0.0027998686686602605, | |
| "within_0.05pct": true, | |
| "seed": 20261118, | |
| "safetensors_sha256": "38b9bb6891edfe0064c76faf057e94f33ed7f77a8e08fb7088db7a53efc41d59", | |
| "selected": true, | |
| "selection_utc": "2026-11-18T17:24:09Z" | |
| } |