gyung commited on
Commit
39c84af
ยท
verified ยท
1 Parent(s): 85915cd

Update model card with pending TB2-lite evaluation status

Browse files
Files changed (1) hide show
  1. README.md +147 -35
README.md CHANGED
@@ -1,55 +1,167 @@
1
  ---
2
- base_model: LiquidAI/LFM2.5-8B-A1B
3
- library_name: peft
 
 
 
4
  tags:
5
- - lora
6
  - terminal
7
- - tool-use
8
- - harness-1
9
- - lfm2
10
- - lfm2.5
11
  - sft
12
- license: other
 
 
 
13
  ---
14
 
15
- # LFM2.5-8B-A1B Harness-1 LoRA SFT R32 Reloadable
16
 
17
- This repository contains a PEFT/LoRA adapter for `LiquidAI/LFM2.5-8B-A1B` trained on a local Harness-1-style terminal/tool-use SFT bootstrap dataset.
18
 
19
- ## Training Summary
20
 
21
- - Base model: `LiquidAI/LFM2.5-8B-A1B`
22
- - Method: LoRA SFT, rank 32, alpha 64, bf16
23
- - Context length: 32,768
24
- - Hardware: 8 x NVIDIA H200
25
- - Effective batch size: 128
26
- - Epochs: 3
27
- - Train rows after packing/cache: 493
28
- - Runtime: 320.3 seconds
29
- - Final train loss: 4.673
30
 
31
- ## LoRA Target Modules
32
 
33
- This adapter intentionally avoids LFM MoE expert `target_parameters` because the current PEFT/Unsloth stack can save those tensors but reload/merge them with mismatched expert dimensions. The reloadable target set is:
34
 
35
- `q_proj,k_proj,v_proj,out_proj,in_proj,w1,w2,w3,gate`
36
-
37
- ## Data Note
 
38
 
39
- The SFT data was generated from public BrowseComp+ style query/gold-document records into deterministic Harness-style tool trajectories. It is a bootstrap run, not the original paper's GPT-5.4 teacher trajectory set.
40
 
41
- ## Use
 
 
 
42
 
43
- Load with PEFT on top of the base model:
44
 
45
  ```python
46
- from peft import PeftModel
47
- from transformers import AutoModelForCausalLM, AutoTokenizer
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
- base = "LiquidAI/LFM2.5-8B-A1B"
50
- adapter = "LLM-OS-Models/LFM2.5-8B-A1B-Harness1-LoRA-SFT-R32-Reloadable"
51
 
52
- tok = AutoTokenizer.from_pretrained(adapter, trust_remote_code=True)
53
- model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="auto", trust_remote_code=True)
54
- model = PeftModel.from_pretrained(model, adapter)
 
 
 
 
 
 
55
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ - ko
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
  tags:
 
8
  - terminal
 
 
 
 
9
  - sft
10
+ - vllm
11
+ - tb2-lite
12
+ - evaluation-pending
13
+ base_model: unknown
14
  ---
15
 
16
+ # LLM-OS-Models/LFM2.5-8B-A1B-Harness1-LoRA-SFT-R32-Reloadable
17
 
18
+ ํ„ฐ๋ฏธ๋„ ์ž‘์—… ์ž๋™ํ™”๋ฅผ ์œ„ํ•œ Terminal SFT ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. ์ž…๋ ฅ๋œ ์ž‘์—…/์ด์ „ ํ„ฐ๋ฏธ๋„ ์ƒํƒœ๋ฅผ ๋ณด๊ณ  ๋‹ค์Œ์— ์‹คํ–‰ํ•  ๋ช…๋ น์„ JSON ํ˜•ํƒœ๋กœ ์ƒ์„ฑํ•˜๋Š” ์šฉ๋„๋กœ ํ•™์Šตํ–ˆ์Šต๋‹ˆ๋‹ค.
19
 
20
+ ## ๋ชจ๋ธ ์š”์•ฝ
21
 
22
+ - Base model: `unknown`
23
+ - Training setup: `Terminal SFT`
24
+ - Model card snapshot: `2026-06-06 23:10:54 UTC`
25
+ - Corrected TB2-lite evaluated results currently indexed: `60`
26
+ - Corrected TB2-lite score: `pending / not matched in current result directory`
 
 
 
 
27
 
28
+ ## Quickstart
29
 
30
+ ์„ค์น˜์™€ ๋กœ๊ทธ์ธ:
31
 
32
+ ```bash
33
+ pip install -U vllm transformers huggingface_hub
34
+ huggingface-cli login
35
+ ```
36
 
37
+ ๊ด€๋ จ ์ฝ”๋“œ:
38
 
39
+ - GitHub: https://github.com/LLM-OS-Models/Terminal
40
+ - vLLM ํ‰๊ฐ€ ์‹คํ–‰: `tb2_lite/scripts/replay_eval.py`
41
+ - chat template/fallback ์ƒ์„ฑ: `tb2_lite/scripts/prompt_builder.py`
42
+ - JSON/command ์ฑ„์ : `tb2_lite/scripts/replay_metrics.py`
43
 
44
+ vLLM ์ง์ ‘ ์‹คํ–‰ ์˜ˆ์‹œ. ํ‰๊ฐ€ ์ฝ”๋“œ์™€ ๋™์ผํ•˜๊ฒŒ chat template์„ ์šฐ์„  ์‚ฌ์šฉํ•˜๊ณ , template์ด ์—†์œผ๋ฉด ChatML/Gemma fallback์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
45
 
46
  ```python
