Qwen3-8B fine-tuned on Toucan-1.5M (tool calling)

Merged 16-bit QLoRA fine-tune of Qwen3-8B on a stratified 1,000-sample slice of the SFT config of Agent-Ark/Toucan-1.5M.

Training data

Stratified across Toucan's pipeline stages so the model learns both to call tools and to decline when none fit:

Stage Rows Purpose
multi-turn 400 Extended interactions, densest tool use
single-turn-original 250 Basic single-shot tool calling
irrelevant 200 Declining when available tools don't match (zero tool calls by design)
single-turn-diversify 150 Reworded task variants

Median 2 tool calls per row (max 19), median 1,875 tokens. Examples over 4,096 tokens were dropped rather than truncated, to avoid teaching the model to stop mid-trajectory.

Training setup

  • QLoRA, 4-bit, rank 16, alpha 16, all attention + MLP projections
  • 1 epoch, 125 steps, effective batch 8, lr 2e-4 cosine
  • Loss on assistant turns only (tool outputs masked)
  • Single Tesla T4, fp16, ~1h47m
  • Final training loss 1.18 (from 2.17)

Verified behaviour

Two-sided probe on held-out examples:

  • Calls when it should — given PubChem tools and asked for caffeine properties, emitted a valid <tool_call> with the correct tool name and arguments.
  • Declines when it should — given only Figma tools for an academic citation query, emitted no tool call, named the mismatch, and redirected to appropriate resources.

Caveats

Small-scale run: 1,000 samples against a 119k-row config drawn from a 1.5M-row dataset. Not benchmarked against base Qwen3-8B on BFCL V3 or MCP-Universe, so any capability claim is unverified. This validates the training recipe rather than demonstrating a capability gain over the base model.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Rumiii/qwen3-8b-toucan"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype="auto", device_map="auto"
)

tools = [{"type": "function", "function": {
    "name": "get_weather",
    "description": "Get current weather for a city",
    "parameters": {"type": "object",
                   "properties": {"city": {"type": "string"}},
                   "required": ["city"]}}}]

msgs = [{"role": "user", "content": "What's the weather in Hyderabad?"}]
text = tok.apply_chat_template(
    msgs, tools=tools, tokenize=False, add_generation_prompt=True
)
out = model.generate(
    **tok(text, return_tensors="pt").to(model.device),
    max_new_tokens=512, temperature=0.6, top_p=0.95, top_k=20
)
print(tok.decode(out[0], skip_special_tokens=False))

Sampling: temperature 0.6, top_p 0.95, top_k 20. Avoid greedy decoding (Qwen3 guidance — it can cause repetition loops).

Downloads last month
114
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Rumiii/Qwen3-8B-Maxima_A1

Finetuned
Qwen/Qwen3-8B
Finetuned
(2093)
this model

Dataset used to train Rumiii/Qwen3-8B-Maxima_A1