Instructions to use Mustafaege/Qwen3-VL-4B-tool-calling-ft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Mustafaege/Qwen3-VL-4B-tool-calling-ft with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen3-vl-4b-instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "Mustafaege/Qwen3-VL-4B-tool-calling-ft") - Transformers
How to use Mustafaege/Qwen3-VL-4B-tool-calling-ft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mustafaege/Qwen3-VL-4B-tool-calling-ft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Mustafaege/Qwen3-VL-4B-tool-calling-ft", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Mustafaege/Qwen3-VL-4B-tool-calling-ft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mustafaege/Qwen3-VL-4B-tool-calling-ft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mustafaege/Qwen3-VL-4B-tool-calling-ft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Mustafaege/Qwen3-VL-4B-tool-calling-ft
- SGLang
How to use Mustafaege/Qwen3-VL-4B-tool-calling-ft with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Mustafaege/Qwen3-VL-4B-tool-calling-ft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mustafaege/Qwen3-VL-4B-tool-calling-ft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Mustafaege/Qwen3-VL-4B-tool-calling-ft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mustafaege/Qwen3-VL-4B-tool-calling-ft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Mustafaege/Qwen3-VL-4B-tool-calling-ft with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mustafaege/Qwen3-VL-4B-tool-calling-ft to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Mustafaege/Qwen3-VL-4B-tool-calling-ft to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Mustafaege/Qwen3-VL-4B-tool-calling-ft to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Mustafaege/Qwen3-VL-4B-tool-calling-ft", max_seq_length=2048, ) - Docker Model Runner
How to use Mustafaege/Qwen3-VL-4B-tool-calling-ft with Docker Model Runner:
docker model run hf.co/Mustafaege/Qwen3-VL-4B-tool-calling-ft
Qwen3-VL-4B Tool Calling Fine-tune
A LoRA adapter fine-tuned on top of unsloth/qwen3-vl-4b-instruct-bnb-4bit for tool calling / function calling tasks. The model supports structured <tool_call> / <tool_response> XML format and can handle both text and image inputs.
Model Details
| Property | Value |
|---|---|
| Base Model | unsloth/qwen3-vl-4b-instruct-bnb-4bit |
| Model Type | Vision-Language (Qwen3-VL), Causal LM |
| Fine-tune Method | LoRA (PEFT) |
| LoRA Rank (r) | 16 |
| LoRA Alpha | 16 |
| LoRA Dropout | 0 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Adapter Size | ~143 MB |
| PEFT Version | 0.18.1 |
| License | Apache 2.0 |
| Developed by | Mustafaege |
Intended Use
This model is designed for agentic and tool-use pipelines where an LLM needs to:
- Select and invoke tools/functions based on user queries
- Parse tool responses and continue reasoning
- Handle multimodal inputs (text + images) alongside tool use
Direct Use
Load the adapter and use it for tool-calling inference in any framework that supports PEFT/LoRA.
Out-of-Scope Use
- General-purpose chat without tool schemas (use the base instruct model instead)
- Tasks requiring models larger than 4B parameters for complex reasoning
How to Get Started
Installation
pip install transformers peft unsloth torch
Basic Inference
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "unsloth/qwen3-vl-4b-instruct-bnb-4bit"
adapter_id = "Mustafaege/Qwen3-VL-4B-tool-calling-ft"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForCausalLM.from_pretrained(base_model_id, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
Tool Calling Example
tools = [
{
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
},
"required": ["location"]
}
}
]
messages = [
{"role": "user", "content": "What's the weather like in Istanbul?"}
]
text = tokenizer.apply_chat_template(
messages,
tools=tools,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.1)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(response)
# Expected: <tool_call>
# {"name": "get_weather", "arguments": {"location": "Istanbul", "unit": "celsius"}}
# </tool_call>
Using with Unsloth (Faster Inference)
from unsloth import FastVisionModel
model, tokenizer = FastVisionModel.from_pretrained(
model_name="Mustafaege/Qwen3-VL-4B-tool-calling-ft",
load_in_4bit=True,
)
FastVisionModel.for_inference(model)
Tool Call Format
The model uses XML-style tags for tool interactions:
Tool invocation (model output):
<tool_call>
{"name": "function_name", "arguments": {"param1": "value1"}}
</tool_call>
Tool response (user message):
<tool_response>
{"result": "..."}
</tool_response>
Training Details
Training Data
Fine-tuned on a custom tool-calling dataset covering diverse function schemas and multi-turn tool-use conversations.
Training Procedure
- Framework: Unsloth + PEFT
- Method: LoRA (Low-Rank Adaptation)
- Base quantization: 4-bit (BitsAndBytes NF4)
- Training regime: bf16 mixed precision
Limitations & Bias
- Performance depends heavily on the quality and coverage of the tool schemas provided
- May hallucinate function calls for tools not present in the schema
- Vision capabilities are inherited from the base model; visual grounding for tool calling is experimental
- Limited to the tool-calling patterns seen in training data
Citation
If you use this model, please cite the base model:
@misc{qwen3vl,
title={Qwen3-VL Technical Report},
author={Qwen Team},
year={2025},
publisher={Alibaba Cloud}
}
Framework Versions
- PEFT 0.18.1
- Transformers ≥ 4.51.0
- Downloads last month
- 3