47
+ from transformers import AutoTokenizer
48
+ from vllm import LLM, SamplingParams
49
+
50
+ model_id = "LLM-OS-Models/LFM2.5-8B-A1B-Harness1-LoRA-SFT-R32-Reloadable"
51
+ tp = 1
52
+
53
+ tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
54
+ llm = LLM(
55
+ model=model_id,
56
+ tokenizer=model_id,
57
+ trust_remote_code=True,
58
+ dtype="bfloat16",
59
+ tensor_parallel_size=tp,
60
+ max_model_len=49152,
61
+ gpu_memory_utilization=0.92,
62
+ )
63
+
64
+ messages = [
65
+ {"role": "system", "content": "You are a terminal automation assistant. Return JSON only."},
66
+ {"role": "user", "content": "Inspect the current directory and list Python files."},
67
+ ]
68
+
69
+ def render_chatml(messages):
70
+ parts = []
71
+ for message in messages:
72
+ role = "assistant" if message["role"] == "assistant" else message["role"]
73
+ if role == "tool":
74
+ role = "user"
75
+ parts.append(f"<|im_start|>{role}\n{message['content']}<|im_end|>\n")
76
+ parts.append("<|im_start|>assistant\n")
77
+ return "".join(parts)
78
+
79
+ def render_gemma4_turn(messages, empty_thought_channel=False):
80
+ parts = ["<bos>"]
81
+ for message in messages:
82
+ role = "model" if message["role"] == "assistant" else message["role"]
83
+ if role == "tool":
84
+ role = "user"
85
+ parts.append(f"<|turn>{role}\n{message['content'].strip()}<turn|>\n")
86
+ parts.append("<|turn>model\n")
87
+ if empty_thought_channel:
88
+ parts.append("<|channel>thought\n<channel|>")
89
+ return "".join(parts)
90
+
91
+ def render_prompt(model_id, tokenizer, messages):
92
+ model_key = model_id.lower()
93
+ if "gemma-4" in model_key:
94
+ try:
95
+ return tokenizer.apply_chat_template(
96
+ messages,
97
+ tokenize=False,
98
+ add_generation_prompt=True,
99
+ enable_thinking=False,
100
+ )
101
+ except Exception:
102
+ return render_gemma4_turn(
103
+ messages,
104
+ empty_thought_channel=("26b" in model_key or "31b" in model_key),
105
+ )
106
+ try:
107
+ return tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
108
+ except Exception:
109
+ return render_chatml(messages)
110
+
111
+ prompt = render_prompt(model_id, tokenizer, messages)
112
+ sampling = SamplingParams(
113
+ temperature=0.0,
114
+ top_p=1.0,
115
+ max_tokens=1024,
116
+ repetition_penalty=1.0,
117
+ )
118
+ outputs = llm.generate([prompt], sampling_params=sampling)
119
+ print(outputs[0].outputs[0].text)
120
+ ```
121
 
122
+ ๊ถŒ์žฅ ์ถœ๋ ฅ ํ˜•์‹:
 
123
 
124
+ ```json
125
+ {
126
+ "analysis": "brief reasoning about the next terminal action",
127
+ "plan": "short execution plan",
128
+ "commands": [
129
+ {"keystrokes": "ls -la\n", "duration": 0.1}
130
+ ],
131
+ "task_complete": false
132
+ }
133
  ```
134
+
135
+ ํ‰๊ฐ€์™€ ๋™์ผํ•œ replay ๋ช…๋ น:
136
+
137
+ ```bash
138
+ python tb2_lite/scripts/replay_eval.py \
139
+ --model LLM-OS-Models/LFM2.5-8B-A1B-Harness1-LoRA-SFT-R32-Reloadable \
140
+ --model-short LLM-OS-Models__LFM2.5-8B-A1B-Harness1-LoRA-SFT-R32-Reloadable \
141
+ --eval-path tb2_lite/data/replay_full.jsonl \
142
+ --output-dir /home/work/.data/tb2_lite_eval/corrected_readme_models_vllm \
143
+ --dtype bfloat16 \
144
+ --tp 1 \
145
+ --max-model-len 49152 \
146
+ --max-tokens 1024 \
147
+ --temperature 0.0 \
148
+ --top-p 1.0 \
149
+ --gpu-memory-utilization 0.92 \
150
+ --language-model-only
151
+ ```
152
+
153
+ - ๊ธฐ๋ณธ ๊ถŒ์žฅ tensor parallel: `1`. OOM์ด๋ฉด `--tp`์™€ `tensor_parallel_size`๋ฅผ 2/4/8๋กœ ์˜ฌ๋ฆฌ์„ธ์š”.
154
+ - corrected TB2-lite ํ‰๊ฐ€๋Š” `temperature=0.0`, `top_p=1.0`, `max_tokens=1024`๋กœ ๊ณ ์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
155
+ - Gemma 4๋Š” JSON ์ถœ๋ ฅ์„ ์œ„ํ•ด `enable_thinking=False`๋ฅผ ์‚ฌ์šฉํ•˜๊ณ , 26B/31B ๊ณ„์—ด์€ ํ‰๊ฐ€ ์ฝ”๋“œ์—์„œ empty thought channel ์ฒ˜๋ฆฌ๋ฅผ ์ž๋™ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
156
+
157
+ ## ํ‰๊ฐ€ ์ƒํƒœ
158
+
159
+ - Current corrected TB2-lite score: `pending`
160
+ - Reason: ํ˜„์žฌ `/home/work/.data/tb2_lite_eval/corrected_readme_models_vllm` ์ง‘๊ณ„ ๊ฒฐ๊ณผ์™€ ์ด HF repo๋ช…์ด ์ง์ ‘ ๋งค์นญ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
161
+ - Next step: ๋™์ผํ•œ `tb2_lite/scripts/replay_eval.py` ๊ฒฝ๋กœ๋กœ ํ‰๊ฐ€๋ฅผ ๋Œ๋ฆฐ ๋’ค ์ ์ˆ˜ ์นด๋“œ๋กœ ์ž๋™ ๊ต์ฒดํ•ฉ๋‹ˆ๋‹ค.
162
+
163
+ ## ๋ชจ๋ธ๊ตฐ ํ•ด์„
164
+
165
+ - LFM ๊ณ„์—ด์€ ๋น ๋ฅธ sec/step๊ณผ ํฐ SFT ๋ฐ˜์‘์„ฑ์ด ์žฅ์ ์ž…๋‹ˆ๋‹ค. ์ด repo๋Š” ์•„์ง ํ˜„์žฌ ์ง‘๊ณ„ JSON๊ณผ ์ง์ ‘ ๋งค์นญ๋˜๋Š” ์ ์ˆ˜๊ฐ€ ์—†์–ด ๋ณ„๋„ ํ‰๊ฐ€๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
166
+ - TB2-lite ์ ์ˆ˜๋Š” ์ผ๋ฐ˜ ์ง€๋Šฅ ๋ฒค์น˜๋งˆํฌ๊ฐ€ ์•„๋‹ˆ๋ผ ํ„ฐ๋ฏธ๋„ next-action JSON ์žฌํ˜„ ๋Šฅ๋ ฅ์„ ์ธก์ •ํ•ฉ๋‹ˆ๋‹ค.
167
+ - ์ƒ์„ฑ ๋ช…๋ น์€ ์‹ค์ œ ์‹คํ–‰ ์ „์— sandbox, allowlist, human review ๊ฐ™์€ ์•ˆ์ „์žฅ์น˜๋ฅผ ๊ฑฐ์ณ์•ผ ํ•ฉ๋‹ˆ๋‹ค.