Run this model with HF Jobs
Run Sayansantra/LFM3-1.7B-WSP-V3 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Sayansantra/LFM3-1.7B-WSP-V3. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Sayansantra/LFM3-1.7B-WSP-V3 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Sayansantra/LFM3-1.7B-WSP-V3. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use Sayansantra/LFM3-1.7B-WSP-V3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sayansantra/LFM3-1.7B-WSP-V3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sayansantra/LFM3-1.7B-WSP-V3", trust_remote_code=True) 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("Sayansantra/LFM3-1.7B-WSP-V3", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Sayansantra/LFM3-1.7B-WSP-V3", trust_remote_code=True, 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
- llama.cpp
How to use Sayansantra/LFM3-1.7B-WSP-V3 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M # Run inference directly in the terminal: llama cli -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M # Run inference directly in the terminal: llama cli -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
Use Docker
docker model run hf.co/Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Sayansantra/LFM3-1.7B-WSP-V3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sayansantra/LFM3-1.7B-WSP-V3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sayansantra/LFM3-1.7B-WSP-V3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
- SGLang
How to use Sayansantra/LFM3-1.7B-WSP-V3 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 "Sayansantra/LFM3-1.7B-WSP-V3" \ --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": "Sayansantra/LFM3-1.7B-WSP-V3", "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 "Sayansantra/LFM3-1.7B-WSP-V3" \ --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": "Sayansantra/LFM3-1.7B-WSP-V3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Sayansantra/LFM3-1.7B-WSP-V3 with Ollama:
ollama run hf.co/Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
- Unsloth Desktop
- Pi
How to use Sayansantra/LFM3-1.7B-WSP-V3 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Sayansantra/LFM3-1.7B-WSP-V3 with Docker Model Runner:
docker model run hf.co/Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
- Lemonade
How to use Sayansantra/LFM3-1.7B-WSP-V3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
Run and chat with the model
lemonade run user.LFM3-1.7B-WSP-V3-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Sayansantra/LFM3-1.7B-WSP-V3 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
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:9931/v1 hermes config set model.default Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Sayansantra/LFM3-1.7B-WSP-V3 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M
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:9931/v1 \ --custom-model-id "Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Sayansantra/LFM3-1.7B-WSP-V3 (Surgical Weight-Space Programming V3)
A training-free, surgically optimized variant of LiquidAI/LFM3-1.7B produced via Weight-Space Programming (WSP) and Disentangled Neuron Atlas Steering.
By modifying only 0.9742% of the model's weights across mid-to-late GQA attention and SwiGLU FFN layers (with 0 gradient steps, 0 NaN/Inf tensors, and all embeddings/LayerNorms/early syntax layers bit-identical), this model achieves +6.41 points over the official baseline on our 112-task Artificial Analysis-style formal suite, including 100% (12/12) native XML agentic tool-calling accuracy.
Both the full bfloat16 Safetensors checkpoint and the llama-server-verified Q4_K_M GGUF (LFM3-1.7B-WSP-V3-Q4_K_M.gguf (1.02 GB)) are hosted in this repository.
Official Formal Benchmark Results (112 Seed-42 Tasks)
Evaluated deterministically (do_sample=False) on identical stratified splits of TIGER-Lab/MMLU-Pro (40 10-option graduate questions), HuggingFaceH4/MATH-500 (30 competition math problems), openai/openai_humaneval (30 executable Python tasks), and 12 native XML <tool_call> automation tasks:
| Model / Variant | % Weights Changed | MMLU-Pro (40) | MATH-500 (30) | HumanEval (30) | Agentic (12) | Avg Ag Tok | AA-Mini Index |
|---|---|---|---|---|---|---|---|
LFM3-1.7B-WSP-V3 (V3_Fusion_Tuned_a012) |
0.9742% |
12/40 (30.0%) | 15/30 (50.0%) | 19/30 (63.3%) | 12/12 (100%) | 135.2 | 54.83 (+6.41) |
V3_Fusion_Plus_L14Math |
1.0525% | 12/40 (30.0%) | 16/30 (53.3%) | 20/30 (66.7%) | 10/12 (83.3%) | 155.2 | 54.16 (+5.74) |
V3_StemMath_QR_a015 |
1.0553% | 11/40 (27.5%) | 16/30 (53.3%) | 19/30 (63.3%) | 11/12 (91.7%) | 152.9 | 53.82 (+5.40) |
V3_Fusion_NullSpace_Hybrid |
0.8047% | 9/40 (22.5%) | 14/30 (46.7%) | 21/30 (70.0%) | 12/12 (100%) | 135.8 | 53.26 (+4.84) |
Official LiquidAI/LFM3-1.7B (Baseline) |
0.0% | 10/40 (25.0%) | 13/30 (43.3%) | 17/30 (56.7%) | 11/12 (91.7%) | 134.2 | 48.42 |
AA-Mini Index formula:
0.30 * MMLU-Pro% + 0.30 * MATH-500% + 0.25 * HumanEval% + 0.15 * Agentic%.
Surgical Weight-Space Methodology
LFM3-1.7B is a 24-layer hybrid backbone (13 gated short-conv layers + 11 GQA attention layers, hidden=2048, ffn=7680 SwiGLU = 184,320 FFN neurons). Mapping all 24 layers revealed:
- Early layers (
L0–L2) encode surface syntax and short-conv bridge layers (L15, L17, L19) should not be perturbed. - Mid-to-late GQA operators (
L14, L20) and SwiGLU FFNs (L16, L18, L20, L22, L23) control reasoning depth, tool-call decisiveness, and formatting discipline. - Disentangled Neuron Steering: Rather than suppressing all negative agentic FFN directions (which harms math), we classify neurons into non-interfering groups (
Pure-Math,Pure-IFEval, andPure-Bloat).
Exact Applied Recipe (wsp_manifest.json):
- Multi-Axis QR Subspace Projection (
alpha = -0.12): Orthonormalagentic + coding + mathsubspace projection onL14.self_attn.o_proj,L16.feed_forward.w2, andL20.self_attn.o_proj. - Pure-Math FFN Neuron Amplification (
+12%): Top-64 non-interfering math neurons inL16andL18FFNw2. - Pure-IFEval FFN Neuron Amplification (
+10%): Top-64 strict-formatting neurons inL20,L22, andL23FFNw2. - Pure-Bloat Suppression (
alpha = 0.15): Suppressing top-64 hesitant<think>-looping neurons inL16andL18FFNw2without touching math or coding neurons.
Quickstart
1. Local llama.cpp (llama-server with Q4_K_M GGUF)
llama-server -hf Sayansantra/LFM3-1.7B-WSP-V3:Q4_K_M --port 8080 -ngl 99 -c 4096 --jinja
(On 4 GB GPUs such as RTX 3050 Laptop, use -ngl 12 -c 2048.)
2. Hugging Face transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Sayansantra/LFM3-1.7B-WSP-V3"
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map="auto"
)
Verification & Reproducibility
- Non-finite (
NaN/Inf) tensors:0 - Protected tensors (
embed_tokens,embedding_norm,lm_head,*norm.weight): Bit-identical toLiquidAI/LFM3-1.7B - GGUF
Q4_K_MLive Check: Verified viallama-server/v1/chat/completionsendpoint prior to upload. - Full Edit Manifest: Included in
wsp_manifest.json.
- Downloads last month
- 430
Model tree for Sayansantra/LFM3-1.7B-WSP-V3
Base model
LiquidAI/LFM3-1.7B-Base