Text Generation
Transformers
Safetensors
English
lfm2_moe
lfm
liquid-ai
Mixture of Experts
agentic
tool-use
terminal
reasoning
fable-5
withinus
helio
distillation
sft
conversational
Instructions to use LLM-OS-Models/Fabliq-8B-Agent-Reasoning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LLM-OS-Models/Fabliq-8B-Agent-Reasoning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LLM-OS-Models/Fabliq-8B-Agent-Reasoning", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LLM-OS-Models/Fabliq-8B-Agent-Reasoning") model = AutoModelForCausalLM.from_pretrained("LLM-OS-Models/Fabliq-8B-Agent-Reasoning", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LLM-OS-Models/Fabliq-8B-Agent-Reasoning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LLM-OS-Models/Fabliq-8B-Agent-Reasoning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM-OS-Models/Fabliq-8B-Agent-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LLM-OS-Models/Fabliq-8B-Agent-Reasoning
- SGLang
How to use LLM-OS-Models/Fabliq-8B-Agent-Reasoning with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "LLM-OS-Models/Fabliq-8B-Agent-Reasoning" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM-OS-Models/Fabliq-8B-Agent-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "LLM-OS-Models/Fabliq-8B-Agent-Reasoning" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM-OS-Models/Fabliq-8B-Agent-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LLM-OS-Models/Fabliq-8B-Agent-Reasoning with Docker Model Runner:
docker model run hf.co/LLM-OS-Models/Fabliq-8B-Agent-Reasoning
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model:
|
| 5 |
+
- LLM-OS-Models/Fabliq-8B-Agent
|
| 6 |
+
- LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch
|
| 7 |
+
- LiquidAI/LFM2.5-8B-A1B
|
| 8 |
+
base_model_relation: finetune
|
| 9 |
+
tags:
|
| 10 |
+
- lfm
|
| 11 |
+
- liquid-ai
|
| 12 |
+
- moe
|
| 13 |
+
- agentic
|
| 14 |
+
- tool-use
|
| 15 |
+
- terminal
|
| 16 |
+
- reasoning
|
| 17 |
+
- fable-5
|
| 18 |
+
- withinus
|
| 19 |
+
- helio
|
| 20 |
+
- distillation
|
| 21 |
+
- sft
|
| 22 |
+
language:
|
| 23 |
+
- en
|
| 24 |
+
pipeline_tag: text-generation
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# Fabliq-8B-Agent-Reasoning ππ§
|
| 28 |
+
|
| 29 |
+
> The **reasoning-expanded sibling** of [Fabliq-8B-Agent](https://huggingface.co/LLM-OS-Models/Fabliq-8B-Agent). Adds general + deep reasoning on top of the agentic foundation β broadens the model beyond pure terminal tool-use into multi-domain expert Q&A, mathematical reasoning, scientific analysis, and cybersecurity. Two-phase curriculum inspired by [Qwythos-9B](https://huggingface.co/empero-ai/Qwythos-9B-Claude-Mythos-5-1M).
|
| 30 |
+
|
| 31 |
+
## β¨ Why Fabliq-Reasoning?
|
| 32 |
+
|
| 33 |
+
- **π Same tiny footprint, broader reach.** Inherits LFM2.5-8B-A1B's MoE efficiency (~1B active params). Now also handles expert Q&A, math, science β not just terminal work.
|
| 34 |
+
- **π Still agentic.** Phase-1 tool-use capability is preserved β the model still reasons in `<think>` and emits native LFM tool calls when needed.
|
| 35 |
+
- **π§ Multi-domain reasoning.** Trained on WithinUs (6 categories: advanced coding, agentic planning, general QA, math reasoning, scientific analysis, cybersecurity) + Helio (Opus 4.8 deep-reasoning distillation).
|
| 36 |
+
- **π― 2-phase curriculum.** Phase-1 broad agentic distillation β Phase-2 focused reasoning expansion (Qwythos pattern).
|
| 37 |
+
|
| 38 |
+
## π§ͺ Model details
|
| 39 |
+
|
| 40 |
+
| | |
|
| 41 |
+
| --- | --- |
|
| 42 |
+
| **Architecture** | Lfm2MoeForCausalLM (24 layers, 32 experts, 4 experts/token) |
|
| 43 |
+
| **Parameters** | ~8B total / ~1B active (MoE) |
|
| 44 |
+
| **Context** | 8,192 trained Β· 128K native (`rope_theta=5e6`) |
|
| 45 |
+
| **Precision** | bfloat16 |
|
| 46 |
+
| **Fine-tune type** | Full-parameter SFT, continuation from Fabliq-8B-Agent |
|
| 47 |
+
| **License** | Apache 2.0 |
|
| 48 |
+
|
| 49 |
+
## π Training data (Phase-2 only)
|
| 50 |
+
|
| 51 |
+
| Source | Rows | Description |
|
| 52 |
+
| --- | --- | --- |
|
| 53 |
+
| WithinUs (from `claude_mythos_distilled_25k`) | 135 | 6-category expert Q&A β coding, planning, math, science, cybersecurity. SHA-256 dedup (25k β 135 unique). |
|
| 54 |
+
| Helio (`Fable-5-Distill-Reasoning-462x`) | 146 | Opus 4.8 deep-reasoning traces. Russian-language filter (Cyrillic <30%). |
|
| 55 |
+
| **Total Phase-2** | **281** | |
|
| 56 |
+
|
| 57 |
+
Preprocessing:
|
| 58 |
+
- **WithinUs:** Category-balanced (max 350/cat), SHA-256 dedup, "Drawing from the autonomous..." template first-sentence removal β [`build_withinus_lfm_sft.py`](https://github.com/LLM-OS-Models/Terminal/blob/main/fable_distillation/build_withinus_lfm_sft.py)
|
| 59 |
+
- **Helio:** Cyrillic ratio filter (<30%), `<think>` wrapping for reasoning, line 192 corruption skip β [`build_helio_lfm_sft.py`](https://github.com/LLM-OS-Models/Terminal/blob/main/fable_distillation/build_helio_lfm_sft.py)
|
| 60 |
+
- Combined: [`build_phase2_reasoning`](https://github.com/LLM-OS-Models/Terminal/blob/main/fable_distillation/datasets/) (concat)
|
| 61 |
+
|
| 62 |
+
## π§ Training procedure (Phase-2)
|
| 63 |
+
|
| 64 |
+
| Hyperparameter | Value |
|
| 65 |
+
| --- | --- |
|
| 66 |
+
| Base | `LLM-OS-Models/Fabliq-8B-Agent` (Phase-1 final) |
|
| 67 |
+
| Schedule | 4 epochs, constant LR |
|
| 68 |
+
| Max sequence length | 8,192 |
|
| 69 |
+
| Per-device batch size | 2 |
|
| 70 |
+
| Gradient accumulation | 4 |
|
| 71 |
+
| GPUs | 8Γ H200 (effective batch 64) |
|
| 72 |
+
| Learning rate | 3e-7 (lower than Phase-1 β model already agentic-tuned, avoid forgetting) |
|
| 73 |
+
| Precision | bf16 |
|
| 74 |
+
| FSDP | `full_shard`, activation checkpointing, `Lfm2MoeDecoderLayer` auto-wrap |
|
| 75 |
+
| Final train_loss | ~1.6 |
|
| 76 |
+
| Train runtime | ~6 minutes (281 rows Γ 4 epochs) |
|
| 77 |
+
| Global steps | 20 |
|
| 78 |
+
|
| 79 |
+
## π¬ System prompts (per data source)
|
| 80 |
+
|
| 81 |
+
**WithinUs (broad reasoning):**
|
| 82 |
+
```
|
| 83 |
+
You are a knowledgeable assistant. Provide rigorous, well-structured answers
|
| 84 |
+
across coding, cybersecurity, mathematics, scientific analysis, agentic planning,
|
| 85 |
+
and general expert topics. Be precise and thorough.
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
**Helio (deep reasoning):**
|
| 89 |
+
```
|
| 90 |
+
You are a deep-reasoning assistant. Think step by step inside <think>...</think>,
|
| 91 |
+
then provide a clear, structured answer.
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
## π How to use
|
| 95 |
+
|
| 96 |
+
```python
|
| 97 |
+
import torch
|
| 98 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 99 |
+
|
| 100 |
+
model_id = "LLM-OS-Models/Fabliq-8B-Agent-Reasoning"
|
| 101 |
+
tok = AutoTokenizer.from_pretrained(model_id)
|
| 102 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 103 |
+
model_id, dtype=torch.bfloat16, device_map="auto"
|
| 104 |
+
)
|
| 105 |
+
|
| 106 |
+
SYSTEM = (
|
| 107 |
+
"You are a deep-reasoning assistant. Think step by step inside <think>...</think>, "
|
| 108 |
+
"then provide a clear, structured answer."
|
| 109 |
+
)
|
| 110 |
+
|
| 111 |
+
messages = [
|
| 112 |
+
{"role": "system", "content": SYSTEM},
|
| 113 |
+
{"role": "user", "content": "Derive the time complexity of merge sort and explain when it beats quicksort."},
|
| 114 |
+
]
|
| 115 |
+
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 116 |
+
inputs = tok(text, return_tensors="pt").to(model.device)
|
| 117 |
+
|
| 118 |
+
out = model.generate(
|
| 119 |
+
**inputs,
|
| 120 |
+
max_new_tokens=2048,
|
| 121 |
+
do_sample=False,
|
| 122 |
+
repetition_penalty=1.05,
|
| 123 |
+
)
|
| 124 |
+
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
+
## π― When to use which Fabliq?
|
| 128 |
+
|
| 129 |
+
| Use case | Model |
|
| 130 |
+
| --- | --- |
|
| 131 |
+
| Pure terminal / coding agent (read, edit, run, verify) | [Fabliq-8B-Agent](https://huggingface.co/LLM-OS-Models/Fabliq-8B-Agent) |
|
| 132 |
+
| Multi-domain expert Q&A + reasoning + still agentic | **Fabliq-8B-Agent-Reasoning** (this model) |
|
| 133 |
+
| Local 16GB VRAM deployment with tool-use | Either β both fit comfortably |
|
| 134 |
+
|
| 135 |
+
## β οΈ Limitations
|
| 136 |
+
|
| 137 |
+
- **Phase-2 dataset is small (281 rows).** Reasoning expansion is real but bounded β this is a delta on top of Phase-1, not a from-scratch reasoning model.
|
| 138 |
+
- **WithinUs dedup surprise.** Source dataset claims 25k rows but after SHA-256 dedup of templated prompts, only 135 unique rows remain. Template overfitting in the source data was severe.
|
| 139 |
+
- **Helio Russian filter.** Original 462 rows filtered to 146 rows after removing Cyrillic-dominant (Russian) traces. Non-English coverage is limited.
|
| 140 |
+
- **No safety alignment.** Trained on raw reasoning traces; add your own guardrails for production.
|
| 141 |
+
- **Max seq 8,192 at training.** Behavior beyond 8K context is unverified.
|
| 142 |
+
- **English-centric.**
|
| 143 |
+
|
| 144 |
+
## π License
|
| 145 |
+
|
| 146 |
+
Apache 2.0, inherited from the [LiquidAI LFM2.5-8B-A1B](https://huggingface.co/LiquidAI/LFM2.5-8B-A1B) base.
|
| 147 |
+
|
| 148 |
+
## π³ Model tree
|
| 149 |
+
|
| 150 |
+
This is a **fine-tune** (continuation SFT). Direct parent: [`LLM-OS-Models/Fabliq-8B-Agent`](https://huggingface.co/LLM-OS-Models/Fabliq-8B-Agent).
|
| 151 |
+
|
| 152 |
+
```
|
| 153 |
+
LiquidAI/LFM2.5-8B-A1B (LiquidAI base)
|
| 154 |
+
ββ LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch (ToolBench foundation)
|
| 155 |
+
ββ LLM-OS-Models/Fabliq-8B-Agent (Phase-1: Fable-5 agentic SFT)
|
| 156 |
+
ββ LLM-OS-Models/Fabliq-8B-Agent-Reasoning β this model (Phase-2: + WithinUs + Helio)
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
## π Acknowledgements
|
| 160 |
+
|
| 161 |
+
- **Base:** [LiquidAI/LFM2.5-8B-A1B](https://huggingface.co/LiquidAI/LFM2.5-8B-A1B)
|
| 162 |
+
- **Phase-1 parent:** [Fabliq-8B-Agent](https://huggingface.co/LLM-OS-Models/Fabliq-8B-Agent)
|
| 163 |
+
- **Phase-2 data:** WithinUs (claude_mythos_distilled_25k), Helio (Fable-5-Distill-Reasoning-462x)
|
| 164 |
+
- **Reference:** [empero-ai/Qwythos-9B-Claude-Mythos-5-1M](https://huggingface.co/empero-ai/Qwythos-9B-Claude-Mythos-5-1M) β 2-phase curriculum pattern
|