Downloads · 30 days
12
0% of all-time downloads
LLM-OS-Models/gemma-4-E2B-Terminal-SFT-Native-Liquid-2Epoch
gemma-4-E2B-Terminal-SFT-Native-Liquid-2Epoch is a text generation model from LLM-OS-Models. Use it when you need the model to write or continue text. It is set up for transformers.
터미널 작업 자동화를 위한 Terminal SFT 모델입니다. 입력된 작업/이전 터미널 상태를 보고 다음에 실행할 명령을 JSON 형태로 생성하는 용도로 학습했습니다.
Downloads · 30 days
12
0% of all-time downloads
All-time downloads
4.1K
Public
Parameters
5.1B
20.2 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors20.2 GB · 100%
How the weights are stored.
F325.1B · 100%
From the Hugging Face model README
터미널 작업 자동화를 위한 Terminal SFT 모델입니다. 입력된 작업/이전 터미널 상태를 보고 다음에 실행할 명령을 JSON 형태로 생성하는 용도로 학습했습니다.
google/gemma-4-E2B2 epochs, Gemma native Liquid preprocessing2026-05-14 07:17:08 UTCgemma4_e2b_base_native_e2설치와 로그인:
pip install -U vllm transformers huggingface_hub
huggingface-cli login
관련 코드:
tb2_lite/scripts/replay_eval.pytb2_lite/scripts/prompt_builder.pytb2_lite/scripts/replay_metrics.pyvLLM 직접 실행 예시. 평가 코드와 동일하게 chat template을 우선 사용하고, template이 없으면 ChatML/Gemma fallback을 사용합니다.
from transformers import AutoTokenizer
from vllm import LLM, SamplingParams
model_id = "LLM-OS-Models/gemma-4-E2B-Terminal-SFT-Native-Liquid-2Epoch"
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)
권장 출력 형식:
{
"analysis": "brief reasoning about the next terminal action",
"plan": "short execution plan",
"commands": [
{"keystrokes": "ls -la\n", "duration": 0.1}
],
"task_complete": false
}
평가와 동일한 replay 명령:
python tb2_lite/scripts/replay_eval.py \
--model LLM-OS-Models/gemma-4-E2B-Terminal-SFT-Native-Liquid-2Epoch \
--model-short gemma4_e2b_base_native_e2 \
--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 \
--thinking-mode off \
--strip-thinking-history auto \
--gemma4-empty-thought-channel auto \
--language-model-only
1. OOM이면 --tp와 tensor_parallel_size를 2/4/8로 올리세요.temperature=0.0, top_p=1.0, max_tokens=1024로 고정했습니다.enable_thinking=False를 사용하고, 26B/31B 계열은 평가 코드에서 empty thought channel 처리를 자동 적용합니다.평가는 corrected TB2-lite replay set에서 vLLM으로 수행했습니다. 순위 점수는 100 * avg_command_f1만 사용하고, first_cmd_exact_pct는 보조 지표로만 봅니다.
6 / 816.220.16220.27470.167815.2%16.2%303 / 500.28973.4smodel_specific_or_mixedTrue2026-05-09T00:56:16.6523958Prompt/template audit:
{
"template_status": "model_specific_or_mixed",
"rank_eligible": true,
"steps": 303,
"tasks": 50
}
0.289 sec/step 수준으로 빠른 편입니다.TB2-lite 점수는 일반 지능 벤치마크가 아니라 터미널 next-action JSON 재현 능력을 측정합니다. 따라서 모델 크기, chat template 일치, assistant-only masking, tokenizer, 학습 데이터 holdout 여부가 모두 점수에 영향을 줍니다.
README.md와 MODEL_EVALUATION_REPORT.md의 값이 더 최신이면 해당 값을 우선 확인하세요. 이 모델카드는 완료된 평가 JSON을 기준으로 개별 저장소에 빠르게 반영한 스냅샷입니다.