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/code_select.py from HelioAI/LFM3-1.7B-inference-modules-experiments: direct link, hf CLI and curl.
- Browser
- Download file 2.66 kB
-
https://huggingface.co/HelioAI/LFM3-1.7B-inference-modules-experiments/resolve/main/research/scripts/code_select.py
- Command line
-
hf download hf://HelioAI/LFM3-1.7B-inference-modules-experiments/research/scripts/code_select.py
-
curl -L -o code_select.py https://huggingface.co/HelioAI/LFM3-1.7B-inference-modules-experiments/resolve/main/research/scripts/code_select.py
2.66 kB
| """Candidate selection for code: K independent answers (each already through the deliberation fallback) are run on | |
| the statement's public tests; the kept answer is the first candidate that passes all of them, else the candidate | |
| passing the most (ties: the earliest sample). Only public tests are used, never the hidden grading tests. | |
| The output keeps one record per (problem, sample 0) so it is graded like a single answer; n_tokens = sum over the | |
| candidates actually generated (all K are counted, the cost of selection). | |
| usage: code_select.py --src results/lcb_dm/lcb.jsonl results/lcb_dm2/lcb.jsonl ... --items data/lcb/lcb6.jsonl | |
| --out results/lcb_sel/lcb.jsonl [--k 4] | |
| """ | |
| import argparse | |
| import collections | |
| import json | |
| import os | |
| import sys | |
| from concurrent.futures import ThreadPoolExecutor | |
| sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | |
| from grade import extract_code # noqa: E402 | |
| from public_tests import run_public # noqa: E402 | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--src", nargs="+", required=True) | |
| ap.add_argument("--items", nargs="+", required=True) | |
| ap.add_argument("--out", required=True) | |
| ap.add_argument("--k", type=int, default=4) | |
| a = ap.parse_args() | |
| items = {} | |
| for p in a.items: | |
| for l in open(p, encoding="utf-8"): | |
| r = json.loads(l) | |
| items[r["id"]] = r | |
| cands = collections.defaultdict(list) | |
| for p in a.src: | |
| for l in open(p, encoding="utf-8"): | |
| r = json.loads(l) | |
| cands[r["id"]].append(r) | |
| def kind(it): | |
| return "lcb" if it["task"] == "lcb" else "humaneval" if it["task"] == "humaneval" else \ | |
| "mbpp" if it["task"] in ("mbpp", "code_fn") else "code_io" | |
| def pick(pid): | |
| rs = sorted(cands[pid], key=lambda r: r["sample"])[: a.k] | |
| it = items[pid] | |
| best, best_key = rs[0], (-1, 0) | |
| for i, r in enumerate(rs): | |
| fin = r["completion"].split("</think>", 1)[1] if "</think>" in r["completion"] else "" | |
| code = extract_code(fin) | |
| ok, tot = (run_public(kind(it), code, it["prompt"], it)[:2] if code else (0, 1)) | |
| if (ok, -i) > best_key: | |
| best, best_key = r, (ok, -i) | |
| if tot and ok == tot: | |
| break | |
| return {**best, "sample": 0, "n_tokens": sum(r["n_tokens"] for r in rs), "picked": best["sample"], | |
| "public_passed": best_key[0]} | |
| with ThreadPoolExecutor(12) as ex: | |
| out = list(ex.map(pick, list(cands))) | |
| os.makedirs(os.path.dirname(a.out), exist_ok=True) | |
| with open(a.out, "w", encoding="utf-8") as f: | |
| for r in out: | |
| f.write(json.dumps(r, ensure_ascii=False) + "\n") | |
| print(len(out), "problems; picked sample distribution:", collections.Counter(r["picked"] for r in out)) | |