LFM3-1.7B-Claude-Fable5.1
A tool-calling fine-tune of LiquidAI/LFM3-1.7B on the claude_code split of saidutta69/fable-5.1-premium-v2.
It teaches the 1.7B LFM3 hybrid to emit Claude Code tool calls - Bash, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch, TodoWrite, TaskCreate, TaskUpdate, TaskOutput, ToolSearch - with valid tool names and typed arguments. The base model is already agentic; this checkpoint is tuned for schema fidelity inside a Claude-Code-style harness.
Who this is for
- Running a Claude-Code-style tool protocol on a local 1.7B model -
Q4_K_Mis 1.10 GB. - Harnesses where an invalid tool name breaks the loop. The base model invents a tool on ~23% of parsed calls; this checkpoint does not.
- Not a general-purpose LFM3 upgrade. Free-form text modelling shifted; use the base for general writing.
Why this fine-tune
The dataset's fable_code split is unusable for argument fidelity: 203,750 of 203,794 tool calls carry whole-value placeholders such as <file_path> and <bash_command> (44 clean calls total). The claude_code split carries real values (tasks/SEED_SPEC.md, real shell commands), so training used that split.
The schemas in this dataset are reconstructed, not original Claude Code schemas. They are close enough for the protocol, but do not assume byte-identical parity with a live Claude Code install.
Training
| Method | bf16 LoRA, no quantization |
| LoRA | r=32, alpha=64, dropout 0.05 |
| Targets | q/k/v/o_proj, conv in_proj/out_proj, MLP w1/w2/w3 |
| Data | 48,467 segments from 4,132 traces, 4,096-token windows |
| Masking | assistant turn only; tool outputs and user/system tokens are -100 |
| Schedule | 3,030 steps, effective batch 16, LR 1e-4 cosine, 3% warmup |
| Hardware | 1x RTX PRO 6000 Blackwell (102 GB), 6 h 39 m, peak 31 GB |
| Final loss | 0.200 |
Samples are one assistant action each, with the conversation window trimmed to 4,096 tokens. The tool schemas are injected through LFM3's own chat template, with enable_thinking=False.
Performance
Same harness for both models: 100 held-out claude_code test samples, greedy decoding, 2,048-token budget.
| Metric | Base LFM3-1.7B | This model |
|---|---|---|
| Held-out supervised loss | 1.731 | 0.233 |
| Starts a tool call | 97% | 100% |
| Parseable call | 97% | 95% |
| Tool name valid (per sample) | 75% | 95% |
| Tool name valid (of parsed) | 77.3% | 100% |
| Required args present (of parsed) | 96.9% | 100% |
| Argument types correct (of parsed) | 100% | 100% |
| Chat/math sample | 11/11 factual | 11/11 factual |
| Wikitext perplexity | 17.35 | 23.32 |
The 5% parse gap is truncated output at the 2,048-token cap: this model writes fuller Write and Bash bodies, so some calls do not close inside the budget. Every parsed call has a valid name, required arguments, and correct types. Raise the budget or stream the call and the gap closes.
The perplexity rise is real: this is a specialist, not a general upgrade. The chat/math gate is unchanged (11/11 factual, 20/20 answered).
Files
| File | Size | Notes |
|---|---|---|
model.safetensors |
3.46 GB | bf16 reference, use with trust_remote_code=True |
LFM3-1.7B-Claude-Fable5.1-f16.gguf |
3.47 GB | GGUF reference |
LFM3-1.7B-Claude-Fable5.1-Q8_0.gguf |
1.85 GB | near-lossless |
LFM3-1.7B-Claude-Fable5.1-Q6_K.gguf |
1.43 GB | high quality |
LFM3-1.7B-Claude-Fable5.1-Q5_K_M.gguf |
1.26 GB | balanced |
LFM3-1.7B-Claude-Fable5.1-Q4_K_M.gguf |
1.10 GB | default for local use |
All five GGUFs report arch=lfm3, 287 tensors, and context_length=262144, and were load-tested with llama.cpp built from master (LFM3 support is recent - update llama.cpp before using these files).
Quickstart
llama.cpp
llama serve -hf saidutta69/LFM3-1.7B-Claude-Fable5.1:Q4_K_M --jinja \
--chat-template-kwargs '{"enable_thinking":false}'
Transformers
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "saidutta69/LFM3-1.7B-Claude-Fable5.1"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo, dtype=torch.bfloat16, device_map="auto", trust_remote_code=True
)
messages = [{"role": "user", "content": "List the files in tasks/"}]
tools = [{
"type": "function",
"function": {
"name": "Bash",
"description": "Run a shell command.",
"parameters": {
"type": "object",
"properties": {"command": {"type": "string"}},
"required": ["command"],
},
},
}]
prompt = tok.apply_chat_template(
messages, tools=tools, tokenize=False,
add_generation_prompt=True, enable_thinking=False,
)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))
Tool calls render as:
<tool_call>
<function=Bash>
<parameter=command>
ls tasks/
</parameter>
</function>
</tool_call>
FAQ
What is LFM3-1.7B-Claude-Fable5.1?
It is a bf16 LoRA fine-tune of LiquidAI/LFM3-1.7B, merged into the base and trained on the claude_code configuration of saidutta69/fable-5.1-premium-v2. The goal is strict Claude-Code-style tool calling on a 1.7B model, not a new general model.
How does it compare to the base LFM3-1.7B?
On 100 held-out samples, tool-name validity rises from 77.3% to 100% of parsed calls, required arguments from 96.9% to 100%, and held-out loss falls from 1.731 to 0.233. It starts a call on 100% of samples vs 97% for the base. Raw parse is 95% vs 97% because this model writes longer tool bodies that truncate at the 2,048-token evaluation cap. Chat/math accuracy is unchanged at 11/11.
How do I run LFM3-1.7B-Claude-Fable5.1 locally?
Use llama.cpp from master (LFM3 support is recent):
llama serve -hf saidutta69/LFM3-1.7B-Claude-Fable5.1:Q4_K_M --jinja \
--chat-template-kwargs '{"enable_thinking":false}'
Q4_K_M is 1.10 GB. For the reference weights use :F16 or the bf16 safetensors with trust_remote_code=True.
Responsible use
Tool calls execute real commands and write real files. Run this model in a sandbox, review Bash commands before execution, and never expose it to untrusted input without a permission layer.
Limitations, stated plainly:
- Evaluation is in-distribution: 100 held-out samples from the same dataset, greedy decoding, 2,048-token budget. No independent agent benchmark or multi-turn end-to-end task suite was run.
- The tool schemas are reconstructed from the dataset, not copied from Claude Code.
- 4,096-token training window.
- General free-form text modelling regressed (wikitext perplexity 17.35 -> 23.32).
Made with ❤️ by RACER IS OP (saidutta69)
License
LFM Open License v1.0 - license: other, license_name: lfm1.0.
This is not Apache-2.0. The full text is in LICENSE and the terms are Liquid AI's; review them before commercial use. The base model is LiquidAI/LFM3-1.7B, and this derivative keeps its license.
Related
LiquidAI/LFM3-1.7B- the base model this checkpoint derives fromsaidutta69/fable-5.1-premium-v2- the training data (claude_codeconfiguration)