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:9931/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:9931/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:9931/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"
File size: 8,857 Bytes
67ebcef | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | """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)
@patch("builtins.open", mock_open(read_data=inputs))
@patch("sys.stdin", mock_stdin)
@patch("sys.stdin.readline", lambda *args: next(inputs_line_iterator))
@patch("sys.stdin.readlines", lambda *args: inputs.split("\n"))
@patch("sys.stdin.read", lambda *args: 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()
|