Views
No views yet
<tool_call> format, and
closes with a structured JSON triage report.alert → reasoning + <tool_call> → tool result → … → fenced JSON triage reportsuccess=true): tool
results and prompts are masked — only analyst reasoning, tool calls, and the
final report contribute to the gradient.| Metric | Value |
|---|---|
| JSON parse rate | 0.617 |
| Verdict accuracy | 0.617 |
| Decision accuracy | 0.617 |
| Technique F1 | 1.0 |
1import torch
2from peft import PeftModel
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5base = AutoModelForCausalLM.from_pretrained(
6 "HuggingFaceTB/SmolLM3-3B", torch_dtype=torch.bfloat16, device_map="cuda")
7model = PeftModel.from_pretrained(base, "alirezaaminzadeh/soc-agent-traces-smollm3-3b")
8tokenizer = AutoTokenizer.from_pretrained("alirezaaminzadeh/soc-agent-traces-smollm3-3b")
9
10prompt = tokenizer.apply_chat_template(messages, tokenize=False,
11 add_generation_prompt=True,
12 enable_thinking=False)<tool_call>...</tool_call> blocks from the generation, execute your
(read-only) tools, feed results back as role="tool" messages, and iterate
until the model emits the fenced JSON triage report. The companion demo Space
alirezaaminzadeh/soc-agent-traces
implements the full loop with smolagents.