Text Generation
Transformers
Safetensors
English
qwen3
text-generation-inference
unsloth
conversational
Instructions to use wesjos/Qwen3-4B-toolcall with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wesjos/Qwen3-4B-toolcall with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wesjos/Qwen3-4B-toolcall") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("wesjos/Qwen3-4B-toolcall") model = AutoModelForCausalLM.from_pretrained("wesjos/Qwen3-4B-toolcall") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wesjos/Qwen3-4B-toolcall with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wesjos/Qwen3-4B-toolcall" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wesjos/Qwen3-4B-toolcall", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wesjos/Qwen3-4B-toolcall
- SGLang
How to use wesjos/Qwen3-4B-toolcall 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 "wesjos/Qwen3-4B-toolcall" \ --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": "wesjos/Qwen3-4B-toolcall", "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 "wesjos/Qwen3-4B-toolcall" \ --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": "wesjos/Qwen3-4B-toolcall", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use wesjos/Qwen3-4B-toolcall 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 wesjos/Qwen3-4B-toolcall 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 wesjos/Qwen3-4B-toolcall to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for wesjos/Qwen3-4B-toolcall to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="wesjos/Qwen3-4B-toolcall", max_seq_length=2048, ) - Docker Model Runner
How to use wesjos/Qwen3-4B-toolcall with Docker Model Runner:
docker model run hf.co/wesjos/Qwen3-4B-toolcall
Model information
- Finetine on Model:unsloth/Qwen3-4B-unsloth-bnb-4bit
- Dataset: interstellarninja/tool-calls-single-reasoning, mlabonne/FineTome-100k, unsloth/OpenMathReasoning-mini
Eval
- some improvements are made after finetuning
- gpqa: 0.24 --> 0.333
- gsm8k: 0.5 --> 0.68
- tool_bench: 0.1667 --> 0.3182
Before finetuning(unsloth/Qwen3-4B-unsloth-bnb-4bit)
+---------+------------+-----------------+---------------+-------+---------+---------+ | Model | Dataset | Metric | Subset | Num | Score | Cat.0 | +=========+============+=================+===============+=======+=========+=========+ | qwen | gpqa | AveragePass@1 | gpqa_extended | 50 | 0.24 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | qwen | gpqa | AveragePass@1 | gpqa_main | 50 | 0.26 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | qwen | gpqa | AveragePass@1 | gpqa_diamond | 50 | 0.22 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | qwen | gpqa | AveragePass@1 | OVERALL | 150 | 0.24 | - | +---------+------------+-----------------+---------------+-------+---------+---------+ | qwen | gsm8k | AverageAccuracy | main | 50 | 0.5 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | qwen | tool_bench | Act.EM | in_domain | 42 | 0.1667 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | qwen | tool_bench | Act.EM | out_of_domain | 48 | 0.1667 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | qwen | tool_bench | Act.EM | OVERALL | 90 | 0.1667 | - | +---------+------------+-----------------+---------------+-------+---------+---------+
After finetuning(This model)
+---------+------------+-----------------+---------------+-------+---------+---------+ | Model | Dataset | Metric | Subset | Num | Score | Cat.0 | +=========+============+=================+===============+=======+=========+=========+ | model | gpqa | AveragePass@1 | gpqa_extended | 50 | 0.26 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | gpqa | AveragePass@1 | gpqa_main | 50 | 0.36 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | gpqa | AveragePass@1 | gpqa_diamond | 50 | 0.38 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | gpqa | AveragePass@1 | OVERALL | 150 | 0.3333 | - | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | gsm8k | AverageAccuracy | main | 50 | 0.68 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | tool_bench | Act.EM | in_domain | 41 | 0.3171 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | tool_bench | Act.EM | out_of_domain | 47 | 0.3191 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | tool_bench | Act.EM | OVERALL | 88 | 0.3182 | - | +---------+------------+-----------------+---------------+-------+---------+---------+
Qwen/Qwen3-4B model
+---------+------------+-----------------+---------------+-------+---------+---------+ | Model | Dataset | Metric | Subset | Num | Score | Cat.0 | +=========+============+=================+===============+=======+=========+=========+ | model | gpqa | AveragePass@1 | gpqa_extended | 50 | 0.32 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | gpqa | AveragePass@1 | gpqa_main | 50 | 0.22 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | gpqa | AveragePass@1 | gpqa_diamond | 50 | 0.18 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | gpqa | AveragePass@1 | OVERALL | 150 | 0.24 | - | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | gsm8k | AverageAccuracy | main | 50 | 0.48 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | tool_bench | Act.EM | in_domain | 43 | 0.1628 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | tool_bench | Act.EM | out_of_domain | 47 | 0.1702 | default | +---------+------------+-----------------+---------------+-------+---------+---------+ | model | tool_bench | Act.EM | OVERALL | 90 | 0.1667 | - | +---------+------------+-----------------+---------------+-------+---------+---------+
- Downloads last month
- 5
Model tree for wesjos/Qwen3-4B-toolcall
Unable to build the model tree, the base model loops to the model itself. Learn more.