Skip to page content
SAVRN
Search Plan a project

Open-weight model · Text generation

qwen3-4b-tools-v1

by Abhijit Kapure AbhijitK20/qwen3-4b-tools-v1

qwen3-4b-tools-v1 is an open-weight model for text generation from Abhijit Kapure, released under Apache License 2.0. Its published files total 148.1 MB.

A LoRA fine-tune of unsloth/Qwen3-4B that teaches the model when not to call a tool. On BFCL v4 Irrelevance Detection, under identical conditions and a full 240-entry category: The baselines are statistically indistinguishable from this adapter.

Parameters—
Context—
Weights132.2 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By Abhijit Kapure, published under apache-2.0, revision cfce6005289a.

A LoRA fine-tune of unsloth/Qwen3-4B that teaches the model when not to call a tool. On BFCL v4 Irrelevance Detection, under identical conditions and a full 240-entry category: The baselines are statistically indistinguishable from this adapter. v1 leads the 8B by 0.84 points and its own base by 1.67 — two and four test cases respectively. The public benchmark does not support the claim that this fine-tune materially improved abstention. The much larger margin in the self-scored eval below does not replicate. The same recipe with --seed 1337 scored 97.50% on irrelevance — 20 entries better than this adapter, and a headline a 4B beating an 8B. It was meaningless. On BFCL Multiple (AST)…

Read Abhijit Kapure's full model card

Qwen3-4B Tool-Calling v1

A LoRA fine-tune of unsloth/Qwen3-4B that teaches the model when not to call a tool.

On BFCL v4 Irrelevance Detection, under identical conditions and a full 240-entry category:

Model Score
Qwen3-4B base (untrained) 87.50%
Qwen3-8B (untouched) 88.33%
v1 (this adapter) 89.17%
spread across all three 1.67 pts = 4 of 240

The baselines are statistically indistinguishable from this adapter. v1 leads the 8B by 0.84 points and its own base by 1.67 — two and four test cases respectively. The public benchmark does not support the claim that this fine-tune materially improved abstention. The much larger margin in the self-scored eval below does not replicate.

A second seed scored 97.50% and it was a trap

The same recipe with --seed 1337 scored 97.50% on irrelevance — 20 entries better than this adapter, and a headline a 4B beating an 8B. It was meaningless. On BFCL Multiple (AST), which requires emitting tool calls, seed-1337 scored 12.50% and called a tool on only 65 of 200 entries. This adapter calls on 195 of 200.

Model Irrelevance Multiple call rate Multiple AST Balanced
v1 (this adapter) 89.17% 97.5% 37.00% 93.15
seed 1337 97.50% 32.5% 12.50% 48.75 degenerate

Irrelevance rewards declining to call a tool and is maximised by always refusing. seed-1337 collapsed into refusing: "Yes, you can find the dimensions... Let me calculate it for you" — and then calculating nothing. Read the Balanced column, never Irrelevance alone; it is the harmonic mean of irrelevance accuracy and Multiple call rate, so it collapses if either side does.

Read the Limitations first. The primary eval harness is self-authored and in-distribution. A reviewer should weight it accordingly.

Results

Independent: BFCL v4 (bfcl-eval 2026.3.23, official harness)

All rows: temperature=0, max_tokens=512, complete categories.

BFCL v4 Irrelevance Detection Score
Qwen3-4B base (untrained) 87.50%
Qwen3-8B (untouched) 88.33%
v1 (this adapter) 89.17%
spread across all three 1.67 pts (4 of 240)

Multiple (AST): v1 scores 37.00%.

Why this is a negative result, stated plainly: the in-distribution eval shows v1 beating its own base by +26.4 points (64.3% → 90.7%) and the 8B by +37 points. BFCL shows +1.67 and +0.84 respectively. An untrained 4B already scores 87.5%, so BFCL's irrelevance set does not discriminate at this capability range and all three models tie within noise. The self-scored suite is harder; that argues for keeping it, and is not evidence that the credited fine-tune is real. I would not deploy this adapter expecting a measurable abstention gain over baseline.

