Team Ai
Modelpublic

LLM-OS-Models/Fabliq-8B-Agent

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
8likes21downloads
Model Card

Fabliq-8B-Agent 🌊

FabΒ·liq = Fable + Liquid. A compact, fast agentic terminal coding model fine-tuned from `LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch` on real Claude Code sessions from the Fable-5-traces dataset. The base LiquidAI LFM2.5-8B-A1B is an 8B MoE (~1B active), so Fabliq inherits the speed and low VRAM of MoE inference plus the agentic distillation.

Fabliq thinks before it acts: it reads the conversation, reasons inside <think>...</think>, then either calls a tool with LFM's native tool-call format or replies with text. Trained on 4,047 real multi-turn terminal trajectories (Bash, Edit, Read, Write, Glob, Grep, WebSearch) β€” the kind of read β†’ reason β†’ act β†’ verify loop a real coding agent runs.

✨ Why Fabliq?

  • β€”πŸ  Tiny footprint, agent-class behavior. LFM2.5-8B-A1B is a Mixture-of-Experts model β€” only ~1B parameters activate per token. That means fast inference, low VRAM, and the agentic distillation still takes.
  • β€”πŸ›  Native tool calling. No wrapper needed β€” Fabliq emits <|tool_call_start|>[ToolName(arg=value)]<|tool_call_end|> per LFM's official format. Plug it into a harness that parses and executes those calls and you have a working terminal agent.
  • β€”πŸ§  Reasoning-first. Every assistant turn opens with a <think> block β€” the chain-of-thought from the original Claude traces, preserved verbatim. The model self-explains before each action.
  • β€”πŸ”— Clean lineage. This is a direct fine-tune of [`LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch`](https://huggingface.co/LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch), which is itself a fine-tune of `LiquidAI/LFM2.5-8B-A1B`. Fabliq adds 3 epochs of Fable-5 agentic distillation on top of the ToolBench foundation.

Sibling models:

  • β€”[Fabliq-8B-Agent-Reasoning](https://huggingface.co/LLM-OS-Models/Fabliq-8B-Agent-Reasoning) β€” adds general/deep reasoning (WithinUs + Helio) on top of this base.

πŸ§ͺ Model details

ArchitectureLfm2MoeForCausalLM (24 layers, 32 experts, 4 experts/token)
Parameters~8B total / ~1B active (MoE)
Context8,192 trained Β· 128K native (rope_theta=5e6)
Precisionbfloat16
Fine-tune typeFull-parameter SFT (FSDP full_shard + activation checkpointing)
LicenseApache 2.0

πŸ“š Training data

SourceRowsDescription
Glint-Research/Fable-5-traces4,047Real Claude Code terminal sessions β€” multi-turn tool-use trajectories

Preprocessing pipeline (`build_fable5_to_lfm_sft.py`):

  1. 1.Parse context β†’ multi-turn USER / ASSISTANT (message) messages
  2. 2.Strip slash-command metadata blocks (<local-command-caveat>, <command-*>)
  3. 3.Convert {tool, input} structured output β†’ LFM native tool-call syntax <|tool_call_start|>[ToolName(arg='value')]<|tool_call_end|>
  4. 4.Wrap chain-of-thought in <think>...</think> for assistant reasoning training
  5. 5.Drop 618 rows with <3 messages after parsing
  6. 6.Max sequence length 8,192 tokens (98.6% coverage without truncation)

Full lineage, data composition, and per-dataset metadata: see the Fable Distillation docs.

πŸ”§ Training procedure

HyperparameterValue
Schedule3 epochs, constant LR
Max sequence length8,192
Per-device batch size2
Gradient accumulation4
GPUs8Γ— H200 (effective batch 64)
Learning rate5e-7 (AdamW)
Precisionbf16
FSDPfull_shard, activation checkpointing, Lfm2MoeDecoderLayer auto-wrap
LossNLL, chat-template masked (assistant-only effective)
Final train_loss1.277
Train runtime831 seconds (~14 min)
Global steps192

πŸ’¬ System prompt

You are an agentic coding assistant. Read the conversation history and tool results,
think step by step inside <think>...</think>, then either call a tool using
<|tool_call_start|>[ToolName(arg=value)]<|tool_call_end|> or respond with text.
Use available tools (Bash, Edit, Read, Write, Glob, Grep, WebSearch, WebFetch, etc.)
to accomplish the user's task. Be concise but thorough.

πŸš€ How to use

transformers

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "LLM-OS-Models/Fabliq-8B-Agent"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, dtype=torch.bfloat16, device_map="auto"
)

SYSTEM = (
    "You are an agentic coding assistant. Read the conversation history and tool results, "
    "think step by step inside <think>...</think>, then either call a tool using "
    "<|tool_call_start|>[ToolName(arg=value)]<|tool_call_end|> or respond with text. "
    "Use available tools (Bash, Edit, Read, Write, Glob, Grep, WebSearch, WebFetch, etc.) "
    "to accomplish the user's task. Be concise but thorough."
)

messages = [
    {"role": "system", "content": SYSTEM},
    {"role": "user", "content": "List the Python files in /tmp and report the line count of the largest one."},
]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(text, return_tensors="pt").to(model.device)

out = model.generate(
    **inputs,
    max_new_tokens=1024,
    do_sample=False,
    repetition_penalty=1.05,
)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))

Expected output β€” the model reasons, then emits a tool call:

<think>
I need to find Python files in /tmp. I'll use Bash with ls piped into wc -l.
</think>

<|tool_call_start|>[Bash(command='ls -1 /tmp/*.py 2>/dev/null | xargs wc -l 2>/dev/null | sort -n | tail -1')]<|tool_call_end|>

vLLM

bash
vllm serve LLM-OS-Models/Fabliq-8B-Agent \
  --max-model-len 8192 --dtype bfloat16 --gpu-memory-utilization 0.9

🎯 Intended use

  • β€”Local coding agent on top of an MoE-efficient backbone (~1B active params β€” runs comfortably on a single consumer GPU)
  • β€”Terminal / file-system agentic loops (read, edit, run, verify)
  • β€”Research on distillation from frontier closed models into open-weight MoE backbones

⚠️ Limitations

  • β€”Agentic specialization. Focused fine-tune for terminal/coding work. General-knowledge benchmarks may sit slightly below the LFM2.5-8B-A1B base β€” that's the expected trade-off for a focused agentic distill.
  • β€”No safety alignment. Trained on raw tool-use traces; add your own guardrails for production.
  • β€”Tool-format lock-in. Emits LFM-native tool-call syntax. A harness that parses <|tool_call_start|>...<|tool_call_end|> and actually executes the call is required for the agentic loop to work.
  • β€”Max seq 8,192 at training. Behavior beyond 8K context is unverified for this checkpoint.
  • β€”English-centric.

πŸ“œ License

Apache 2.0, inherited from the LiquidAI LFM2.5-8B-A1B base.

🌳 Model tree

This is a fine-tune (not a merge or adapter). Direct parent: `LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch`.

LiquidAI/LFM2.5-8B-A1B                                          (LiquidAI base)
  └─ LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch  (ToolBench foundation)
      └─ LLM-OS-Models/Fabliq-8B-Agent                           ← this model (Fable-5 agentic SFT, 3 epochs)
          └─ LLM-OS-Models/Fabliq-8B-Agent-Reasoning             ← sibling (+ WithinUs + Helio reasoning)

πŸ™ Acknowledgements