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/candidate_table.json from yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix: direct link, hf CLI and curl.
- Browser
- Download file 9.89 kB
-
https://huggingface.co/yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix/resolve/main/wsp/candidate_table.json
- Command line
-
hf download hf://yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix/wsp/candidate_table.json
-
curl -L -o candidate_table.json https://huggingface.co/yasserrmd/LFM2.5-1.2B-Instruct-WSP-JSONFix/resolve/main/wsp/candidate_table.json
9.89 kB
| [ | |
| { | |
| "id": "c01", | |
| "hypothesis": "Top-32 fence-writing w2 neurons (L10-15, explore DLA), full removal of u-write", | |
| "changed_scalars": 63108, | |
| "pct": 0.005392276365411735, | |
| "B": 203, | |
| "B_base": 171, | |
| "ctrl_rnd": 171, | |
| "ctrl_scd": 172, | |
| "greedy_B": 51, | |
| "fence": 0, | |
| "obj": 111, | |
| "arr": 92, | |
| "arr_wrong_start": 4, | |
| "arr_lost": 3, | |
| "arr_changed": 47, | |
| "A": 35, | |
| "A_lost": 0, | |
| "C": 57, | |
| "C_lost": 0, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.06974605608557788, | |
| "kl_first_token": 0.8779671788215637, | |
| "kl_passage": 0.000702628109138459, | |
| "card_B": 49, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": true, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c02", | |
| "hypothesis": "Top-64 neurons, alpha 1.0", | |
| "changed_scalars": 125036, | |
| "pct": 0.010683727382037485, | |
| "B": 201, | |
| "B_base": 171, | |
| "ctrl_rnd": 172, | |
| "ctrl_scd": 171, | |
| "greedy_B": 51, | |
| "fence": 0, | |
| "obj": 112, | |
| "arr": 89, | |
| "arr_wrong_start": 5, | |
| "arr_lost": 5, | |
| "arr_changed": 53, | |
| "A": 36, | |
| "A_lost": 0, | |
| "C": 57, | |
| "C_lost": 0, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.06740658702218308, | |
| "kl_first_token": 1.226070523262024, | |
| "kl_passage": 0.0007198884850367904, | |
| "card_B": 51, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": true, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c03", | |
| "hypothesis": "Top-128 neurons, alpha 1.0 (column-budget sweep)", | |
| "changed_scalars": 247436, | |
| "pct": 0.021142221188312386, | |
| "B": 200, | |
| "B_base": 171, | |
| "ctrl_rnd": 172, | |
| "ctrl_scd": 172, | |
| "greedy_B": 50, | |
| "fence": 0, | |
| "obj": 113, | |
| "arr": 87, | |
| "arr_wrong_start": 6, | |
| "arr_lost": 6, | |
| "arr_changed": 56, | |
| "A": 33, | |
| "A_lost": 2, | |
| "C": 56, | |
| "C_lost": 1, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 46, | |
| "F_lost": 2, | |
| "F_balanced": 45, | |
| "ppl_rel_pct": 0.006832348731874619, | |
| "kl_first_token": 1.68700110912323, | |
| "kl_passage": 0.0007575758500024676, | |
| "card_B": 50, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": false, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": false | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G3_ACS", | |
| "G5_arrays", | |
| "G6_fences" | |
| ] | |
| }, | |
| { | |
| "id": "c04", | |
| "hypothesis": "Top-64 neurons, partial removal alpha 0.75 (dose)", | |
| "changed_scalars": 123188, | |
| "pct": 0.010525824632413337, | |
| "B": 203, | |
| "B_base": 171, | |
| "ctrl_rnd": 172, | |
| "ctrl_scd": 172, | |
| "greedy_B": 51, | |
| "fence": 0, | |
| "obj": 111, | |
| "arr": 92, | |
| "arr_wrong_start": 4, | |
| "arr_lost": 3, | |
| "arr_changed": 47, | |
| "A": 34, | |
| "A_lost": 2, | |
| "C": 56, | |
| "C_lost": 1, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.04365867255089998, | |
| "kl_first_token": 0.8644779324531555, | |
| "kl_passage": 0.0006773422355763614, | |
| "card_B": 49, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": false, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G3_ACS", | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c05", | |
| "hypothesis": "Top-32 neurons, overshoot alpha 1.25 (dose)", | |
| "changed_scalars": 63558, | |
| "pct": 0.005430726710287746, | |
| "B": 204, | |
| "B_base": 171, | |
| "ctrl_rnd": 171, | |
| "ctrl_scd": 172, | |
| "greedy_B": 51, | |
| "fence": 0, | |
| "obj": 112, | |
| "arr": 92, | |
| "arr_wrong_start": 4, | |
| "arr_lost": 4, | |
| "arr_changed": 53, | |
| "A": 36, | |
| "A_lost": 0, | |
| "C": 57, | |
| "C_lost": 0, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.0903214756131369, | |
| "kl_first_token": 1.1455447673797607, | |
| "kl_passage": 0.0007336658891290426, | |
| "card_B": 50, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": true, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c06", | |
| "hypothesis": "Layer-15 FFN only, top-64 neurons, alpha 1.0", | |
| "changed_scalars": 123162, | |
| "pct": 0.010523603056931612, | |
| "B": 203, | |
| "B_base": 171, | |
| "ctrl_rnd": 172, | |
| "ctrl_scd": 172, | |
| "greedy_B": 52, | |
| "fence": 0, | |
| "obj": 110, | |
| "arr": 93, | |
| "arr_wrong_start": 2, | |
| "arr_lost": 1, | |
| "arr_changed": 41, | |
| "A": 33, | |
| "A_lost": 3, | |
| "C": 56, | |
| "C_lost": 1, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": 0.010543353799160668, | |
| "kl_first_token": 0.6203965544700623, | |
| "kl_passage": 0.0001765814085956663, | |
| "card_B": 51, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": false, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G3_ACS", | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c07", | |
| "hypothesis": "Layers 12-14 FFN only, top-64 neurons, alpha 1.0 (excludes last layer)", | |
| "changed_scalars": 123548, | |
| "pct": 0.010556584908314145, | |
| "B": 203, | |
| "B_base": 171, | |
| "ctrl_rnd": 171, | |
| "ctrl_scd": 172, | |
| "greedy_B": 51, | |
| "fence": 0, | |
| "obj": 111, | |
| "arr": 92, | |
| "arr_wrong_start": 7, | |
| "arr_lost": 1, | |
| "arr_changed": 46, | |
| "A": 36, | |
| "A_lost": 0, | |
| "C": 56, | |
| "C_lost": 1, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.04767011046267075, | |
| "kl_first_token": 0.8833448886871338, | |
| "kl_passage": 0.0004925022949464619, | |
| "card_B": 49, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": true, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c08", | |
| "hypothesis": "Top-48 neurons + layer-15 conv.out_proj top-16 input channels, alpha 1.0 (operator+FFN)", | |
| "changed_scalars": 125136, | |
| "pct": 0.010692271903121045, | |
| "B": 201, | |
| "B_base": 171, | |
| "ctrl_rnd": 172, | |
| "ctrl_scd": 173, | |
| "greedy_B": 50, | |
| "fence": 0, | |
| "obj": 112, | |
| "arr": 89, | |
| "arr_wrong_start": 7, | |
| "arr_lost": 4, | |
| "arr_changed": 49, | |
| "A": 34, | |
| "A_lost": 2, | |
| "C": 57, | |
| "C_lost": 0, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.14208340808263803, | |
| "kl_first_token": 1.2964017391204834, | |
| "kl_passage": 0.0007245565066114068, | |
| "card_B": 49, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": false, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G3_ACS", | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c09", | |
| "hypothesis": "Top-64 by differential DLA (fencedB minus jsonB), alpha 1.0", | |
| "changed_scalars": 125586, | |
| "pct": 0.010730722247997055, | |
| "B": 111, | |
| "B_base": 171, | |
| "ctrl_rnd": 172, | |
| "ctrl_scd": 170, | |
| "greedy_B": 28, | |
| "fence": 117, | |
| "obj": 27, | |
| "arr": 84, | |
| "arr_wrong_start": 1, | |
| "arr_lost": 2, | |
| "arr_changed": 32, | |
| "A": 36, | |
| "A_lost": 0, | |
| "C": 56, | |
| "C_lost": 1, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.07453622661626728, | |
| "kl_first_token": 0.33516380190849304, | |
| "kl_passage": 0.000685647944919765, | |
| "card_B": 26, | |
| "gates": { | |
| "G1_primary": false, | |
| "G2_greedy": false, | |
| "G3_ACS": true, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G1_primary", | |
| "G2_greedy", | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c10", | |
| "hypothesis": "Top-64 by fencedB DLA minus 0.5x positive F DLA (protect required fences), alpha 1.0", | |
| "changed_scalars": 124483, | |
| "pct": 0.010636476180445411, | |
| "B": 200, | |
| "B_base": 171, | |
| "ctrl_rnd": 174, | |
| "ctrl_scd": 172, | |
| "greedy_B": 50, | |
| "fence": 0, | |
| "obj": 111, | |
| "arr": 89, | |
| "arr_wrong_start": 5, | |
| "arr_lost": 5, | |
| "arr_changed": 51, | |
| "A": 36, | |
| "A_lost": 0, | |
| "C": 57, | |
| "C_lost": 0, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.02627391448543535, | |
| "kl_first_token": 0.9400752186775208, | |
| "kl_passage": 0.0006735011702403426, | |
| "card_B": 49, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": true, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G5_arrays" | |
| ] | |
| }, | |
| { | |
| "id": "c11", | |
| "hypothesis": "Selected-column scaling: top-16 neurons scaled by 0.5 (whole write vector, not directional)", | |
| "changed_scalars": 32768, | |
| "pct": 0.0027998686686602605, | |
| "B": 209, | |
| "B_base": 171, | |
| "ctrl_rnd": 172, | |
| "ctrl_scd": 172, | |
| "greedy_B": 52, | |
| "fence": 0, | |
| "obj": 111, | |
| "arr": 98, | |
| "arr_wrong_start": 2, | |
| "arr_lost": 0, | |
| "arr_changed": 58, | |
| "A": 34, | |
| "A_lost": 1, | |
| "C": 57, | |
| "C_lost": 0, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.0338363373721002, | |
| "kl_first_token": 0.4593990445137024, | |
| "kl_passage": 0.001542521989904344, | |
| "card_B": 52, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": true, | |
| "G4_ppl": true, | |
| "G5_arrays": true, | |
| "G6_fences": true | |
| }, | |
| "passed": true, | |
| "fail_reasons": [] | |
| }, | |
| { | |
| "id": "c12", | |
| "hypothesis": "Top-64 neurons, alpha 1.0 with UNguarded direction u_raw (no {/[ orthogonalization) to test array guard", | |
| "changed_scalars": 125087, | |
| "pct": 0.010688085087790102, | |
| "B": 204, | |
| "B_base": 171, | |
| "ctrl_rnd": 172, | |
| "ctrl_scd": 172, | |
| "greedy_B": 51, | |
| "fence": 0, | |
| "obj": 111, | |
| "arr": 93, | |
| "arr_wrong_start": 0, | |
| "arr_lost": 3, | |
| "arr_changed": 51, | |
| "A": 33, | |
| "A_lost": 2, | |
| "C": 56, | |
| "C_lost": 1, | |
| "S": 64, | |
| "S_lost": 0, | |
| "F": 48, | |
| "F_lost": 0, | |
| "F_balanced": 48, | |
| "ppl_rel_pct": -0.062281844356339544, | |
| "kl_first_token": 1.2112196683883667, | |
| "kl_passage": 0.0007187300361692905, | |
| "card_B": 50, | |
| "gates": { | |
| "G1_primary": true, | |
| "G2_greedy": true, | |
| "G3_ACS": false, | |
| "G4_ppl": true, | |
| "G5_arrays": false, | |
| "G6_fences": true | |
| }, | |
| "passed": false, | |
| "fail_reasons": [ | |
| "G3_ACS", | |
| "G5_arrays" | |
| ] | |
| } | |
| ] |