Downloads · 30 days
5
3% of all-time downloads
kosiasuzu/chatml-llama3.1-8b-lora-merged
chatml-llama3.1-8b-lora-merged is a text generation model from kosiasuzu. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama3.1.
ChatML baseline for the AgenticML agent-format study: Llama 3.1 8B with instruct-style ChatML templates and tool-call tokens, LoRA-fine-tuned on the same agent-trajectory corpus as the AgenticML-format model, then mer…
Downloads · 30 days
5
3% of all-time downloads
All-time downloads
175
Public
Parameters
8B
32.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors32.1 GB · 100%
From the Hugging Face model README
ChatML baseline for the AgenticML agent-format study: Llama 3.1 8B with instruct-style ChatML templates and tool-call tokens, LoRA-fine-tuned on the same agent-trajectory corpus as the AgenticML-format model, then merged into full weights for single-checkpoint inference.
This checkpoint is the ChatML+tools comparison arm—same data and training recipe as kosiasuzu/agenticml-llama3.1-8b-lora-merged, differing only in serialization (HF messages + apply_chat_template vs AgenticML frames).
kosiasuzu/chatml-llama3.1-8b-lora-mergedkosiasuzu/chatml-agent-llama-3.1-8b-initInit base (chatml-agent-llama-3.1-8b-init): meta-llama/Llama-3.1-8B weights + meta-llama/Llama-3.1-8B-Instruct tokenizer; ChatML special-token rows in embed_tokens / lm_head mean-pooled from seed words (agenticml init-embeddings --format chatml).
Training target: supervised next-token prediction on the messages column (ChatML conversation derived from AgenticML trajectories via bridge.frames_to_messages during data-clean-push). Labels are masked to assistant spans only.
kosiasuzu/agenticml-agent-trajectory-datasetkosiasuzu/agenticml-llama3.1-8b-lora-merged<|eot_id|> / tool payloads.transformers + apply_chat_template (instruct tokenizer bundled with this checkpoint). Do not use the base meta-llama/Llama-3.1-8B tokenizer — it has no chat_template.agenticml eval-benchmarks --suite format_validity --format chatml.kosiasuzu/agenticml-llama3.1-8b-lora-merged on identical eval splits for fair format A/B tests.domain field).Paired checkpoint: kosiasuzu/agenticml-llama3.1-8b-lora-merged. Same dataset; ChatML uses messages, AgenticML uses frames.
Task: read main.py, return line count.
| ChatML (this model) | AgenticML (paired) |
|---|---|
| system + tools block in one message | separate <|goal|> + <|obs|> frames |
| user mission message | <|mission|> frame |
<|python_tag|>{"name":"read_file",...}<|eom_id|> | <|action|>{"tool":"read_file",...}<|end|> |
| tool role with JSON content | <|result|> frame |
| plain assistant answer text | <|action|>{"tool":"answer","text":"..."}<|end|> |
Conversion: bridge.py. Full pipeline: recipe.md.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "kosiasuzu/chatml-llama3.1-8b-lora-merged"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model.eval()
messages = [
{"role": "system", "content": "You are a helpful assistant with tools."},
{"role": "user", "content": "What is 17 * 23?"},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(
**inputs,
max_new_tokens=512,
do_sample=False,
pad_token_id=tokenizer.eos_token_id,
)
text = tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False)
print(text)
AgenticML CLI eval (requires pip install -e ".[eval]" from the AgenticML repo):
agenticml eval-benchmarks --suite format_validity \
--format chatml \
--model kosiasuzu/chatml-llama3.1-8b-lora-merged \
--output-dir results/benchmarks/format_validity
kosiasuzu/agenticml-agent-trajectory-datasettrain / eval (stratified by domain at dataset build time)messages (JSON string per row: ChatML message list from AgenticML frames)messages are dropped during tokenizationCommand (representative):
torchrun --standalone --nproc_per_node=2 -m agenticml.cli.commands.train_on_format --format chatml \
--model-id kosiasuzu/chatml-agent-llama-3.1-8b-init \
--dataset kosiasuzu/agenticml-agent-trajectory-dataset \
--hub-repo-id kosiasuzu/chatml-llama3.1-8b-lora-merged
Tokenizer: training loads the instruct tokenizer from the ChatML init checkpoint (init-embeddings --format chatml). Hub push stores the tokenizer on this merged repo alongside the weights.
tokenizer.apply_chat_template(..., return_assistant_tokens_mask=True) when supported; else assistant-span masking via token-id subsequence search.max_length=2048 (CLI default for chatml train).| Setting | Value |
|---|---|
| Regime | bf16, gradient checkpointing |
| LoRA rank | r=32, alpha=64, dropout=0.05 |
| LoRA targets | q/k/v/o_proj, gate/up/down_proj, lm_head |
| Epochs | 2 |
| LR | 2e-4, cosine, warmup 3% |
| Batch | per-device 1 × grad accum 32 (effective batch scales with world size) |
| Max grad norm | 1.0 |
| Weight decay | 0.1 |
| Seed | 42 |
| Multi-GPU | FSDP full_shard + auto_wrap (when using torchrun) |
| Logging | Weights & Biases (project=agenticml-agent, run name configurable) |
Fill from your W&B / cluster logs (GPU type, world size, wall-clock, peak VRAM).
eval on kosiasuzu/agenticml-agent-trajectory-datasetframes / messages columns)coding, finance, travel, …) — stratification in dataset builder--format chatml): parseable stop structure, tool-call JSON when present, non-empty assistant contentparse_rate, structural_valid_rate per domain (see eval JSON summary)Upstream benchmark matrix (subset runs, seed 42). Full table: docs/benchmark_results.md. Regenerate: agenticml eval-aggregate-results.
| Suite | n | Primary | Secondary | avg_tokens | avg_wall_sec |
|---|---|---|---|---|---|
| bfcl | 5 | accuracy 60% | avg_retry 1.6 | 20,139 | 192s |
| toolbench | 2 | pass 0% | avg_steps 12 | 40,350 | 848s |
| format_validity | — | not run | — | — | — |
| swe (lite) | — | not run | — | — | — |
Paired AgenticML model on the same suites: agenticml-llama3.1-8b-lora-merged.md.
agenticml eval-benchmarks --suite <bfcl|toolbench|swe|format_validity> --format chatml --model kosiasuzu/chatml-llama3.1-8b-lora-merged
agenticml eval-run-all --dry-run
agenticml eval-aggregate-results
Multi-GPU training via torchrun (typical: 2× GPU with FSDP); document your setup when publishing.
transformers ≥4.43, peft, datasets, torchagenticml train-on-format --format chatml / python -m agenticml.cli.commands.train_on_formatIf you use this model in research, cite the AgenticML project repository and acknowledge Meta Llama 3.1.
APA: [Author]. (Year). AgenticML: Agent-native serialization for language agents. GitHub repository. Baseline model: kosiasuzu/chatml-llama3.1-8b-lora-merged.
BibTeX: Add when a formal report or arXiv entry is available.