Only 2 of 6 non-live categories were run. No overall BFCL score should be quoted — the scorer emits Non-Live Overall Acc: 9.12% for this partial run, an artifact of four missing categories scoring zero. Note also that BFCL refuses to score partial results, so every figure covers a complete category.

An uncapped v1 run scored 90.00% irrelevance / 36.50% multiple; the 512-token cap moves v1 by ≤1 point, so it is not the source of this result.

Self-authored eval (in-distribution, 390 prompts: 120 call, 12 easy-neg, 258 hard-neg)

Model Params Format Args exact Hard abstention
unsloth/Qwen3-4B (untrained) 4.0B 99/120 87/120 166/258 = 64.3%
v1 (this adapter) 4.0B 114/120 100/120 234/258 = 90.7%
Qwen3-8B (reference) 8.2B 119/120 103/120 138/258 = 53.5%

A 4B model beating a 2× larger model by 37 points on false-positive suppression.

Why abstention is the target

An agent that calls a tool when it shouldn't performs an irreversible action with the wrong arguments. An agent that declines when it could have acted simply asks again. The cost of a false positive is orders of magnitude worse than a false negative.

The base model was never broken at calling — it reached 100% format validity on toolace. What it lacked was calibration: the decision of whether to call. That is what this adapter targets.

Training

QLoRA via Unsloth, merged into fp16 before a single GGUF quantization pass.

Setting Value
Base unsloth/Qwen3-4B
LoRA rank / alpha 16 / 16
Target modules q,k,v,o + gate,up,down projections
Trainable params 33.03 M
Effective batch 16
Learning rate 2e-4
Epochs 1
Steps 1,200
Train examples 50,008

Training data is public function-calling corpora (glaive-function-calling-v2, toolace, when2call) plus synthetic easy and hard negatives. Hard negatives are prompts that look tool-shaped — a tool is defined and the request sounds actionable — but should be declined. They carry the bulk of the win.

Usage

Merge into the base model

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base = "unsloth/Qwen3-4B"
tok  = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(
    base, torch_dtype=torch.bfloat16, device_map="auto"
)
model = PeftModel.from_pretrained(model, "abhijitk20/qwen3-4b-tools-v1")
model = model.merge_and_unload()

Merge into fp16/bf16, not the 4-bit training base. Double quantization measurably degrades exact-argument accuracy, which is exactly what this adapter is trying to improve.

Inference

Serve the merged weights with native tool calling enabled. With vLLM:

vllm serve <merged-path> \
  --enable-auto-tool-choice \
  --tool-call-parser qwen3_coder \
  --max-model-len 16384

GGUF

A Q4_K_M GGUF is available separately for Ollama / llama.cpp users (see the linked GitHub repository). Note that GGUF quantization adds its own small accuracy cost on top of the adapter.

A failed experiment, kept deliberately

An earlier run (v4) added APIGen multi-step data in dominant proportion. It gained +2 arg-exact points and lost 44 hard-negative cases (−17.1 points), with the regression isolated entirely to the abstention split while toolace and glaive held or improved.

Diagnosis: APIGen is dominated by positive call examples. Increasing its share shifted the model's prior toward "a tool is available, therefore call it," diluting the negatives rather than outvoting them.

That run was rejected and is not published here. If you attempt to reproduce this, do not increase positive-call data proportion without loss-weighting the negatives to match.

