Text Generation
Transformers
Safetensors
English
lfm2_moe
lfm
liquid-ai
Mixture of Experts
agentic
tool-use
terminal
coding-agent
fable-5
distillation
sft
conversational
Instructions to use LLM-OS-Models/Fabliq-8B-Agent 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 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") 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") model = AutoModelForCausalLM.from_pretrained("LLM-OS-Models/Fabliq-8B-Agent") 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 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LLM-OS-Models/Fabliq-8B-Agent
- SGLang
How to use LLM-OS-Models/Fabliq-8B-Agent 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LLM-OS-Models/Fabliq-8B-Agent with Docker Model Runner:
docker model run hf.co/LLM-OS-Models/Fabliq-8B-Agent
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +158 -0
- chat_template.jinja +115 -0
- config.json +63 -0
- generation_config.json +13 -0
- model.safetensors +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +12 -0
- training_args.bin +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: LiquidAI/LFM2.5-8B-A1B
|
| 5 |
+
base_model_relation: finetune
|
| 6 |
+
tags:
|
| 7 |
+
- lfm
|
| 8 |
+
- liquid-ai
|
| 9 |
+
- moe
|
| 10 |
+
- agentic
|
| 11 |
+
- tool-use
|
| 12 |
+
- terminal
|
| 13 |
+
- coding-agent
|
| 14 |
+
- fable-5
|
| 15 |
+
- distillation
|
| 16 |
+
- sft
|
| 17 |
+
language:
|
| 18 |
+
- en
|
| 19 |
+
pipeline_tag: text-generation
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# LFM2.5-8B-A1B-Terminal-Fable5-Agentic-SFT-3Epoch
|
| 23 |
+
|
| 24 |
+
An agentic coding fine-tune of **LiquidAI/LFM2.5-8B-A1B** (8B total / ~1B active MoE) trained on real Claude Code terminal traces distilled from the Fable-5 dataset. This model continues from `LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch` and adds 3 epochs of full-parameter SFT on 4,047 multi-turn agentic trajectories (read → reason → call tool → observe → continue).
|
| 25 |
+
|
| 26 |
+
## Model details
|
| 27 |
+
|
| 28 |
+
- **Base model:** [`LiquidAI/LFM2.5-8B-A1B`](https://huggingface.co/LiquidAI/LFM2.5-8B-A1B) via [`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)
|
| 29 |
+
- **Architecture:** Lfm2MoeForCausalLM (24 layers, 32 experts, 4 experts/token, hybrid conv+full-attention)
|
| 30 |
+
- **Parameters:** ~8B total / ~1B active
|
| 31 |
+
- **Fine-tune type:** Full-parameter SFT (bf16, FSDP full_shard)
|
| 32 |
+
- **Context:** 8,192 tokens trained, 128K native via rope_theta=5e6
|
| 33 |
+
|
| 34 |
+
## Training data
|
| 35 |
+
|
| 36 |
+
| Source | Rows | Description |
|
| 37 |
+
| --- | --- | --- |
|
| 38 |
+
| [Glint-Research/Fable-5-traces](https://huggingface.co/datasets/Glint-Research/Fable-5-traces) | 4,047 | Real Claude Code terminal sessions: Bash, Edit, Read, Write, Glob, Grep, WebSearch tool-use trajectories |
|
| 39 |
+
|
| 40 |
+
Preprocessing:
|
| 41 |
+
- Parsed `context` → multi-turn `USER`/`ASSISTANT (message)` messages
|
| 42 |
+
- Removed `<local-command-caveat>` / `<command-*>` slash-command metadata blocks
|
| 43 |
+
- Converted `{tool, input}` structured output → LFM native tool-call format `<|tool_call_start|>[ToolName(arg='value')]<|tool_call_end|>`
|
| 44 |
+
- Wrapped chain-of-thought in `<think>...</think>` tags for assistant reasoning training
|
| 45 |
+
- Dropped 618 rows with insufficient context (<3 messages after parsing)
|
| 46 |
+
- Max sequence length: 8,192 tokens (covers 98.6% of traces without truncation)
|
| 47 |
+
|
| 48 |
+
## Training procedure
|
| 49 |
+
|
| 50 |
+
| Hyperparameter | Value |
|
| 51 |
+
| --- | --- |
|
| 52 |
+
| Schedule | 3 epochs, constant LR (continuation SFT) |
|
| 53 |
+
| Max sequence length | 8,192 |
|
| 54 |
+
| Per-device batch size | 2 |
|
| 55 |
+
| Gradient accumulation | 4 |
|
| 56 |
+
| GPUs | 8× H200 (effective batch 64) |
|
| 57 |
+
| Learning rate | 5e-7 (adamw_torch) |
|
| 58 |
+
| Precision | bf16 |
|
| 59 |
+
| FSDP | full_shard, activation_checkpointing, Lfm2MoeDecoderLayer auto_wrap |
|
| 60 |
+
| Loss | NLL, assistant-only (chat-template masked) |
|
| 61 |
+
| Final train_loss | 1.277 |
|
| 62 |
+
| Train runtime | 831 seconds (~14 min) |
|
| 63 |
+
| Global steps | 192 |
|
| 64 |
+
|
| 65 |
+
## System prompt
|
| 66 |
+
|
| 67 |
+
The model was trained with this system prompt:
|
| 68 |
+
|
| 69 |
+
```
|
| 70 |
+
You are an agentic coding assistant. Read the conversation history and tool results,
|
| 71 |
+
think step by step inside <think>...</think>, then either call a tool using
|
| 72 |
+
<|tool_call_start|>[ToolName(arg=value)]<|tool_call_end|> or respond with text.
|
| 73 |
+
Use available tools (Bash, Edit, Read, Write, Glob, Grep, WebSearch, WebFetch, etc.)
|
| 74 |
+
to accomplish the user's task. Be concise but thorough.
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
## How to use
|
| 78 |
+
|
| 79 |
+
### transformers
|
| 80 |
+
|
| 81 |
+
```python
|
| 82 |
+
import torch
|
| 83 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 84 |
+
|
| 85 |
+
model_id = "LLM-OS-Models/LFM2.5-8B-A1B-Terminal-Fable5-Agentic-SFT-3Epoch"
|
| 86 |
+
tok = AutoTokenizer.from_pretrained(model_id)
|
| 87 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 88 |
+
model_id, dtype=torch.bfloat16, device_map="auto"
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
SYSTEM = (
|
| 92 |
+
"You are an agentic coding assistant. Read the conversation history and tool results, "
|
| 93 |
+
"think step by step inside <think>...</think>, then either call a tool using "
|
| 94 |
+
"<|tool_call_start|>[ToolName(arg=value)]<|tool_call_end|> or respond with text. "
|
| 95 |
+
"Use available tools (Bash, Edit, Read, Write, Glob, Grep, WebSearch, WebFetch, etc.) "
|
| 96 |
+
"to accomplish the user's task. Be concise but thorough."
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
messages = [
|
| 100 |
+
{"role": "system", "content": SYSTEM},
|
| 101 |
+
{"role": "user", "content": "List the Python files in /tmp and report the line count of the largest one."},
|
| 102 |
+
]
|
| 103 |
+
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 104 |
+
inputs = tok(text, return_tensors="pt").to(model.device)
|
| 105 |
+
|
| 106 |
+
out = model.generate(
|
| 107 |
+
**inputs,
|
| 108 |
+
max_new_tokens=1024,
|
| 109 |
+
do_sample=False,
|
| 110 |
+
repetition_penalty=1.05,
|
| 111 |
+
)
|
| 112 |
+
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
Expected output format — the model reasons in `<think>...</think>`, then emits a tool call:
|
| 116 |
+
|
| 117 |
+
```
|
| 118 |
+
<think>
|
| 119 |
+
I need to find Python files in /tmp. I'll use Bash with ls and wc -l.
|
| 120 |
+
</think>
|
| 121 |
+
|
| 122 |
+
<|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|>
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
### vLLM
|
| 126 |
+
|
| 127 |
+
```bash
|
| 128 |
+
vllm serve LLM-OS-Models/LFM2.5-8B-A1B-Terminal-Fable5-Agentic-SFT-3Epoch \
|
| 129 |
+
--max-model-len 8192 --dtype bfloat16 --gpu-memory-utilization 0.9
|
| 130 |
+
```
|
| 131 |
+
|
| 132 |
+
## Intended use
|
| 133 |
+
|
| 134 |
+
- Local coding agent on top of an MoE-efficient backbone (1B active params)
|
| 135 |
+
- Terminal / file-system agentic loops (read, edit, run, verify)
|
| 136 |
+
- Research on distillation from frontier closed models into open-weight MoE models
|
| 137 |
+
|
| 138 |
+
## Limitations
|
| 139 |
+
|
| 140 |
+
- **Agentic specialization.** This is a focused fine-tune for terminal/coding agentic work. General-knowledge breadth is inherited from the base and may be slightly below `LFM2.5-8B-A1B` on benchmarks outside the agentic domain.
|
| 141 |
+
- **No safety alignment.** Trained on raw tool-use traces; add your own guardrails for production deployments.
|
| 142 |
+
- **Tool-format lock-in.** The model emits LFM-native tool-call syntax. A harness that parses `<|tool_call_start|>...<|tool_call_end|>` and executes the call is required for the agentic loop to actually work.
|
| 143 |
+
- **Max seq 8,192 at training.** Beyond 8K context, behavior is unverified for this checkpoint.
|
| 144 |
+
- **English-centric.**
|
| 145 |
+
|
| 146 |
+
## License
|
| 147 |
+
|
| 148 |
+
Apache 2.0, inherited from the LiquidAI LFM2.5-8B-A1B base.
|
| 149 |
+
|
| 150 |
+
## Citation / lineage
|
| 151 |
+
|
| 152 |
+
```
|
| 153 |
+
Base: LiquidAI/LFM2.5-8B-A1B
|
| 154 |
+
→ LLM-OS-Models/LFM2.5-8B-A1B-Terminal-ToolBench-Full-SFT-1Epoch (ToolBench SFT)
|
| 155 |
+
→ LLM-OS-Models/LFM2.5-8B-A1B-Terminal-Fable5-Agentic-SFT-3Epoch (this model, Fable-5 agentic SFT)
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
Training data: [Glint-Research/Fable-5-traces](https://huggingface.co/datasets/Glint-Research/Fable-5-traces)
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token -}}
|
| 2 |
+
{%- set preserve_thinking = preserve_thinking | default(false) -%}
|
| 3 |
+
|
| 4 |
+
{%- macro format_arg_value(arg_value) -%}
|
| 5 |
+
{%- if arg_value is string -%}
|
| 6 |
+
{{- "'" + arg_value + "'" -}}
|
| 7 |
+
{%- elif arg_value is mapping -%}
|
| 8 |
+
{{- arg_value | tojson -}}
|
| 9 |
+
{%- else -%}
|
| 10 |
+
{{- arg_value | string -}}
|
| 11 |
+
{%- endif -%}
|
| 12 |
+
{%- endmacro -%}
|
| 13 |
+
|
| 14 |
+
{%- macro parse_content(content) -%}
|
| 15 |
+
{%- if content is string -%}
|
| 16 |
+
{{- content -}}
|
| 17 |
+
{%- else -%}
|
| 18 |
+
{%- set _ns = namespace(result="") -%}
|
| 19 |
+
{%- for item in content -%}
|
| 20 |
+
{%- if item["type"] == "image" -%}
|
| 21 |
+
{%- set _ns.result = _ns.result + "<image>" -%}
|
| 22 |
+
{%- elif item["type"] == "text" -%}
|
| 23 |
+
{%- set _ns.result = _ns.result + item["text"] -%}
|
| 24 |
+
{%- else -%}
|
| 25 |
+
{%- set _ns.result = _ns.result + item | tojson -%}
|
| 26 |
+
{%- endif -%}
|
| 27 |
+
{%- endfor -%}
|
| 28 |
+
{{- _ns.result -}}
|
| 29 |
+
{%- endif -%}
|
| 30 |
+
{%- endmacro -%}
|
| 31 |
+
|
| 32 |
+
{%- macro render_tool_calls(tool_calls) -%}
|
| 33 |
+
{%- set tool_calls_ns = namespace(tool_calls=[]) -%}
|
| 34 |
+
{%- for tool_call in tool_calls -%}
|
| 35 |
+
{%- set func_name = tool_call["function"]["name"] -%}
|
| 36 |
+
{%- set func_args = tool_call["function"]["arguments"] -%}
|
| 37 |
+
{%- set args_ns = namespace(arg_strings=[]) -%}
|
| 38 |
+
{%- for arg_name, arg_value in func_args.items() -%}
|
| 39 |
+
{%- set args_ns.arg_strings = args_ns.arg_strings + [arg_name + "=" + format_arg_value(arg_value)] -%}
|
| 40 |
+
{%- endfor -%}
|
| 41 |
+
{%- set tool_calls_ns.tool_calls = tool_calls_ns.tool_calls + [func_name + "(" + (args_ns.arg_strings | join(", ")) + ")"] -%}
|
| 42 |
+
{%- endfor -%}
|
| 43 |
+
{{- "<|tool_call_start|>[" + (tool_calls_ns.tool_calls | join(", ")) + "]<|tool_call_end|>" -}}
|
| 44 |
+
{%- endmacro -%}
|
| 45 |
+
|
| 46 |
+
{%- set ns = namespace(system_prompt="", last_user_index=-1) -%}
|
| 47 |
+
{%- if messages[0]["role"] == "system" -%}
|
| 48 |
+
{%- if messages[0].get("content") -%}
|
| 49 |
+
{%- set ns.system_prompt = parse_content(messages[0]["content"]) -%}
|
| 50 |
+
{%- endif -%}
|
| 51 |
+
{%- set messages = messages[1:] -%}
|
| 52 |
+
{%- endif -%}
|
| 53 |
+
{%- if tools -%}
|
| 54 |
+
{%- set ns.system_prompt = ns.system_prompt + ("\n" if ns.system_prompt else "") + "List of tools: [" -%}
|
| 55 |
+
{%- for tool in tools -%}
|
| 56 |
+
{%- if tool is not string -%}
|
| 57 |
+
{%- set tool = tool | tojson -%}
|
| 58 |
+
{%- endif -%}
|
| 59 |
+
{%- set ns.system_prompt = ns.system_prompt + tool -%}
|
| 60 |
+
{%- if not loop.last -%}
|
| 61 |
+
{%- set ns.system_prompt = ns.system_prompt + ", " -%}
|
| 62 |
+
{%- endif -%}
|
| 63 |
+
{%- endfor -%}
|
| 64 |
+
{%- set ns.system_prompt = ns.system_prompt + "]" -%}
|
| 65 |
+
{%- endif -%}
|
| 66 |
+
{%- if ns.system_prompt -%}
|
| 67 |
+
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
| 68 |
+
{%- endif -%}
|
| 69 |
+
{%- for message in messages -%}
|
| 70 |
+
{%- if message["role"] == "user" -%}
|
| 71 |
+
{%- set ns.last_user_index = loop.index0 -%}
|
| 72 |
+
{%- endif -%}
|
| 73 |
+
{%- endfor -%}
|
| 74 |
+
{%- for message in messages -%}
|
| 75 |
+
{{- "<|im_start|>" + message.role + "\n" -}}
|
| 76 |
+
{%- if message.role == "assistant" -%}
|
| 77 |
+
{%- generation -%}
|
| 78 |
+
{%- if message.thinking is defined and (preserve_thinking or loop.index0 > ns.last_user_index) -%}
|
| 79 |
+
{{- "<think>" + message.thinking + "</think>" -}}
|
| 80 |
+
{%- endif -%}
|
| 81 |
+
{%- set _cfm_tag = "CONTINUE_FINAL_MESSAGE_TAG " -%}
|
| 82 |
+
{%- set _has_cfm = false -%}
|
| 83 |
+
{%- if message.content is defined -%}
|
| 84 |
+
{%- set content = parse_content(message.content) -%}
|
| 85 |
+
{%- if not (preserve_thinking or loop.index0 > ns.last_user_index) -%}
|
| 86 |
+
{%- if "</think>" in content -%}
|
| 87 |
+
{%- set content = content.split("</think>")[-1] | trim -%}
|
| 88 |
+
{%- endif -%}
|
| 89 |
+
{%- endif -%}
|
| 90 |
+
{%- if message.tool_calls is defined and content.endswith(_cfm_tag) -%}
|
| 91 |
+
{%- set _has_cfm = true -%}
|
| 92 |
+
{%- set _trunc_len = (content | length) - (_cfm_tag | length) -%}
|
| 93 |
+
{{- content[:_trunc_len] -}}
|
| 94 |
+
{%- else -%}
|
| 95 |
+
{{- content -}}
|
| 96 |
+
{%- endif -%}
|
| 97 |
+
{%- endif -%}
|
| 98 |
+
{%- if message.tool_calls is defined -%}
|
| 99 |
+
{{- render_tool_calls(message.tool_calls) -}}
|
| 100 |
+
{%- endif -%}
|
| 101 |
+
{%- if _has_cfm -%}
|
| 102 |
+
{{- _cfm_tag -}}
|
| 103 |
+
{%- endif -%}
|
| 104 |
+
{{- "<|im_end|>\n" -}}
|
| 105 |
+
{%- endgeneration -%}
|
| 106 |
+
{%- else %}
|
| 107 |
+
{%- if message.get("content") -%}
|
| 108 |
+
{{- parse_content(message["content"]) -}}
|
| 109 |
+
{%- endif -%}
|
| 110 |
+
{{- "<|im_end|>\n" -}}
|
| 111 |
+
{%- endif %}
|
| 112 |
+
{%- endfor -%}
|
| 113 |
+
{%- if add_generation_prompt -%}
|
| 114 |
+
{{- "<|im_start|>assistant\n" -}}
|
| 115 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Lfm2MoeForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"bos_token_id": 124894,
|
| 6 |
+
"conv_L_cache": 3,
|
| 7 |
+
"conv_bias": false,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 124900,
|
| 10 |
+
"hidden_size": 2048,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 7168,
|
| 13 |
+
"layer_types": [
|
| 14 |
+
"conv",
|
| 15 |
+
"conv",
|
| 16 |
+
"full_attention",
|
| 17 |
+
"conv",
|
| 18 |
+
"conv",
|
| 19 |
+
"conv",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"conv",
|
| 22 |
+
"conv",
|
| 23 |
+
"conv",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"conv",
|
| 26 |
+
"conv",
|
| 27 |
+
"conv",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"conv",
|
| 30 |
+
"conv",
|
| 31 |
+
"conv",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"conv",
|
| 34 |
+
"conv",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"conv",
|
| 37 |
+
"conv"
|
| 38 |
+
],
|
| 39 |
+
"max_position_embeddings": 128000,
|
| 40 |
+
"model_name": "LiquidAI/LFM2.5-8B-A1B",
|
| 41 |
+
"model_type": "lfm2_moe",
|
| 42 |
+
"moe_intermediate_size": 1792,
|
| 43 |
+
"norm_eps": 1e-05,
|
| 44 |
+
"norm_topk_prob": true,
|
| 45 |
+
"num_attention_heads": 32,
|
| 46 |
+
"num_dense_layers": 2,
|
| 47 |
+
"num_experts": 32,
|
| 48 |
+
"num_experts_per_tok": 4,
|
| 49 |
+
"num_hidden_layers": 24,
|
| 50 |
+
"num_key_value_heads": 8,
|
| 51 |
+
"pad_token_id": 124893,
|
| 52 |
+
"rope_parameters": {
|
| 53 |
+
"rope_theta": 5000000,
|
| 54 |
+
"rope_type": "default"
|
| 55 |
+
},
|
| 56 |
+
"routed_scaling_factor": 1.0,
|
| 57 |
+
"tie_word_embeddings": true,
|
| 58 |
+
"transformers_version": "5.5.0",
|
| 59 |
+
"unsloth_version": "2026.4.8",
|
| 60 |
+
"use_cache": false,
|
| 61 |
+
"use_expert_bias": true,
|
| 62 |
+
"vocab_size": 128000
|
| 63 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 124894,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
124900
|
| 6 |
+
],
|
| 7 |
+
"max_length": 128000,
|
| 8 |
+
"output_attentions": false,
|
| 9 |
+
"output_hidden_states": false,
|
| 10 |
+
"pad_token_id": 124893,
|
| 11 |
+
"transformers_version": "5.5.0",
|
| 12 |
+
"use_cache": true
|
| 13 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c33c49ed32b2b09bac161ef8e3fada604b46b80dacdb7f2e0c7a4b62ed1c3db
|
| 3 |
+
size 16936006912
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:695be7802a0e4b8a81048f0ff5ebb7fc811a0ba5a6be63dbb24deb5a81096f41
|
| 3 |
+
size 17905598
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|startoftext|>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|im_end|>",
|
| 6 |
+
"is_local": true,
|
| 7 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 8 |
+
"pad_token": "<|pad|>",
|
| 9 |
+
"padding_side": "right",
|
| 10 |
+
"tokenizer_class": "TokenizersBackend",
|
| 11 |
+
"use_default_system_prompt": false
|
| 12 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6a4f5ba72caf07528d9c009943e7645de49a73764877078b494afda8818ab561
|
| 3 |
+
size 5265
|