TurkishCodeMan/Nanbeige4.1-3B-Gmail-Tool-Use
27
Nanbeige4.1-3B โ Gmail Tool-Use (SFT + DPO)
Fine-tuned version of Nanbeige/Nanbeige4.1-3B for Gmail tool-calling tasks using a two-stage training pipeline.
<div align="center"> <img src="https://images.hdqwalls.com/wallpapers/king-glory-anime-boy-4k-ka.jpg" width="800" alt="Nanbeige Gmail Agent Chains" style="border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.2);"> <br><br> <h1>๐ง Nanbeige-4.1-3B Gmail Tool Use Agent</h1> <p><i>A hyper-aligned 3B parameter agent matching GPT-4o-mini performance inside LangGraph.</i></p> </div>
<br>
Training datasets: TurkishCodeMan/Nanbeige4.1-3B-Gmail-Tool-Use-Datasets
Training Pipeline
Stage 1 โ Supervised Fine-Tuning (SFT)
- Dataset: 740 multi-turn Gmail agent traces (
sft/traces_chatml_clean.jsonl) - Format: ChatML with tool_calls (OpenAI function-calling schema)
- Method: LoRA r=16, ฮฑ=32, 7 target modules
- Result: loss 0.8464 โ 0.1888 ยท PPL 2.33 โ 1.21
Stage 2 โ Direct Preference Optimization (DPO)
- Dataset: 3223 preference pairs (
dpo/dpo_dataset.jsonl) โ 3 rejection strategies: wrong_toolโ incorrect tool selected (~34%)missing_argsโ required arguments omitted (~32%)bad_answerโ poor final response (~34%)- Method: DPO ฮฒ=0.1, sigmoid loss, LoRA r=16,
ref_model=None(PEFT implicit ref) - Result: val_loss=0.000765 ยท reward accuracy=100% ยท normalized margin=+0.52
Supported Tools
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained(
"TurkishCodeMan/Nanbeige4.1-3B-Gmail-Tool-Use",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
"TurkishCodeMan/Nanbeige4.1-3B-Gmail-Tool-Use",
trust_remote_code=True,
)