Limitations

  1. Primary eval is in-distribution. The 390-prompt suite is built from the same source families used for training. Held-out, but not out-of-distribution. It measures did the model learn this data, not can the model use tools in the wild.
  2. The public benchmark does not corroborate the main claim. BFCL v4 Irrelevance, identical conditions, full category: untrained 4B base 87.50%, untouched Qwen3-8B 88.33%, v1 89.17%. Total spread 4 of 240 entries. The self-scored eval's +26.4-point and +37-point margins do not replicate publicly. Treat the in-distribution numbers as measuring fit to that eval's difficulty, not as a capability claim.
  3. Abstention metrics are gameable, and this repo nearly published one. A second seed reached 97.50% on irrelevance by refusing to call tools (32.5% call rate on Multiple). Always pair a refusal metric with one that requires acting; scripts/balanced_score.py does this.
  4. Seed variance is very large and only partly sampled. Two runs of the identical recipe scored 89.17% and 97.50% on irrelevance — an 8.3-point spread. Every single-seed number here is one sample, not a stable value.
  5. Coverage is thin. 2 of 6 non-live BFCL categories, no live/multi-turn or agentic categories; Multiple measured on 2 models, Irrelevance baselines at n=1.
  6. No terminal-agentic evaluation. No Terminal-Bench or SWE-bench number exists for this model. On Terminal-Bench 2.0 a 4B model of this class would be expected near 0-2% -- untuned Qwen3-8B scores 2.47%. Function-calling ability and terminal-agentic ability are different skills; this adapter only addresses the first.
  7. Multiple-call composition is weak. 37.00% AST on BFCL Multiple, though the model emits a tool call on 97.5% of those entries -- it calls often and is often wrong, rather than declining.
  8. Self-authored scorer. The scorer in eval_toolcalls.py is mine, not third-party, and was not adversarially tested for false positives. Given limitation 2, weight it accordingly.
  9. No hyperparameter search. No LR, epoch, or seed sweep was performed.

Hardware note

Trained on a single RTX 4050 Laptop with 6141 MiB VRAM (≈5.64 GiB usable to PyTorch after the Windows compositor claims its share) and 14 GB system RAM. This is a hard ceiling: 8B QLoRA needs roughly 8 GB and does not fit. max_seq_length=2048 OOMs; 1024 is the safe value. An earlier run died at step 200 of 1,369 for exactly this reason.

An integrated AMD GPU cannot be pooled with the NVIDIA card: integrated GPUs carve VRAM from system RAM, VRAM does not pool across vendors, and ROCm is unsupported on Windows.

License

Base model Qwen3-4B is Apache-2.0; this adapter is offered under the same terms. This is an unofficial derivative and is not affiliated with or endorsed by Alibaba/Qwen.

Full write-up

Training scripts, the rejected v4 experiment, per-source breakdowns, and the reasoning behind the mixture choices: https://github.com/AbhijitK20/qwen3-4b-tools-v1

Identity and Version

Repository
AbhijitK20/qwen3-4b-tools-v1
Publisher
Abhijit Kapure
Task
Text generation
Modality
Text
Library
peft
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
cfce6005289ac03a81da4b823786e413d5063e70
First published
2026-10-02
Last updated
2026-10-03

Files and Weights

11 files, 148.1 MB in total. The weights are 1 file totalling 132.2 MB in safetensors.

Weights1 file · 132.2 MB
Configuration3 files · 2.6 KB
Tokenizer4 files · 15.9 MB
Documentation1 file · 10.1 KB
Other1 file · 4.7 KB
Repository1 file · 1.6 KB
Every file
FileTypeSizeSHA-256
adapter_model.safetensorsWeights132.2 MB a61d58de5fbc
adapter_config.jsonConfiguration1.3 KB —
added_tokens.jsonConfiguration707 B —
special_tokens_map.jsonConfiguration614 B —
README.mdDocumentation10.1 KB —
chat_template.jinjaOther4.7 KB —
.gitattributesRepository1.6 KB —
merges.txtTokenizer1.7 MB —
tokenizer.jsonTokenizer11.4 MB aeb13307a71a
tokenizer_config.jsonTokenizer5.4 KB —
vocab.jsonTokenizer2.8 MB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
132.2 MB
Download from Abhijit Kapure

Released by Abhijit Kapure through its official repository on Hugging Face. Read the license.

Built From

  • Adapter of unsloth/Qwen3-4B
  • Derived from unsloth/Qwen3-4B

Memory Requirements

PrecisionWeights in memory
As published132.2 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About qwen3-4b-tools-v1

Can I use qwen3-4b-tools-v1 commercially?

Yes. qwen3-4b-tools-v1 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Text generation

opt-125m

AI at Meta

