PTTREP/bfcl-v4-qwen3-32b-code-implementation-lora
a tool call generation adapter
2 min readupdated
This repository contains a PEFT LoRA (a small add-on for a base model) adapter for the Qwen3-32B large language model. The model is fine-tuned to generate a single tool JSON call (including the name and arguments) from a prompt and documentation within the BFCL V4 benchmark. The adapter is optimized for the Implementation-hypothesis CODE format and enables more precise structured function calls. This solution is useful for developers integrating language models into pipelines with external API and tool calls.
Key features
- Trained using 4-bit NF4 base model loading
- Uses LoRA with a rank of 16 and an alpha parameter of 32
- Generates canonical JSON calls inside special tags
- Trained on 400 examples with 549 unique tool definitions
What you can do
- Integrate the adapter into a Qwen3-32B-based function calling system
- Use it to automate tasks requiring precise JSON API request formatting
- Test performance with tool call documentation in the Implementation-hypothesis format
Example
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_id = "Qwen/Qwen3-32B"
base_revision = "9216db5781bf21249d130ec9da846c4624c16137"
base = AutoModelForCausalLM.from_pretrained(base_id, revision=base_revision, device_map="auto", torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained(base_id, revision=base_revision)
model = PeftModel.from_pretrained(base, "PTTREP/bfcl-v4-qwen3-32b-code-implementation-lora")Read more
DetailsBenchmarks: across 800 tests, the adapter selected the correct tool in 794 cases and passed the full checker in 703 cases (the base model achieved 714).
Requirements: requires the Qwen3-32B base model and PEFT support.
Training: 3 epochs, learning rate 1e-4, seed 42, all linear projections.










Comments