Paired ChatML baseline for the same study:
kosiasuzu/chatml-llama3.1-8b-lora-merged.
Paired checkpoint:
kosiasuzu/chatml-llama3.1-8b-lora-merged. Same dataset and training recipe; only serialization differs.
ChatML tool-call generation uses
<\|python_tag\|>{...}<\|eom_id\|>. Conversion:
bridge.py. Full pipeline:
recipe.md.
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4from agenticml.agentic_template import parse_reserved_wire
5from agenticml.constants import END_MARKER_TOKEN_ID
6from agenticml.trajectory import Trajectory
7
8model_id = "kosiasuzu/agenticml-llama3.1-8b-lora-merged"
9
10tokenizer = AutoTokenizer.from_pretrained(model_id)
11model = AutoModelForCausalLM.from_pretrained(
12 model_id,
13 torch_dtype=torch.bfloat16,
14 device_map="auto",
15)
16model.eval()
17
18frames = [
19 {"type": "goal", "content": "You are a calculator assistant."},
20 {"type": "mission", "content": "What is 17 * 23?"},
21]
22prompt_ids = tokenizer.apply_chat_template(
23 Trajectory(frames).to_dict(),
24 tokenize=True,
25 add_generation_prompt=False,
26 add_special_tokens=False,
27)
28device = next(model.parameters()).device
29inputs = torch.tensor([prompt_ids], device=device, dtype=torch.long)
30pad_id = tokenizer.pad_token_id or tokenizer.eos_token_id
31with torch.no_grad():
32 out = model.generate(
33 inputs,
34 attention_mask=torch.ones_like(inputs),
35 max_new_tokens=512,
36 do_sample=False,
37 eos_token_id=[END_MARKER_TOKEN_ID, tokenizer.eos_token_id],
38 pad_token_id=pad_id,
39 )
40
41gen_text = tokenizer.decode(out[0][len(prompt_ids):].tolist())
42print(parse_reserved_wire(gen_text, strict=False))
1agenticml eval-benchmarks --suite format_validity \
2 --format agenticml \
3 --model kosiasuzu/agenticml-llama3.1-8b-lora-merged \
4 --output-dir results/benchmarks/format_validity
1torchrun --standalone --nproc_per_node=2 -m agenticml.cli.commands.train_on_format --format agenticml \
2 --model-id kosiasuzu/agenticml-agent-llama-3.1-8b-init \
3 --dataset kosiasuzu/agenticml-agent-trajectory-dataset \
4 --hub-repo-id kosiasuzu/agenticml-llama3.1-8b-lora-merged
Upstream benchmark matrix (subset runs, seed 42). Full table:
docs/benchmark_results.md. Regenerate:
agenticml eval-aggregate-results.
Paired ChatML baseline on the same suites: see
chatml-llama3.1-8b-lora-merged.md.
1agenticml eval-benchmarks --suite <bfcl|toolbench|swe|format_validity> --format agenticml --model kosiasuzu/agenticml-llama3.1-8b-lora-merged
2agenticml eval-run-all --dry-run
3agenticml eval-aggregate-results