Text Generation
Transformers
Safetensors
English
Korean
ouro
terminal
sft
vllm
tb2-lite
conversational
custom_code
Instructions to use LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT" # 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/Ouro-1.4B-Thinking-Terminal-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT
- SGLang
How to use LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT 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/Ouro-1.4B-Thinking-Terminal-SFT" \ --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/Ouro-1.4B-Thinking-Terminal-SFT", "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/Ouro-1.4B-Thinking-Terminal-SFT" \ --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/Ouro-1.4B-Thinking-Terminal-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT with Docker Model Runner:
docker model run hf.co/LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT
File size: 7,209 Bytes
39e0a55 d4e7f96 39e0a55 1c07c49 39e0a55 581e231 39e0a55 581e231 39e0a55 581e231 39e0a55 581e231 39e0a55 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | ---
language:
- en
- ko
library_name: transformers
pipeline_tag: text-generation
tags:
- terminal
- sft
- vllm
- tb2-lite
base_model: ByteDance/Ouro-1.4B-Thinking
---
# LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT
ํฐ๋ฏธ๋ ์์
์๋ํ๋ฅผ ์ํ Terminal SFT ๋ชจ๋ธ์
๋๋ค. ์
๋ ฅ๋ ์์
/์ด์ ํฐ๋ฏธ๋ ์ํ๋ฅผ ๋ณด๊ณ ๋ค์์ ์คํํ ๋ช
๋ น์ JSON ํํ๋ก ์์ฑํ๋ ์ฉ๋๋ก ํ์ตํ์ต๋๋ค.
## ๋ชจ๋ธ ์์ฝ
- Base model: `ByteDance/Ouro-1.4B-Thinking`
- Training setup: `Terminal SFT`
- Evaluation snapshot: `2026-05-09 00:57:29 UTC`
- Evaluation result id: `ouro_1p4b_thinking_terminal_sft`
## Quickstart
์ค์น์ ๋ก๊ทธ์ธ:
```bash
pip install -U vllm transformers huggingface_hub
huggingface-cli login
```
๊ด๋ จ ์ฝ๋:
- GitHub: https://github.com/LLM-OS-Models/Terminal
- vLLM ํ๊ฐ ์คํ: `tb2_lite/scripts/replay_eval.py`
- chat template/fallback ์์ฑ: `tb2_lite/scripts/prompt_builder.py`
- JSON/command ์ฑ์ : `tb2_lite/scripts/replay_metrics.py`
vLLM ์ง์ ์คํ ์์. ํ๊ฐ ์ฝ๋์ ๋์ผํ๊ฒ chat template์ ์ฐ์ ์ฌ์ฉํ๊ณ , template์ด ์์ผ๋ฉด ChatML/Gemma fallback์ ์ฌ์ฉํฉ๋๋ค.
```python
from transformers import AutoTokenizer
from vllm import LLM, SamplingParams
model_id = "LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT"
tp = 1
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
llm = LLM(
model=model_id,
tokenizer=model_id,
trust_remote_code=True,
dtype="bfloat16",
tensor_parallel_size=tp,
max_model_len=49152,
gpu_memory_utilization=0.92,
)
messages = [
{"role": "system", "content": "You are a terminal automation assistant. Return JSON only."},
{"role": "user", "content": "Inspect the current directory and list Python files."},
]
def render_chatml(messages):
parts = []
for message in messages:
role = "assistant" if message["role"] == "assistant" else message["role"]
if role == "tool":
role = "user"
parts.append(f"<|im_start|>{role}\n{message['content']}<|im_end|>\n")
parts.append("<|im_start|>assistant\n")
return "".join(parts)
def render_gemma4_turn(messages, empty_thought_channel=False):
parts = ["<bos>"]
for message in messages:
role = "model" if message["role"] == "assistant" else message["role"]
if role == "tool":
role = "user"
parts.append(f"<|turn>{role}\n{message['content'].strip()}<turn|>\n")
parts.append("<|turn>model\n")
if empty_thought_channel:
parts.append("<|channel>thought\n<channel|>")
return "".join(parts)
def render_prompt(model_id, tokenizer, messages):
model_key = model_id.lower()
if "gemma-4" in model_key:
try:
return tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
except Exception:
return render_gemma4_turn(
messages,
empty_thought_channel=("26b" in model_key or "31b" in model_key),
)
try:
return tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
except Exception:
return render_chatml(messages)
prompt = render_prompt(model_id, tokenizer, messages)
sampling = SamplingParams(
temperature=0.0,
top_p=1.0,
max_tokens=1024,
repetition_penalty=1.0,
)
outputs = llm.generate([prompt], sampling_params=sampling)
print(outputs[0].outputs[0].text)
```
๊ถ์ฅ ์ถ๋ ฅ ํ์:
```json
{
"analysis": "brief reasoning about the next terminal action",
"plan": "short execution plan",
"commands": [
{"keystrokes": "ls -la\n", "duration": 0.1}
],
"task_complete": false
}
```
ํ๊ฐ์ ๋์ผํ replay ๋ช
๋ น:
```bash
python tb2_lite/scripts/replay_eval.py \
--model LLM-OS-Models/Ouro-1.4B-Thinking-Terminal-SFT \
--model-short ouro_1p4b_thinking_terminal_sft \
--eval-path tb2_lite/data/replay_full.jsonl \
--output-dir /home/work/.data/tb2_lite_eval/corrected_readme_models_vllm \
--dtype bfloat16 \
--tp 1 \
--max-model-len 49152 \
--max-tokens 1024 \
--temperature 0.0 \
--top-p 1.0 \
--gpu-memory-utilization 0.92 \
--language-model-only
```
- ๊ธฐ๋ณธ ๊ถ์ฅ tensor parallel: `1`. OOM์ด๋ฉด `--tp`์ `tensor_parallel_size`๋ฅผ 2/4/8๋ก ์ฌ๋ฆฌ์ธ์.
- corrected TB2-lite ํ๊ฐ๋ `temperature=0.0`, `top_p=1.0`, `max_tokens=1024`๋ก ๊ณ ์ ํ์ต๋๋ค.
- Gemma 4๋ JSON ์ถ๋ ฅ์ ์ํด `enable_thinking=False`๋ฅผ ์ฌ์ฉํ๊ณ , 26B/31B ๊ณ์ด์ ํ๊ฐ ์ฝ๋์์ empty thought channel ์ฒ๋ฆฌ๋ฅผ ์๋ ์ ์ฉํฉ๋๋ค.
## ํ๊ฐ ๊ฒฐ๊ณผ
ํ๊ฐ๋ corrected TB2-lite replay set์์ vLLM์ผ๋ก ์ํํ์ต๋๋ค. ์์ ์ ์๋ `100 * avg_command_f1`๋ง ์ฌ์ฉํ๊ณ , `first_cmd_exact_pct`๋ ๋ณด์กฐ ์งํ๋ก๋ง ๋ด
๋๋ค.
- Rank: `25 / 56`
- Score: `31.74`
- Command F1: `0.3174`
- Command precision: `0.4062`
- Command recall: `0.3410`
- First command exact: `24.8%`
- Valid JSON: `63.7%`
- Steps / tasks: `303 / 50`
- Sec/step: `1.698`
- Load time: `92.4s`
- Template status: `chat_template`
- Rank eligible: `True`
- Eval timestamp: `2026-05-07T22:48:02.585588`
- ํ์ฌ ์ง๊ณ๋ ํ๊ฐ ๊ฒฐ๊ณผ ์: `56`
Prompt/template audit:
```json
{
"template_status": "chat_template",
"rank_eligible": true,
"steps": 303,
"tasks": 50
}
```
## ์ฅ์
- ํน์ ํฌ๊ธฐ/๊ฐ์ ๊ฒฝ๋ก์์ ๋น์ฉ ๋๋น ๋น ๋ฅธ ์ถ๋ก ์ ๊ธฐ๋ํ ์ ์์ต๋๋ค.
- ์๋ชป๋ ๋ช
๋ น์ ๋ง์ด ๋ด๊ธฐ๋ณด๋ค ๋ณด์์ ์ผ๋ก ๋ง๋ ๋ช
๋ น์ ๋ด๋ ๊ฒฝํฅ์ด ์์ต๋๋ค.
## ๋ชจ๋ธ๊ตฐ ํด์
- Ouro ๊ณ์ด์ Thinking SFT ์ชฝ์์ ์ ์๊ฐ ์ ์ฌ๋ผ๊ฐ์ง๋ง, ๊ฐ์ ํ๊ฐ ๊ธฐ์ค์์ LFM/Qwen ๋๋น sec/step์ด ์ปค์ RL ๋๋ ๋ฐ๋ณต์๋ ๋น์ฉ์ด ํฝ๋๋ค.
- ์ ์๋ ์๋ฏธ ์์ผ๋ ์๋ ๋ณ๋ชฉ์ด ์์ด, ์ฃผ๋ ฅ๋ณด๋ค๋ ์์ ํ๋ณด ํ์ธ์ฉ ablation์ ๋ ์ ํฉํฉ๋๋ค.
- ์๋๋ `1.698` sec/step ์์ค์ผ๋ก ๋น ๋ฅธ ํธ์
๋๋ค.
- RL ํ๋ณด์ฑ: ํ์ฌ ์ ์๋ง์ผ๋ก๋ ์ฃผ๋ ฅ ํ๋ณด๋ณด๋ค ๋ณด์กฐ/๋น๊ต๊ตฐ์ ๊ฐ๊น์ต๋๋ค.
## ํ๊ณ์ ์ฃผ์์ฌํญ
- recall์ด ์๋์ ์ผ๋ก ๋ฎ์ ํ์ํ ๋ช
๋ น ์ผ๋ถ๋ฅผ ๋น ๋จ๋ฆด ์ ์์ต๋๋ค.
- JSON ํ์ ์คํจ๊ฐ ์์ด ์คํ ์ ์ ํ์ฑ ๊ฒ์ฆ/์ฌ์๋๊ฐ ํ์ํฉ๋๋ค.
- Ouro ๊ณ์ด์ assistant-only masking ๋ฐ prompt template ์ผ์น ์ฌ๋ถ๊ฐ ์ฑ๋ฅ ํด์์ ํฐ ์ํฅ์ ์ค๋๋ค.
- ์ด ๋ชจ๋ธ์ ์๋ ํฐ๋ฏธ๋ ์กฐ์ ๋ณด์กฐ์ฉ SFT ๋ชจ๋ธ์ด๋ฉฐ, ์ผ๋ฐ ๋ํ/๋ฒ์ฉ ์ถ๋ก ์ฑ๋ฅ์ ๋ณด์ฅํ์ง ์์ต๋๋ค.
- ์์ฑ ๋ช
๋ น์ ์ค์ ์คํ ์ ์ sandbox, allowlist, human review ๊ฐ์ ์์ ์ฅ์น๋ฅผ ๊ฑฐ์ณ์ผ ํฉ๋๋ค.
## ํด์ ๋ฉ๋ชจ
TB2-lite ์ ์๋ ์ผ๋ฐ ์ง๋ฅ ๋ฒค์น๋งํฌ๊ฐ ์๋๋ผ ํฐ๋ฏธ๋ next-action JSON ์ฌํ ๋ฅ๋ ฅ์ ์ธก์ ํฉ๋๋ค. ๋ฐ๋ผ์ ๋ชจ๋ธ ํฌ๊ธฐ, chat template ์ผ์น, assistant-only masking, tokenizer, ํ์ต ๋ฐ์ดํฐ holdout ์ฌ๋ถ๊ฐ ๋ชจ๋ ์ ์์ ์ํฅ์ ์ค๋๋ค.
README.md์ MODEL_EVALUATION_REPORT.md์ ๊ฐ์ด ๋ ์ต์ ์ด๋ฉด ํด๋น ๊ฐ์ ์ฐ์ ํ์ธํ์ธ์. ์ด ๋ชจ๋ธ์นด๋๋ ์๋ฃ๋ ํ๊ฐ JSON์ ๊ธฐ์ค์ผ๋ก ๊ฐ๋ณ ์ ์ฅ์์ ๋น ๋ฅด๊ฒ ๋ฐ์ํ ์ค๋
์ท์
๋๋ค.
|