zubairz4far/qwen3-1.7b-tool-calling
Qwen3-1.7B Tool-Calling QLoRA (V1)
PEFT/QLoRA adapter fine-tuned from Qwen/Qwen3-1.7B for structured calls across seven e-commerce and operations tools.
This is the selected V1 release. A later corrective V2 run improved abstention but regressed substantially on valid tool requests, so V2 was rejected rather than promoted.
- Interactive showcase: Qwen3 Tool Calling Lab
- Code, evaluation, and experiment record: zubairz4far/qwen3-tool-calling-qlora
- Rejected experiment:
zubairz4far/qwen3-1.7b-tool-calling-v2
Training details
Controlled held-out benchmark (240 examples)
The 240 held-out cases used paraphrases separate from the training template pool.
Locked final benchmark (150 unseen cases)
The final benchmark was frozen before comparing the base model, V1, and V2. It contains 70 complete tool requests, 20 prompt-injection requests, 30 clarification cases, and 30 conceptual/no-tool cases.
SHA-256: 5e1cbede7c2f80ee712c36dfee1dcf26b6a4b03e75c5ddc4d8dd3b9e3c5e0b02
V1 is strong at valid structured tool execution but too eager to invoke tools when required information is missing. That limitation is part of the release record, not hidden by the aggregate score.
V2 decision
V2 continued training from V1 on 600 corrective examples. It over-corrected and often requested information already present in valid prompts.
Release decision: retain V1 and reject V2. The locked final benchmark was not reused for another training round.
Loading the adapter
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "Qwen/Qwen3-1.7B"
adapter_id = "zubairz4far/qwen3-1.7b-tool-calling"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype="auto",
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()For reproducible prompting with tool schemas, use `src/inference.py`.
python src/inference.py \
--adapter zubairz4far/qwen3-1.7b-tool-calling \
--tools examples/tools.json \
--prompt "Check inventory for SKU GLM-001"Generation is deterministic (do_sample=False). Applications must validate the selected tool and arguments before performing real-world actions.
Intended use and limitations
This adapter is intended for portfolio, research, and experimentation with function calling, tool routing, and structured generation. It is not a generally safe autonomous agent or a production action-execution system.
- The datasets and benchmarks are synthetic and domain-specific.
- Reported results are controlled benchmark scores, not general real-world accuracy.
- Clarification behavior is the principal known V1 weakness.
- Free-form support-ticket text can make strict argument matching brittle.
- Downstream systems should schema-validate every generated call.
Author
Zubair Zafar — AI/ML Engineer focused on LLM fine-tuning, agentic systems, and automation.
