Metadata for building a local tool-using agent with LFM2.5 2.6B using Transformers or llama.cpp across Windows, Linux, and macOS.
EstimatedSource checked 9/28/2026
LOCALRENTED GPU
Freshness 74 out of 100. Repository age: 79 days old, Jul 28, 2026. Measures age, not quality.74/ 100Freshness79 days oldRepository age · Jul 28, 2026
Popularity 70 out of 100. 114,916 downloads in 30 days; 831 lifetime likes. Checked Oct 15, 2026. Measures adoption, not quality.70/ 100Popularity114.9K downloads / 30d831 lifetime likes · Checked Oct 15, 2026
What do these scores mean?+
Two ways to compare models. Neither score measures answer quality, benchmark performance, or whether a model fits your machine.
Freshness · release age
A new release starts at 100. The score halves every 180 days: 100 × 2^(−age in days / 180). When the release date is unavailable, a repository date is a fallback—not proof of when the model was released. Missing dates stay unscored.
Downloads over the past 30 days carry 80% of the score; lifetime likes carry 20%. Both use a logarithmic scale, capped at 10 million downloads and 100,000 likes. If likes are unavailable, downloads carry all the weight. Missing download statistics stay unscored.
Start 8192 tokens; publisher limit 131k; Metal fits 16GB unified with headroom.
Start 8192 tokens; publisher limit 131k; Metal fits 16GB unified with headroom.
CPU (16 GB system RAM)
Start 4096 tokens; publisher limit 131k; CPU RAM fits 16GB with headroom.
Start 4096 tokens; publisher limit 131k; CPU RAM fits 16GB with headroom.
Start 4096 tokens; publisher limit 131k; CPU RAM fits 16GB with headroom.
Metadata onlySOURCE-LINKED SETUP
Set up LFM2.5 2.6B for local agentic tool calling
Use the publisher's native Transformers weights, the publisher's GGUF quantizations, or a community uncensored GGUF variant with llama.cpp. Verify a complete tool-call round-trip.
Choose a package Run its commands Check the result
01
BEFORE YOU BEGIN
Choose your package
Select the weights you want. The instructions, downloads and settings change with your choice.
The publisher has not provided a complete memory target for this task. Check its hardware guidance before starting.
CURRENT SETUP
LFM2.5-2.6B · official
Estimate: 8+ GB RAM/VRAM for inference. Uses bfloat16; ensure hardware supports it.
Freshness 74 out of 100. Repository age: 79 days old, Jul 28, 2026. Measures age, not quality.74/ 100Freshness79 days oldRepository age · Jul 28, 2026
Popularity 70 out of 100. 114,916 downloads in 30 days; 831 lifetime likes. Checked Oct 15, 2026. Measures adoption, not quality.70/ 100Popularity114.9K downloads / 30d831 lifetime likes · Checked Oct 15, 2026
What do these scores mean?+
Two ways to compare models. Neither score measures answer quality, benchmark performance, or whether a model fits your machine.
Freshness · release age
A new release starts at 100. The score halves every 180 days: 100 × 2^(−age in days / 180). When the release date is unavailable, a repository date is a fallback—not proof of when the model was released. Missing dates stay unscored.
Downloads over the past 30 days carry 80% of the score; lifetime likes carry 20%. Both use a logarithmic scale, capped at 10 million downloads and 100,000 likes. If likes are unavailable, downloads carry all the weight. Missing download statistics stay unscored.
Choose where you want to run it. The instructions below update to match your selection.
CHOOSE YOUR SETUPMac
Python 3.10+, PyTorch 2.5+. Install transformers[torch]. Use MPS or CPU.
01
Prerequisites and working folder
Open Terminal. This route targets the publisher's native Transformers checkpoint LiquidAI/LFM2.5-2.6B at revision 654f9463ce32b05d0429d76fe1f580b27d4c1ac0: two bfloat16 safetensors shards (~5.4 GB total) plus tokenizer, config, generation config and chat template. It does not use GGUF files. Confirm Python 3.10 or newer and create a dedicated working folder so all downloads, virtual environments and scripts stay in one place. The published model maximum is 131072 tokens (config.json max_position_embeddings), but the active runtime context you actually feed the model on a 16 GB Apple Silicon machine starts far lower; this guide starts at 4096 tokens active context and lowers it further under memory pressure.
python3 --version
mkdir -p "$HOME/YouRunAI-LFM2.5-2.6B-Agent"
cd "$HOME/YouRunAI-LFM2.5-2.6B-Agent"
02
Create a virtual environment and install the runtime
Install Transformers with PyTorch inside an isolated virtual environment. Python must be 3.10 or newer and PyTorch 2.5 or newer. On macOS the supported backends for this checkpoint are MPS and CPU, so there is no CUDA or ROCm dependency here. The final command prints both installed versions so you can confirm the environment before downloading weights.
Download the native safetensors checkpoint for LiquidAI/LFM2.5-2.6B pinned to the evidenced revision so weights, tokenizer and chat template all match. The download places the two sharded weight files, the safetensors index, config.json, tokenizer.json, tokenizer_config.json, generation_config.json and chat_template.jinja into the local model folder. Loading the model later resolves from this folder instead of the remote cache. Keep several GB of free disk space beyond the ~5.4 GB of weight files for cache and runtime overhead.
Put these files in ~/YouRunAI-LFM2.5-2.6B-Agent/5 required files
Write and run a small script that loads the local checkpoint with device_map="auto" (MPS when available, otherwise CPU), applies the publisher chat template, and generates with the publisher's documented sampling values: temperature 0.1, top_k 50, repetition_penalty 1.1. The chat template is applied with add_generation_prompt=True and tokenize=True, and the resulting input_ids are moved to the model device. The observable result is a streamed, non-empty answer to the prompt "What is C. elegans?". If macOS reports memory pressure, lower max_new_tokens or move to the CPU-only path by replacing device_map="auto" with device_map="cpu".
Reusable conversation loop with a known-answer check
Start an interactive loop in the same terminal so you can send several prompts to the local model in one session. The loop truncates each templated prompt to the last 4096 tokens, which is the recommended starting active context for this checkpoint on a 16 GB Apple Silicon Mac; the advertised model maximum is still 131072 tokens. Lower active_context_tokens if memory is tight, or raise it only as far as the machine actually sustains. Start the loop, ask a known-answer question such as "What is the capital of France?" and confirm the answer contains Paris, then ask a second question in the same session. Type quit to exit.
cat > chat_loop.py <<'PY'
import os
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
model_id = os.path.expanduser("~/YouRunAI-LFM2.5-2.6B-Agent/model")
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
dtype="bfloat16",
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
active_context_tokens = 4096
print("Type a prompt, or type quit to exit.")
while True:
user_text = input("You: ")
if user_text.strip().lower() == "quit":
break
input_ids = tokenizer.apply_chat_template(
[{"role": "user", "content": user_text}],
add_generation_prompt=True,
return_tensors="pt",
tokenize=True,
)["input_ids"][:, -active_context_tokens:].to(model.device)
model.generate(
input_ids,
do_sample=True,
temperature=0.1,
top_k=50,
repetition_penalty=1.1,
max_new_tokens=256,
streamer=streamer,
)
print()
PY
python chat_loop.py
06
Run a complete tool-call round-trip
This is the actual agent task. The publisher documents function calling in four steps: the system message carries the tool list, the assistant emits a tool call wrapped in <|tool_call_start|> and <|tool_call_end|>, the tool result is returned as a tool message, and the assistant then writes a final answer that uses that result. The script below defines one bounded local tool (a fixed weather lookup that performs no network access), asks a question that requires it, and feeds the tool output back into the model. The generate() helper returns the decoded assistant text and uses inputs.shape[-1] captured inside its own scope, so the prompt length is never referenced from outside the function. Inputs are truncated to a 4096-token active context on MPS/CPU. The model stays loaded in this process while the two generations run.
cat > tool_roundtrip.py <<'PY'
import json
import os
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
model_id = os.path.expanduser("~/YouRunAI-LFM2.5-2.6B-Agent/model")
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
dtype="bfloat16",
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
def local_weather(city):
return json.dumps({"city": city, "condition": "sunny", "temperature_c": 19})
tools = [{
"name": "local_weather",
"description": "Returns a fixed local weather result for a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
}]
messages = [
{"role": "system", "content": "List of tools: " + json.dumps(tools)},
{"role": "user", "content": "What is the weather in Paris?"},
]
def generate(messages):
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
tokenize=True,
)["input_ids"][:, -4096:].to(model.device)
output = model.generate(
inputs,
do_sample=True,
temperature=0.1,
top_k=50,
repetition_penalty=1.1,
max_new_tokens=256,
streamer=streamer,
)
prompt_len = inputs.shape[-1]
return tokenizer.decode(output[0][prompt_len:], skip_special_tokens=True)
first_text = generate(messages)
print("\nFirst assistant text:", first_text)
if "local_weather" in first_text:
messages.append({"role": "assistant", "content": first_text})
messages.append({"role": "tool", "content": local_weather("Paris")})
final_text = generate(messages)
print("\nFinal assistant text:", final_text)
else:
print("The model did not emit a local_weather tool call; inspect the first assistant text.")
PY
python tool_roundtrip.py
07
Inspect the result and confirm the loaded revision
Read both printed blocks from the previous run. The first assistant text should contain a tool call in the publisher format, for example <|tool_call_start|>[local_weather(city='Paris')]<|tool_call_end|> followed by a short natural-language lead-in. After the tool result is appended as a tool message, the final assistant text should answer with the returned values (sunny, 19 degrees C) instead of inventing weather data. Then confirm the local files match the pinned revision: config.json should report model_type lfm2, max_position_embeddings 131072 and dtype bfloat16, and the model folder should hold both safetensors shards. If the tool call never appears, check that the system message content is exactly "List of tools: " followed by the JSON array and that the download used revision 654f9463ce32b05d0429d76fe1f580b27d4c1ac0.
The model must load and generate text via the chosen runtime. A complete tool call round-trip must succeed: user query, model emits a tool call, tool returns a result, model produces a final answer using that result. The output should follow the publisher's tool use format.
https://huggingface.co/LiquidAI/LFM2.5-2.6BOpens on your machine
This metadata outlines the setup. Detailed hardware tables, context matrices, and executable instructions are covered in later stages.
Model fails to load due to dtype or architecture not supported by installed Transformers version.
Update Transformers to a version that supports Lfm2ForCausalLM (transformers_version 5.2.0 in config). Install via `pip install transformers[torch] --upgrade` and ensure PyTorch 2.5+ is present.
Tool calls are not parsed or emitted correctly during agent interaction.
Ensure the chat template from the model repository (chat_template.jinja) is applied via `apply_chat_template`. The template defines special tokens for tool call start/end. Confirm your client or framework uses this exact template.
REFERENCE LIBRARY
Sources and files
Original instructions, model files, and compatibility notes behind this setup.