Text Generation
Transformers
Safetensors
GGUF
lfm3
liquid
depth-loop
training-free
custom_code
conversational
Instructions to use vaultpls/LFM3-1.7B-Looped with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vaultpls/LFM3-1.7B-Looped with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vaultpls/LFM3-1.7B-Looped", 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("vaultpls/LFM3-1.7B-Looped", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("vaultpls/LFM3-1.7B-Looped", 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 vaultpls/LFM3-1.7B-Looped 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 vaultpls/LFM3-1.7B-Looped:Q8_0 # Run inference directly in the terminal: llama cli -hf vaultpls/LFM3-1.7B-Looped:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf vaultpls/LFM3-1.7B-Looped:Q8_0 # Run inference directly in the terminal: llama cli -hf vaultpls/LFM3-1.7B-Looped:Q8_0
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 vaultpls/LFM3-1.7B-Looped:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf vaultpls/LFM3-1.7B-Looped:Q8_0
Use Docker
docker model run hf.co/vaultpls/LFM3-1.7B-Looped:Q8_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use vaultpls/LFM3-1.7B-Looped with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vaultpls/LFM3-1.7B-Looped" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vaultpls/LFM3-1.7B-Looped", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vaultpls/LFM3-1.7B-Looped:Q8_0
- SGLang
How to use vaultpls/LFM3-1.7B-Looped 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 "vaultpls/LFM3-1.7B-Looped" \ --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": "vaultpls/LFM3-1.7B-Looped", "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 "vaultpls/LFM3-1.7B-Looped" \ --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": "vaultpls/LFM3-1.7B-Looped", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use vaultpls/LFM3-1.7B-Looped with Ollama:
ollama run hf.co/vaultpls/LFM3-1.7B-Looped:Q8_0
- Unsloth Desktop
- Pi
How to use vaultpls/LFM3-1.7B-Looped with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf vaultpls/LFM3-1.7B-Looped:Q8_0
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": "vaultpls/LFM3-1.7B-Looped:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use vaultpls/LFM3-1.7B-Looped with Docker Model Runner:
docker model run hf.co/vaultpls/LFM3-1.7B-Looped:Q8_0
- Lemonade
How to use vaultpls/LFM3-1.7B-Looped with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull vaultpls/LFM3-1.7B-Looped:Q8_0
Run and chat with the model
lemonade run user.LFM3-1.7B-Looped-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use vaultpls/LFM3-1.7B-Looped with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf vaultpls/LFM3-1.7B-Looped:Q8_0
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 vaultpls/LFM3-1.7B-Looped:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use vaultpls/LFM3-1.7B-Looped with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf vaultpls/LFM3-1.7B-Looped:Q8_0
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 "vaultpls/LFM3-1.7B-Looped:Q8_0" \ --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"
|
Download README.md from vaultpls/LFM3-1.7B-Looped: direct link, hf CLI and curl.
- Browser
- Download file 4.74 kB
-
https://huggingface.co/vaultpls/LFM3-1.7B-Looped/resolve/main/README.md
- Command line
-
hf download hf://vaultpls/LFM3-1.7B-Looped/README.md
-
curl -L -o README.md https://huggingface.co/vaultpls/LFM3-1.7B-Looped/resolve/main/README.md
4.74 kB
| library_name: transformers | |
| license: other | |
| license_name: lfm1.0 | |
| license_link: https://huggingface.co/LiquidAI/LFM3-1.7B-Base/blob/main/LICENSE | |
| pipeline_tag: text-generation | |
| base_model: LiquidAI/LFM3-1.7B-Base | |
| tags: | |
| - liquid | |
| - lfm3 | |
| - depth-loop | |
| - training-free | |
| - gguf | |
| - custom_code | |
| language: | |
| - en | |
| - ar | |
| - zh | |
| - fr | |
| - de | |
| - it | |
| - ja | |
| - ko | |
| - pt | |
| - es | |
| - vi | |
| - th | |
| - id | |
| - hi | |
| - ru | |
| - pl | |
| # LFM3-1.7B-Looped (layers 8-11, run twice) | |
| LFM3-1.7B-Base with **layers 8–11 executed twice**, each pass contributing **half a residual step**. | |
| Training-free: no gradients, no new parameters, no data. The result is a plain 28-layer model, so it | |
| generates with a stock KV cache and runs in llama.cpp. | |
| ## Model details | |
| * Base: [LiquidAI/LFM3-1.7B-Base](https://huggingface.co/LiquidAI/LFM3-1.7B-Base) — 24 layers, hybrid | |
| shortconv/attention, 2048 hidden, 7680 FFN, sliding-window attention every 4th layer. | |
| * Modification: layers 8–11 duplicated once (new layers 12–15), and | |
| `post_attention_norm.weight` / `post_ffw_norm.weight` multiplied by 0.5 on both the originals and | |
| the copies. All later layers renumbered. `block_count` 24 → 28. | |
| * Parameters: 1.73B → 1.97B. Q8_0 file 1.84 → 2.10 GB. | |
| * Nothing else is changed: no fine-tuning, no merging, no calibration data. | |
| The loop is the damped fixed point `h ← h + 0.5 · (G(h) − h)` applied twice, where `G` is the | |
| four-layer block. Damping lives in the post-norms because those are applied to the branch output | |
| before the residual add, in both the HF code and llama.cpp's `lfm3.cpp`; scaling `o_proj`/`w2` | |
| instead would be divided out by the following RMSNorm. Verified exact: max|Δlogit| = 0.0 against a | |
| runtime reference wrapper, 0.5× on every scaled tensor in the GGUF. | |
| ## Evaluation | |
| Same items, both models, paired. Full details and the negative results are in the repository README. | |
| | benchmark | base | this model | Δ | | |
| |---|---|---|---| | |
| | ARC-Easy 5-shot (n=1000) | 60.8 | 69.2 | +8.4 pp, p=2.4e-9 | | |
| | ARC-Challenge 5-shot (n=1000) | 30.0 | 34.1 | +4.1 pp | | |
| | HellaSwag 0-shot (n=10042) | 53.6 | 54.3 | +0.7 pp, p=0.006 | | |
| | WinoGrande 0-shot (n=1267) | 54.7 | 57.4 | +2.7 pp, p=0.014 | | |
| | ARC-Easy 0-shot (n=2376) | 38.5 | 41.0 | +2.5 pp, p=0.0001 | | |
| | ARC-Challenge 0-shot (n=1172) | 26.1 | 27.7 | +1.6 pp, p=0.073 | | |
| | PIQA 0-shot (n=1838) | 60.3 | 60.6 | +0.3 pp (n.s.) | | |
| | BoolQ 0-shot (n=3270) | 75.4 | 74.8 | −0.6 pp (n.s.) | | |
| | wikitext PPL (HF) | 24.73 | 23.62 | −4.5% | | |
| | wikitext PPL (llama.cpp Q8) | 18.29 | 17.87 | −2.3% | | |
| Throughput on an RTX 4070, Q8_0, `-ngl 99`, isolated llama-bench: pp512 18184 → 16699 t/s, | |
| tg128 160.31 → 142.55 t/s. | |
| ## Use | |
| llama.cpp (needs the LFM3 architecture, master ≥ `1014775c8`): | |
| ```bash | |
| llama-server -m LFM3-1.7B-loop-8-11-Q8_0.gguf --alias lfm3-loop -ngl 99 -fa on -c 131072 --jinja | |
| ``` | |
| transformers: | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| tok = AutoTokenizer.from_pretrained("vaultpls/LFM3-1.7B-Looped", trust_remote_code=True) | |
| m = AutoModelForCausalLM.from_pretrained("vaultpls/LFM3-1.7B-Looped", trust_remote_code=True, dtype="bfloat16") | |
| ids = tok("The capital of France is", return_tensors="pt").input_ids | |
| print(tok.decode(m.generate(ids, max_new_tokens=32, do_sample=False)[0])) | |
| ``` | |
| The `hf/` folder carries the custom `modeling_lfm3.py`, `configuration_lfm3.py` and `lfm3_conv.py` | |
| needed by `trust_remote_code`. | |
| ## Limitations | |
| * **Base checkpoint**, not instruction-tuned. With the chat template it emits a thinking trace | |
| (`reasoning_content`) and returns empty `content` if `max_tokens` is too small. Use | |
| `/v1/completions` for plain text, or set `chat_template_kwargs: {"enable_thinking": false}`. | |
| * Gains are configuration-dependent: +8.4 pp on ARC-Easy at 5-shot vs +2.5 pp at 0-shot. The | |
| canonical 25-shot ARC / 10-shot HellaSwag settings were not run. | |
| * One model, one window, one architecture family. Late-layer loops degrade the model; don't move the | |
| window into the last quarter without re-measuring. | |
| * ~11% slower decode, ~14% larger file. | |
| * No safety tuning was applied beyond whatever the base model carries. | |
| ## License | |
| LFM Open License v1.0, inherited from the base model — commercial use limited by the revenue | |
| threshold in Section 5. See `LICENSE`. Modified files are listed in `NOTICE`. Not affiliated with or | |
| endorsed by Liquid AI; "LFM" is used only to describe the origin of the weights. | |
| ## Citation | |
| ```bibtex | |
| @misc{lfm3_loop_8_11, | |
| title = {LFM3-1.7B-loop-8-11: a training-free depth loop}, | |
| year = {2026}, | |
| note = {Derived from LiquidAI/LFM3-1.7B-Base by executing layers 8--11 twice at half step}, | |
| } | |
| ``` | |
| Method inspired by arXiv 2605.23872 (training-free looping / damped sub-steps). | |