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/lcb_official_runner.py from HelioAI/LFM3-1.7B-inference-modules-experiments: direct link, hf CLI and curl.
- Browser
- Download file 8.86 kB
-
https://huggingface.co/HelioAI/LFM3-1.7B-inference-modules-experiments/resolve/main/research/scripts/lcb_official_runner.py
- Command line
-
hf download hf://HelioAI/LFM3-1.7B-inference-modules-experiments/research/scripts/lcb_official_runner.py
-
curl -L -o lcb_official_runner.py https://huggingface.co/HelioAI/LFM3-1.7B-inference-modules-experiments/resolve/main/research/scripts/lcb_official_runner.py
8.86 kB
| """Runs one LiveCodeBench problem the way the official harness does (lcb_runner/evaluation/testing_util.py of | |
| LiveCodeBench, read 2026-11-06): the same import prelude, stdin programs wrapped into wrapped_function() after removing a | |
| final `if __name__ == '__main__':`, the same mocked stdin (MockStdinWithBuffer), stdout capture and comparison (exact | |
| line match, else Decimal equality), call-based results compared with == (tuple -> list), the same reliability_guard. | |
| Windows has no SIGALRM, so each test's 6 s limit is enforced by a watchdog thread that reports a timeout and ends the | |
| process. All tests of one problem run in one process, in order, stopping at the first failure. | |
| usage (from lcb_official.py): python -I lcb_official_runner.py payload.json -> one JSON line per test on stdout | |
| """ | |
| import ast | |
| import faulthandler | |
| import json | |
| import os | |
| import platform # noqa: F401 (reliability_guard of the original refers to it) | |
| import sys | |
| import threading | |
| from decimal import Decimal | |
| from io import StringIO | |
| from types import ModuleType | |
| from unittest.mock import mock_open, patch | |
| import numpy as np # noqa: F401 (testing_util.py imports numpy before reliability_guard, so solutions can import it) | |
| import_string = "from string import *\nfrom re import *\nfrom datetime import *\nfrom collections import *\nfrom heapq import *\nfrom bisect import *\nfrom copy import *\nfrom math import *\nfrom random import *\nfrom statistics import *\nfrom itertools import *\nfrom functools import *\nfrom operator import *\nfrom io import *\nfrom sys import *\nfrom json import *\nfrom builtins import *\nfrom typing import *\nimport string\nimport re\nimport datetime\nimport collections\nimport heapq\nimport bisect\nimport copy\nimport math\nimport random\nimport statistics\nimport itertools\nimport functools\nimport operator\nimport io\nimport sys\nimport json\nsys.setrecursionlimit(50000)\n" | |
| class Capturing(list): | |
| def __enter__(self): | |
| self._stdout = sys.stdout | |
| sys.stdout = self._stringio = StringIO() | |
| self._stringio.close = lambda x: 1 | |
| return self | |
| def __exit__(self, *args): | |
| self.append(self._stringio.getvalue()) | |
| del self._stringio | |
| sys.stdout = self._stdout | |
| class MockBuffer: | |
| def __init__(self, inputs: str): | |
| self.inputs = inputs.encode("utf-8") | |
| def read(self, *args): | |
| return self.inputs | |
| def readline(self, *args): | |
| return self.inputs.split(b"\n")[0] + b"\n" | |
| class MockStdinWithBuffer: | |
| def __init__(self, inputs: str): | |
| self.inputs = inputs | |
| self._stringio = StringIO(inputs) | |
| self.buffer = MockBuffer(inputs) | |
| def read(self, *args): | |
| return self.inputs | |
| def readline(self, *args): | |
| return self._stringio.readline(*args) | |
| def readlines(self, *args): | |
| return self.inputs.split("\n") | |
| def __getattr__(self, name): | |
| return getattr(self._stringio, name) | |
| def call_method(method, inputs): | |
| if isinstance(inputs, list): | |
| inputs = "\n".join(inputs) | |
| inputs_line_iterator = iter(inputs.split("\n")) | |
| mock_stdin = MockStdinWithBuffer(inputs) | |
| def _inner_call_method(_method): | |
| try: | |
| return _method() | |
| except SystemExit: | |
| pass | |
| return _inner_call_method(method) | |
| def clean_if_name(code: str) -> str: | |
| try: | |
| astree = ast.parse(code) | |
| last_block = astree.body[-1] | |
| if isinstance(last_block, ast.If): | |
| condition = last_block.test | |
| if ast.unparse(condition).strip() == "__name__ == '__main__'": | |
| code = ast.unparse(astree.body[:-1]) + "\n" + ast.unparse(last_block.body) | |
| except Exception: | |
| pass | |
| return code | |
| def make_function(code: str) -> str: | |
| try: | |
| import_stmts = [] | |
| all_other_stmts = [] | |
| astree = ast.parse(code) | |
| for stmt in astree.body: | |
| if isinstance(stmt, (ast.Import, ast.ImportFrom)): | |
| import_stmts.append(stmt) | |
| else: | |
| all_other_stmts.append(stmt) | |
| function_ast = ast.FunctionDef( | |
| name="wrapped_function", | |
| args=ast.arguments(posonlyargs=[], args=[], kwonlyargs=[], kw_defaults=[], defaults=[]), | |
| body=all_other_stmts, decorator_list=[], lineno=-1) | |
| return import_string + "\n" + ast.unparse(import_stmts) + "\n" + ast.unparse(function_ast) | |
| except Exception: | |
| return code | |
| def get_stripped_lines(val: str): | |
| val = val.strip() | |
| return [val_line.strip() for val_line in val.split("\n")] | |
| def convert_line_to_decimals(line: str): | |
| try: | |
| return True, [Decimal(elem) for elem in line.split()] | |
| except Exception: | |
| return False, [] | |
| def same_stdio(prediction, gt_out): | |
| p, g = get_stripped_lines(prediction), get_stripped_lines(gt_out) | |
| if len(p) != len(g): | |
| return False | |
| for a, b in zip(p, g): | |
| if a == b: | |
| continue | |
| ok1, da = convert_line_to_decimals(a) | |
| ok2, db = convert_line_to_decimals(b) | |
| if not (ok1 and ok2 and da == db): | |
| return False | |
| return True | |
| def reliability_guard(): | |
| faulthandler.disable() | |
| import builtins | |
| builtins.quit = None | |
| os.environ["OMP_NUM_THREADS"] = "1" | |
| for name in ("kill", "system", "putenv", "remove", "removedirs", "rmdir", "fchdir", "setuid", "fork", "forkpty", | |
| "killpg", "rename", "renames", "truncate", "replace", "unlink", "fchmod", "fchown", "chmod", "chown", | |
| "chroot", "lchflags", "lchmod", "lchown", "getcwd", "chdir"): | |
| setattr(os, name, None) | |
| import shutil | |
| shutil.rmtree = shutil.move = shutil.chown = None | |
| import subprocess | |
| subprocess.Popen = None | |
| builtins.help = None | |
| for m in ("ipdb", "joblib", "resource", "psutil", "tkinter"): | |
| sys.modules[m] = None | |
| def main(): | |
| p = json.load(open(sys.argv[1], encoding="utf-8")) | |
| res_fd = os.dup(1) # results go here; the program's own stray writes to the real stdout go to devnull | |
| null = os.open(os.devnull, os.O_WRONLY) | |
| os.dup2(null, 1) | |
| _exit, _write = os._exit, os.write | |
| def report(d): | |
| _write(res_fd, (json.dumps(d) + "\n").encode()) | |
| def watchdog(k): | |
| report({"k": k, "res": "tle"}) | |
| _exit(0) | |
| reliability_guard() | |
| timeout, mode = p["timeout"], p["mode"] | |
| code = import_string + "\n\n" + p["code"] if mode == "functional" else make_function(clean_if_name(p["code"])) | |
| t = threading.Timer(timeout, watchdog, args=(0,)) | |
| t.start() | |
| try: | |
| tmp_sol = ModuleType("tmp_sol", "") | |
| exec(code, tmp_sol.__dict__) | |
| compiled = tmp_sol.Solution() if "class Solution" in code else tmp_sol | |
| except BaseException as e: | |
| t.cancel() | |
| report({"k": 0, "res": "error", "err": "compile: " + repr(e)[:300]}) | |
| return | |
| t.cancel() | |
| method = getattr(compiled, p["fn"] if mode == "functional" else "wrapped_function", None) | |
| if method is None: | |
| report({"k": 0, "res": "error", "err": "function not found"}) | |
| return | |
| tests = p["tests"] | |
| if mode == "functional": | |
| try: | |
| args_all = [[json.loads(line) for line in inp.split("\n")] for inp, _ in tests] | |
| outs_all = [json.loads(out) for _, out in tests] | |
| except Exception as e: | |
| report({"k": 0, "res": "error", "err": "decode: " + repr(e)[:200]}) | |
| return | |
| for k, (inp, exp) in enumerate(tests): | |
| t = threading.Timer(timeout, watchdog, args=(k,)) | |
| t.start() | |
| if mode == "functional": | |
| try: | |
| pred = method(*args_all[k]) | |
| except BaseException as e: | |
| t.cancel() | |
| report({"k": k, "res": "error", "err": repr(e)[:300]}) | |
| return | |
| t.cancel() | |
| if isinstance(pred, tuple): | |
| pred = list(pred) | |
| if not pred == outs_all[k]: | |
| report({"k": k, "res": "wrong", "got": repr(pred)[:300]}) | |
| return | |
| else: | |
| err = None | |
| with Capturing() as captured: | |
| try: | |
| call_method(method, inp) | |
| except BaseException as e: | |
| err = repr(e)[:300] | |
| t.cancel() | |
| if err is not None: | |
| report({"k": k, "res": "error", "err": err}) | |
| return | |
| if not same_stdio(captured[0], exp): | |
| report({"k": k, "res": "wrong", "got": captured[0][:300]}) | |
| return | |
| report({"k": k, "res": "ok"}) | |
| main() | |