Text Generation
Transformers
Safetensors
English
Korean
ouro
terminal
sft
vllm
tb2-lite
conversational
custom_code
Instructions to use LLM-OS-Models/Ouro-2.6B-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-2.6B-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-2.6B-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-2.6B-terminal-sft", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LLM-OS-Models/Ouro-2.6B-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-2.6B-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-2.6B-terminal-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LLM-OS-Models/Ouro-2.6B-terminal-sft
- SGLang
How to use LLM-OS-Models/Ouro-2.6B-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-2.6B-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-2.6B-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-2.6B-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-2.6B-terminal-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LLM-OS-Models/Ouro-2.6B-terminal-sft with Docker Model Runner:
docker model run hf.co/LLM-OS-Models/Ouro-2.6B-terminal-sft
Update model card with corrected TB2-lite evaluation
Browse files
README.md
CHANGED
|
@@ -20,9 +20,138 @@ base_model: ByteDance/Ouro-2.6B
|
|
| 20 |
|
| 21 |
- Base model: `ByteDance/Ouro-2.6B`
|
| 22 |
- Training setup: `Terminal SFT`
|
| 23 |
-
- Evaluation snapshot: `2026-05-08 16:
|
| 24 |
- Evaluation result id: `ouro_2p6b_terminal_sft`
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
## ํ๊ฐ ๊ฒฐ๊ณผ
|
| 27 |
|
| 28 |
ํ๊ฐ๋ corrected TB2-lite replay set์์ vLLM์ผ๋ก ์ํํ์ต๋๋ค. ์์ ์ ์๋ `100 * avg_command_f1`๋ง ์ฌ์ฉํ๊ณ , `first_cmd_exact_pct`๋ ๋ณด์กฐ ์งํ๋ก๋ง ๋ด
๋๋ค.
|
|
|
|
| 20 |
|
| 21 |
- Base model: `ByteDance/Ouro-2.6B`
|
| 22 |
- Training setup: `Terminal SFT`
|
| 23 |
+
- Evaluation snapshot: `2026-05-08 16:08:25 UTC`
|
| 24 |
- Evaluation result id: `ouro_2p6b_terminal_sft`
|
| 25 |
|
| 26 |
+
## Quickstart
|
| 27 |
+
|
| 28 |
+
์ค์น์ ๋ก๊ทธ์ธ:
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
pip install -U vllm transformers huggingface_hub
|
| 32 |
+
huggingface-cli login
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
๊ด๋ จ ์ฝ๋:
|
| 36 |
+
|
| 37 |
+
- GitHub: https://github.com/LLM-OS-Models/Terminal
|
| 38 |
+
- vLLM ํ๊ฐ ์คํ: `tb2_lite/scripts/replay_eval.py`
|
| 39 |
+
- chat template/fallback ์์ฑ: `tb2_lite/scripts/prompt_builder.py`
|
| 40 |
+
- JSON/command ์ฑ์ : `tb2_lite/scripts/replay_metrics.py`
|
| 41 |
+
|
| 42 |
+
vLLM ์ง์ ์คํ ์์. ํ๊ฐ ์ฝ๋์ ๋์ผํ๊ฒ chat template์ ์ฐ์ ์ฌ์ฉํ๊ณ , template์ด ์์ผ๋ฉด ChatML/Gemma fallback์ ์ฌ์ฉํฉ๋๋ค.
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
from transformers import AutoTokenizer
|
| 46 |
+
from vllm import LLM, SamplingParams
|
| 47 |
+
|
| 48 |
+
model_id = "LLM-OS-Models/Ouro-2.6B-terminal-sft"
|
| 49 |
+
tp = 1
|
| 50 |
+
|
| 51 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 52 |
+
llm = LLM(
|
| 53 |
+
model=model_id,
|
| 54 |
+
tokenizer=model_id,
|
| 55 |
+
trust_remote_code=True,
|
| 56 |
+
dtype="bfloat16",
|
| 57 |
+
tensor_parallel_size=tp,
|
| 58 |
+
max_model_len=49152,
|
| 59 |
+
gpu_memory_utilization=0.92,
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
messages = [
|
| 63 |
+
{"role": "system", "content": "You are a terminal automation assistant. Return JSON only."},
|
| 64 |
+
{"role": "user", "content": "Inspect the current directory and list Python files."},
|
| 65 |
+
]
|
| 66 |
+
|
| 67 |
+
def render_chatml(messages):
|
| 68 |
+
parts = []
|
| 69 |
+
for message in messages:
|
| 70 |
+
role = "assistant" if message["role"] == "assistant" else message["role"]
|
| 71 |
+
if role == "tool":
|
| 72 |
+
role = "user"
|
| 73 |
+
parts.append(f"<|im_start|>{role}\n{message['content']}<|im_end|>\n")
|
| 74 |
+
parts.append("<|im_start|>assistant\n")
|
| 75 |
+
return "".join(parts)
|
| 76 |
+
|
| 77 |
+
def render_gemma4_turn(messages, empty_thought_channel=False):
|
| 78 |
+
parts = ["<bos>"]
|
| 79 |
+
for message in messages:
|
| 80 |
+
role = "model" if message["role"] == "assistant" else message["role"]
|
| 81 |
+
if role == "tool":
|
| 82 |
+
role = "user"
|
| 83 |
+
parts.append(f"<|turn>{role}\n{message['content'].strip()}<turn|>\n")
|
| 84 |
+
parts.append("<|turn>model\n")
|
| 85 |
+
if empty_thought_channel:
|
| 86 |
+
parts.append("<|channel>thought\n<channel|>")
|
| 87 |
+
return "".join(parts)
|
| 88 |
+
|
| 89 |
+
def render_prompt(model_id, tokenizer, messages):
|
| 90 |
+
model_key = model_id.lower()
|
| 91 |
+
if "gemma-4" in model_key:
|
| 92 |
+
try:
|
| 93 |
+
return tokenizer.apply_chat_template(
|
| 94 |
+
messages,
|
| 95 |
+
tokenize=False,
|
| 96 |
+
add_generation_prompt=True,
|
| 97 |
+
enable_thinking=False,
|
| 98 |
+
)
|
| 99 |
+
except Exception:
|
| 100 |
+
return render_gemma4_turn(
|
| 101 |
+
messages,
|
| 102 |
+
empty_thought_channel=("26b" in model_key or "31b" in model_key),
|
| 103 |
+
)
|
| 104 |
+
try:
|
| 105 |
+
return tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 106 |
+
except Exception:
|
| 107 |
+
return render_chatml(messages)
|
| 108 |
+
|
| 109 |
+
prompt = render_prompt(model_id, tokenizer, messages)
|
| 110 |
+
sampling = SamplingParams(
|
| 111 |
+
temperature=0.0,
|
| 112 |
+
top_p=1.0,
|
| 113 |
+
max_tokens=1024,
|
| 114 |
+
repetition_penalty=1.0,
|
| 115 |
+
)
|
| 116 |
+
outputs = llm.generate([prompt], sampling_params=sampling)
|
| 117 |
+
print(outputs[0].outputs[0].text)
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
๊ถ์ฅ ์ถ๋ ฅ ํ์:
|
| 121 |
+
|
| 122 |
+
```json
|
| 123 |
+
{
|
| 124 |
+
"analysis": "brief reasoning about the next terminal action",
|
| 125 |
+
"plan": "short execution plan",
|
| 126 |
+
"commands": [
|
| 127 |
+
{"keystrokes": "ls -la\n", "duration": 0.1}
|
| 128 |
+
],
|
| 129 |
+
"task_complete": false
|
| 130 |
+
}
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
ํ๊ฐ์ ๋์ผํ replay ๋ช
๋ น:
|
| 134 |
+
|
| 135 |
+
```bash
|
| 136 |
+
python tb2_lite/scripts/replay_eval.py \
|
| 137 |
+
--model LLM-OS-Models/Ouro-2.6B-terminal-sft \
|
| 138 |
+
--model-short ouro_2p6b_terminal_sft \
|
| 139 |
+
--eval-path tb2_lite/data/replay_full.jsonl \
|
| 140 |
+
--output-dir /home/work/.data/tb2_lite_eval/corrected_readme_models_vllm \
|
| 141 |
+
--dtype bfloat16 \
|
| 142 |
+
--tp 1 \
|
| 143 |
+
--max-model-len 49152 \
|
| 144 |
+
--max-tokens 1024 \
|
| 145 |
+
--temperature 0.0 \
|
| 146 |
+
--top-p 1.0 \
|
| 147 |
+
--gpu-memory-utilization 0.92 \
|
| 148 |
+
--language-model-only
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
- ๊ธฐ๋ณธ ๊ถ์ฅ tensor parallel: `1`. OOM์ด๋ฉด `--tp`์ `tensor_parallel_size`๋ฅผ 2/4/8๋ก ์ฌ๋ฆฌ์ธ์.
|
| 152 |
+
- corrected TB2-lite ํ๊ฐ๋ `temperature=0.0`, `top_p=1.0`, `max_tokens=1024`๋ก ๊ณ ์ ํ์ต๋๋ค.
|
| 153 |
+
- Gemma 4๋ JSON ์ถ๋ ฅ์ ์ํด `enable_thinking=False`๋ฅผ ์ฌ์ฉํ๊ณ , 26B/31B ๊ณ์ด์ ํ๊ฐ ์ฝ๋์์ empty thought channel ์ฒ๋ฆฌ๋ฅผ ์๋ ์ ์ฉํฉ๋๋ค.
|
| 154 |
+
|
| 155 |
## ํ๊ฐ ๊ฒฐ๊ณผ
|
| 156 |
|
| 157 |
ํ๊ฐ๋ corrected TB2-lite replay set์์ vLLM์ผ๋ก ์ํํ์ต๋๋ค. ์์ ์ ์๋ `100 * avg_command_f1`๋ง ์ฌ์ฉํ๊ณ , `first_cmd_exact_pct`๋ ๋ณด์กฐ ์งํ๋ก๋ง ๋ด
๋๋ค.
|