OPT was first introduced in Open Pre-trained Transformer Language Models and first released in metaseq's repository on May 3rd 2022 by Meta AI. Disclaimer: The team releasing OPT wrote an official model card, which is available in Appendix D of the paper. Content from this model card has been written by the Hugging Face team. To quote the first two paragraphs of the official paper OPT was predominantly pretrained with English text, but a small amount of non-English data is still present within the training corpus via CommonCrawl. The model was pretrained using a causal language modeling (CLM) objective. OPT belongs to the same family of decoder-only models like GPT-3. As such, it was…

Open weights other 2,048 tokens transformers

Model · Text generation

Ornith-1.5-9B-GGUF

Ornith

Chirp Chirp! We are introducing Ornith-1.5, a major step toward building foundation models through end-to-end self-improvement. Ornith-1.5 extends Ornith-1.0 (which was developed on top of Qwen3.5 and Gemma4 with additional continued pretraining, mid-training, and post-training) by expanding the self-improvement loop from scaffold and rollout optimization to jointly optimizing task generation, scaffold construction, and solution rollouts. Rather than relying on a fixed set of human-curated tasks and manually designed harnesses, Ornith-1.5 continuously generates new training tasks, discovers effective strategies for solving them, and improves the policy through reinforcement learning. For…

Open weights mit transformers

Model · Text generation

Ornith-1.5-35B-A3B-GGUF

Ornith

Chirp Chirp! We are introducing Ornith-1.5, a major step toward building foundation models through end-to-end self-improvement. Ornith-1.5 extends Ornith-1.0 (which was developed on top of Qwen3.5 and Gemma4 with additional continued pretraining, mid-training, and post-training) by expanding the self-improvement loop from scaffold and rollout optimization to jointly optimizing task generation, scaffold construction, and solution rollouts. Rather than relying on a fixed set of human-curated tasks and manually designed harnesses, Ornith-1.5 continuously generates new training tasks, discovers effective strategies for solving them, and improves the policy through reinforcement learning. For…

Open weights mit transformers

Model · Text generation

Ternary-Bonsai-2-27B-gguf

Prism ML

Full 27B-class reasoning in ternary transformer weights, for llama.cpp (CUDA, Metal, CPU) - \~5.9 GB language model (down from \~54 GB FP16) — full 27B-class reasoning on a standard laptop or a single GPU - 98.2% of FP16 intelligence retained: 84.78 average across 14 thinking-mode benchmarks — far above the conventional IQ2XXS build (72.59) at about 82% of its footprint, and within 0.4 points of UD-Q4KXL at three times the footprint - Retains thinking, reasoning, and agentic behavior deep in the sub-4-bit regime, where conventional low-bit representations collapse: math within half a point of full precision (96.57), coding level with the baseline (89.42), agentic tool calling at 74.92…

Open weights apache-2.0 llama.cpp

Uncensored Qwen3.8-27B, published as GGUF quantizations with the multi token prediction (MTP) head retained and verified. Refusal behaviour has been substantially reduced, not eliminated. See Measured behaviour for the numbers. Capabilities, training data, and architecture are otherwise unchanged. - Refusal directions removed with Heretic, which co minimizes refusal count against KL divergence from the base model. No handwritten refusal removal code, no finetuning, no additional training data. - Abliteration runs at bf16 (no 4 bit quantization). the resulting LoRA is merged into the bf16 base, so the published weights are not a quantized round trip. - mtp. tensors are copied verbatim from…

Open weights apache-2.0 llama.cpp

Model · Text generation

Ornith-1.0-9B-GGUF

Ornith

Aloha! Today, we are releasing Ornith-1.0, a self-improving family of open-source models for agentic coding. This model card documents Ornith-1.0-9B, the most lightweight member of the Ornith family, designed for efficient single-GPU deployment. Ornith-1.0-9B is a dense ~9B model (≈19 GB in bf16), so it serves comfortably on a single 80GB GPU. The recipes below stand up an OpenAI-compatible server; add --tensor-parallel-size / --tp if you want to shard across more GPUs. For a quick local test (or to script offline generation), load the model directly with Transformers. Make sure you have a recent release installed — see the Transformers installation guide; Ornith-1.0-9B requires…

Open weights mit transformers