Instructions to use LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot
- SGLang
How to use LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot 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/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot with Docker Model Runner:
docker model run hf.co/LLM-OS-Models/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot
Update model card with pending TB2-lite evaluation status
Browse files
README.md
CHANGED
|
@@ -1,64 +1,167 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
-
Transformers-ready model. Convert it with `HRM-Text/conversion/convert_to_hf.py`
|
| 7 |
-
after selecting a checkpoint for release.
|
| 8 |
|
| 9 |
-
##
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
| Epochs | 1 |
|
| 17 |
-
| Global batch | 262,144 tokens |
|
| 18 |
-
| Context | 4,096 train tokens |
|
| 19 |
-
| Wall time | about 7m 38s |
|
| 20 |
-
| Final train loss | 3.00653 |
|
| 21 |
-
| Final token accuracy | 0.46379 |
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
| 25 |
```bash
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
NCCL_DEBUG=WARN TORCH_NCCL_ASYNC_ERROR_HANDLING=1 \
|
| 29 |
-
torchrun --standalone --nproc_per_node=8 pretrain.py \
|
| 30 |
-
arch/size@arch=B \
|
| 31 |
-
data.path=/home/work/.data/hrm_text_prepared/sft_swe_glm_mix_v1 \
|
| 32 |
-
+checkpoint_path=/home/work/.data/hrm_text_checkpoints/koterm_b_swe_glm_pilot_v1 \
|
| 33 |
-
+project_name=HRM-Ko-Terminal \
|
| 34 |
-
+run_name=koterm_b_swe_glm_pilot_v1 \
|
| 35 |
-
epochs=1 \
|
| 36 |
-
global_batch_size=262144 \
|
| 37 |
-
lr_warmup_steps=100 \
|
| 38 |
-
+log_interval=5 \
|
| 39 |
-
checkpoint_interval=1
|
| 40 |
```
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
| GLM-5.1 reasoning cleaned sample | 56,021 | 68,452,781 | `<think>...</think>` stripped, direct answers |
|
| 52 |
-
| Total | 109,889 | 251,170,780 | PrefixLM, response-only loss |
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
-
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
##
|
| 59 |
|
| 60 |
-
-
|
| 61 |
-
-
|
| 62 |
-
-
|
| 63 |
-
- `train_metadata.yaml`: tokenizer and dataset metadata.
|
| 64 |
-
- `hrm_nocarry_bp_warmup.py`: copied model source for reproducibility.
|
|
|
|
| 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/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot
|
| 17 |
|
| 18 |
+
ํฐ๋ฏธ๋ ์์
์๋ํ๋ฅผ ์ํ Terminal SFT ๋ชจ๋ธ์
๋๋ค. ์
๋ ฅ๋ ์์
/์ด์ ํฐ๋ฏธ๋ ์ํ๋ฅผ ๋ณด๊ณ ๋ค์์ ์คํํ ๋ช
๋ น์ JSON ํํ๋ก ์์ฑํ๋ ์ฉ๋๋ก ํ์ตํ์ต๋๋ค.
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
## ๋ชจ๋ธ ์์ฝ
|
| 21 |
|
| 22 |
+
- Base model: `unknown`
|
| 23 |
+
- Training setup: `Terminal SFT`
|
| 24 |
+
- Model card snapshot: `2026-05-23 01:03:46 UTC`
|
| 25 |
+
- Corrected TB2-lite evaluated results currently indexed: `56`
|
| 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/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot"
|
| 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/HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot \
|
| 140 |
+
--model-short LLM-OS-Models__HRM-Text-Ko-Terminal-B-SWE-GLM-Pilot \
|
| 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 |
+
- ์ด repo๋ ์์ง ํ์ฌ corrected TB2-lite ์ง๊ณ JSON๊ณผ ์ง์ ๋งค์นญ๋๋ ์ ์๊ฐ ์์ต๋๋ค.
|
| 166 |
+
- TB2-lite ์ ์๋ ์ผ๋ฐ ์ง๋ฅ ๋ฒค์น๋งํฌ๊ฐ ์๋๋ผ ํฐ๋ฏธ๋ next-action JSON ์ฌํ ๋ฅ๋ ฅ์ ์ธก์ ํฉ๋๋ค.
|
| 167 |
+
- ์์ฑ ๋ช
๋ น์ ์ค์ ์คํ ์ ์ sandbox, allowlist, human review ๊ฐ์ ์์ ์ฅ์น๋ฅผ ๊ฑฐ์ณ์ผ ํฉ๋๋ค.
|
|
|
|
|
|