Safetensors
GGUF
English
Russian
lfm3
reasoning
test-time-compute
inference-time-scaling
code-generation
llama.cpp
negative-results
conversational
Instructions to use HelioAI/LFM3-1.7B-inference-modules-experiments with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use HelioAI/LFM3-1.7B-inference-modules-experiments 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 HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M # Run inference directly in the terminal: llama cli -hf HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M # Run inference directly in the terminal: llama cli -hf HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_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 HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M
Use Docker
docker model run hf.co/HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use HelioAI/LFM3-1.7B-inference-modules-experiments with Ollama:
ollama run hf.co/HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M
- Unsloth Desktop
- Pi
How to use HelioAI/LFM3-1.7B-inference-modules-experiments with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_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:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use HelioAI/LFM3-1.7B-inference-modules-experiments with Docker Model Runner:
docker model run hf.co/HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M
- Lemonade
How to use HelioAI/LFM3-1.7B-inference-modules-experiments with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M
Run and chat with the model
lemonade run user.LFM3-1.7B-inference-modules-experiments-Q5_K_M
List all available models
lemonade list
- Hermes Agent
How to use HelioAI/LFM3-1.7B-inference-modules-experiments with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_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:8080/v1 hermes config set model.default HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use HelioAI/LFM3-1.7B-inference-modules-experiments with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_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:8080/v1 \ --custom-model-id "HelioAI/LFM3-1.7B-inference-modules-experiments:Q5_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"
Download research/scripts/loop_layers.py from HelioAI/LFM3-1.7B-inference-modules-experiments: direct link, hf CLI and curl.
- Browser
- Download file 2.5 kB
-
https://huggingface.co/HelioAI/LFM3-1.7B-inference-modules-experiments/resolve/main/research/scripts/loop_layers.py
- Command line
-
hf download hf://HelioAI/LFM3-1.7B-inference-modules-experiments/research/scripts/loop_layers.py
-
curl -L -o loop_layers.py https://huggingface.co/HelioAI/LFM3-1.7B-inference-modules-experiments/resolve/main/research/scripts/loop_layers.py
2.5 kB
| """Depth recurrence without new parameters: rebuild a GGUF whose layer sequence revisits a block of layers. | |
| e.g. --order 0-13,10-13,14-23 runs layers 10..13 twice (the second pass reuses the same weights; it gets its own | |
| KV/conv state because llama.cpp sees it as a separate layer). Per-layer metadata arrays are remapped. | |
| usage: loop_layers.py in.gguf out.gguf --order 0-13,10-13,14-23""" | |
| import argparse, re, numpy as np | |
| import gguf | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("inp"); ap.add_argument("out"); ap.add_argument("--order", default="0-23") | |
| ap.add_argument("--window", type=int, default=None, help="override the sliding-attention window") | |
| ap.add_argument("--global-swa", action="store_true", help="turn every sliding-attention layer into full attention") | |
| a = ap.parse_args() | |
| order = [] | |
| for part in a.order.split(","): | |
| lo, hi = map(int, part.split("-")) if "-" in part else (int(part), int(part)) | |
| order += list(range(lo, hi + 1)) | |
| r = gguf.GGUFReader(a.inp) | |
| arch = r.fields["general.architecture"].contents() | |
| w = gguf.GGUFWriter(a.out, arch) | |
| per_layer = {f"{arch}.attention.head_count_kv", f"{arch}.attention.sliding_window_pattern"} | |
| for f in r.fields.values(): | |
| if f.name == "general.architecture" or f.name.startswith("GGUF."): | |
| continue | |
| vt = f.types[0] | |
| st = f.types[-1] if vt == gguf.GGUFValueType.ARRAY else None | |
| v = f.contents() | |
| if f.name == f"{arch}.block_count": | |
| v = len(order) | |
| elif f.name in per_layer: | |
| v = [v[i] for i in order] | |
| if a.global_swa and f.name.endswith("sliding_window_pattern"): | |
| v = [False] * len(v) | |
| elif f.name == f"{arch}.attention.sliding_window" and a.window: | |
| v = a.window | |
| w.add_key_value(f.name, v, vt, sub_type=st) | |
| w.add_string("general.layer_order", a.order) | |
| src = {t.name: t for t in r.tensors} | |
| out = [] | |
| for t in r.tensors: | |
| if not t.name.startswith("blk."): | |
| out.append((t.name, t)) | |
| for new_i, old_i in enumerate(order): | |
| for name, t in src.items(): | |
| m = re.match(rf"blk\.{old_i}\.(.+)", name) | |
| if m: | |
| out.append((f"blk.{new_i}.{m.group(1)}", t)) | |
| for name, t in out: | |
| w.add_tensor_info(name, t.data.shape, t.data.dtype, t.data.nbytes, t.tensor_type) | |
| w.write_header_to_file(); w.write_kv_data_to_file(); w.write_ti_data_to_file() | |
| for name, t in out: | |
| w.write_tensor_data(t.data, tensor_endianess=r.endianess) | |
| w.close() | |
| print("wrote", a.out, len(order), "layers:", order) | |